Documentation
¶
Overview ¶
Package meshcfg reads and writes a solo vault's local embedding config at <vault>/.mesh/config.toml. It is the solo counterpart to a team vault's hub-authoritative mesh.toml: it pins the embedding endpoint/model/dim so `mesh search`, `mesh mcp`, and friends work without re-exporting env vars every session. Environment variables always override the file (the file is a fallback, never an authority), and secrets are never stored: key_env names the env var that holds the bearer key, it does not hold the key itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Save ¶
Save writes the [embedding] section, preserving any other sections already in the file. Kept for the `mesh embed` caller; new callers should use SaveConfig.
func SaveConfig ¶
SaveConfig writes the full <meshDir>/config.toml atomically (temp + rename), 0644.
Types ¶
type Code ¶
Code is the [code] section: the opt-in source-code index (the graphify replacement). Index gates it on; Roots are the repos to walk (separate from the note vault, since source lives elsewhere); Languages is an allowlist of language tags (empty = all supported). Env MESH_CODE_INDEX / MESH_CODE_ROOTS override.
type Config ¶
Config is the full solo config.toml (embedding + retrieval + code).
func LoadConfig ¶
LoadConfig reads the full config.toml (embedding + retrieval). A missing file returns a zero Config, like Load.
type Embedding ¶
type Embedding struct {
Endpoint string
Model string
Dim int
KeyEnv string // env var NAME holding the bearer key (never the key itself)
QueryPrefix string // e.g. "search_query: " for nomic-style asymmetric models
DocPrefix string // e.g. "search_document: "
}
Embedding is the [embedding] section of a solo config.toml.
type Retrieval ¶
type Retrieval struct {
WeightFTS float64
WeightGraph float64
WeightVec float64
RerankEndpoint string
RerankModel string
RerankKeyEnv string
RerankBlend float64
HNSWThreshold int
// FreshnessHalfLifeDays decays non-institutional notes in ranking by age (0 =
// off, the default, so nothing changes silently). Env MESH_FRESHNESS_HALFLIFE_DAYS
// wins. Tier-0 (decisions/gotchas/post-mortems) + entities/concepts/maps never
// decay; only note/status notes do, floored so an old note is demoted, not buried.
FreshnessHalfLifeDays int
}
Retrieval is the [retrieval] + [rerank] + [ann] sections of config.toml: the solo fallback for fusion weights, the cross-encoder rerank stage, and the ANN gate. As with [embedding], the matching env vars (MESH_WEIGHT_*, MESH_RERANK_*, MESH_HNSW_THRESHOLD) override these; keys live in env vars named by *KeyEnv.