Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "0.1.0"
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
LogLevel string `yaml:"log_level" env:"LOG_LEVEL,default=warn"`
// Logging allows for scoped logging, e.g. server=warn; scopes will be 1:1 with packages, e.g. server, store, etc.
Logging map[string]string `yaml:"logging" env:"MNEMONIC_LOGGING,separator=="`
ClientTimeoutSec int `yaml:"client_timeout_sec" env:"MNEMONIC_CLIENT_TIMEOUT_SEC,default=5"`
ServerAddr string `yaml:"server_addr" env:"MNEMONIC_SERVER_ADDR,default=localhost:20001"`
SocketPathRaw string `yaml:"socket_path" env:"MNEMONIC_SOCKET_PATH,default=~/.mnemonic/mnemonic.sock"`
Embeddings Embeddings `yaml:"embeddings" env:", prefix=MNEMONIC_EMBEDDINGS_"`
Index Index `yaml:"index" env:", prefix=MNEMONIC_INDEX_"`
}
func Load ¶
Load reads config from the given YAML file paths (later paths win) and then overlays environment variables on top. Environment variables always take precedence over file values.
func (*Config) ApplyOverrides ¶
ApplyOverrides merges non-empty/non-zero fields from overrides into c. Use this to apply CLI flags or other sources that should take precedence.
func (*Config) ClientTimeout ¶
func (*Config) LogLevelFor ¶
func (*Config) SocketPath ¶
SocketPath returns the expanded Unix socket path for daemon IPC.
type Embeddings ¶
type Embeddings struct {
Endpoint string `yaml:"endpoint" env:"ENDPOINT,default=http://127.0.0.1:1234/v1/embeddings"`
Model string `yaml:"model" env:"MODEL,default=nomic-ai/nomic-embed-text-v1.5"`
AuthToken string `yaml:"auth_token" env:"AUTH_TOKEN"`
// SkipPreflight is a boolean flag to skip the preflight check before building the index.
// This is useful for testing or if the user is confident that the embedding endpoint is working correctly.
SkipPreflight bool `yaml:"skip_preflight" env:"SKIP_PREFLIGHT"`
}
Embeddings holds configuration for the embedding endpoint and model. Defaults are LM Studio specifics.
type Index ¶
type Index struct {
Dimensions int `yaml:"dimensions" env:"DIMENSIONS,default=768"`
Connections int `yaml:"connections" env:"CONNECTIONS,default=16"`
LevelFactor float64 `yaml:"level_factor" env:"LEVEL_FACTOR,default=0.25"`
EfSearch int `yaml:"ef_search" env:"EF_SEARCH,default=50"`
}
Index holds configuration for the HNSW index parameters (expects simplified interface of github.com/coder/hnsw).
Click to show internal directories.
Click to hide internal directories.