Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigDir() (string, error)
- func LooseMode(dir string) (mode fs.FileMode, ok bool)
- func Set(dir, key string, value any) error
- func Values(cfg *Config) map[string]any
- type Config
- type DBConfig
- type DefaultsConfig
- type EmbeddingConfig
- type Key
- type Kind
- type LLMConfig
- type LogConfig
- type MCPConfig
- type SearchConfig
Constants ¶
const FileMode fs.FileMode = 0o600
FileMode is the permission of config.toml. The file can hold API keys in plaintext (like ~/.aws/credentials or ~/.netrc), so only the owner may read it. Environment variables (INODE_LLM_API_KEY, ...) avoid storing keys at all.
const FileName = "config.toml"
FileName is the config file inside the config directory.
Variables ¶
var Keys = []Key{ {Name: "llm.backend", Allowed: []string{"ollama", "claude-api", "openai"}, Help: "LLM for tagging, summaries and answers"}, {Name: "llm.model", Help: "e.g. llama3.2, claude-sonnet-5-5, gpt-4o-mini"}, {Name: "llm.base_url", Help: "Ollama URL, or an OpenAI-compatible endpoint"}, {Name: "llm.api_key", Secret: true, Help: "Anthropic or OpenAI API key (or set INODE_LLM_API_KEY)"}, {Name: "embedding.backend", Allowed: []string{"ollama", "voyage"}, Help: "embedding provider"}, {Name: "embedding.model", Help: "e.g. nomic-embed-text, voyage-3"}, {Name: "embedding.base_url", Help: "Ollama URL for embeddings"}, {Name: "embedding.api_key", Secret: true, Help: "Voyage AI API key (or set INODE_EMBEDDING_API_KEY)"}, {Name: "embedding.dimension", Kind: Int, Help: "vector size of the embedding model"}, {Name: "db.backend", Allowed: []string{"sqlite", "postgres"}, Help: "storage engine"}, {Name: "db.path", Help: "SQLite database file"}, {Name: "db.dsn", Secret: true, Help: "Postgres connection string"}, {Name: "defaults.sensitive", Kind: Bool, Help: "treat notes as sensitive when unsure"}, {Name: "search.top_k", Kind: Int, Help: "candidates fetched per search"}, {Name: "search.max_distance", Kind: Float, Help: "drop matches farther than this (<0 disables)"}, {Name: "mcp.reveal_sensitive", Kind: Bool, Help: "let MCP clients read sensitive notes"}, {Name: "log.level", Allowed: []string{"debug", "info", "warn", "error"}, Help: "log verbosity (not read by any command yet)"}, }
Keys lists every setting, in the order `inode config show` prints them.
Functions ¶
func LooseMode ¶
LooseMode reports the permissions of <dir>/config.toml when group or other users can read or write it. ok is false when the file is private or absent.
Types ¶
type Config ¶
type Config struct {
LLM LLMConfig `mapstructure:"llm"`
Embedding EmbeddingConfig `mapstructure:"embedding"`
DB DBConfig `mapstructure:"db"`
Defaults DefaultsConfig `mapstructure:"defaults"`
Search SearchConfig `mapstructure:"search"`
MCP MCPConfig `mapstructure:"mcp"`
Log LogConfig `mapstructure:"log"`
}
type DBConfig ¶
type DBConfig struct {
// Backend selects the storage engine: "sqlite" (default) or "postgres".
Backend string `mapstructure:"backend"`
// Path is the SQLite database file. Used only when Backend = sqlite.
Path string `mapstructure:"path"`
// DSN is the Postgres connection string (e.g. postgres://user:pass@host:5432/db?sslmode=disable).
// Used only when Backend = postgres.
DSN string `mapstructure:"dsn"`
}
type DefaultsConfig ¶
type DefaultsConfig struct {
Sensitive bool `mapstructure:"sensitive"`
}
type EmbeddingConfig ¶
type Key ¶ added in v0.5.1
type Key struct {
Name string
Kind Kind
Allowed []string // non-empty: the only accepted values
Secret bool // redacted by `inode config show`
Help string
}
Key describes one setting in config.toml. Keys is the single list that `inode config set` validates against and `inode config show` prints; a test checks it matches the fields of Config.
type Kind ¶ added in v0.5.1
type Kind int
Kind is the type of a config value, used to parse `inode config set` input.
type MCPConfig ¶
type MCPConfig struct {
// RevealSensitive, when true, lets the MCP server include plaintext
// content of notes marked sensitive (search_notes will surface them
// to the LLM, get_note will return unmasked content). Default false:
// sensitive notes are excluded from search candidates and masked in
// get_note responses.
RevealSensitive bool `mapstructure:"reveal_sensitive"`
}
MCPConfig tunes the `inode mcp` Model Context Protocol server.
type SearchConfig ¶
type SearchConfig struct {
// MaxDistance drops notes whose L2 distance exceeds this value (0 = use built-in default, <0 = disable).
MaxDistance float32 `mapstructure:"max_distance"`
// TopK is the number of nearest-neighbour candidates fetched before threshold filtering (0 = use built-in default).
TopK int `mapstructure:"top_k"`
}
SearchConfig tunes the RAG retrieval pipeline.