Documentation
¶
Index ¶
- Variables
- type Config
- func (c *Config) ApplyOverrides(overrides Config)
- func (c *Config) AsMap() map[string]string
- func (c *Config) ClientTimeout() int
- func (c *Config) LogLevelFor(scope string) string
- func (c *Config) PollInterval() time.Duration
- func (c *Config) SocketPath() string
- func (c *Config) ToEnvMap() map[string]string
- type Embeddings
- type 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"`
PollIntervalSec int `yaml:"poll_interval_sec" env:"MNEMONIC_POLL_INTERVAL_SEC,default=10"`
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"`
// AuthToken, if non-empty, requires all TCP HTTP requests to present "Authorization: Bearer <token>".
AuthToken string `yaml:"auth_token" env:"MNEMONIC_AUTH_TOKEN"`
// AllowedOrigins enables CORS for the listed origins. Use "*" to permit any origin.
AllowedOrigins []string `yaml:"allowed_origins" env:"MNEMONIC_ALLOWED_ORIGINS"`
// UnauthenticatedStatus exempts GET /api/status from bearer-token enforcement on TCP.
UnauthenticatedStatus bool `yaml:"unauthenticated_status" env:"MNEMONIC_UNAUTHENTICATED_STATUS"`
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) PollInterval ¶ added in v0.0.10
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 {
Type string `yaml:"type" env:"INDEX_TYPE,default=hnsw"`
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 vector index.
Click to show internal directories.
Click to hide internal directories.