Documentation
¶
Overview ¶
Package config loads memmy's YAML configuration. Schema mirrors DESIGN.md §12.
Index ¶
- Constants
- type Config
- type DecayConfig
- type EmbedderConfig
- type FakeEmbedderConfig
- type GeminiConfig
- type MemoryConfig
- type Neo4jStorageConfig
- type PruneConfig
- type ReinforceConfig
- type ScoringConfig
- type ServerConfig
- type StorageConfig
- type TenantKeyConfig
- type TenantSchemaConfig
- type TransportConfig
- type VectorIndexConfig
Constants ¶
const ( TransportMCP = "mcp" // streamable HTTP MCP transport TransportStdio = "stdio" // MCP over stdin/stdout TransportGRPC = "grpc" // reserved TransportHTTP = "http" // reserved )
Transport name constants. The set of known names is closed so the validator can reason about mutual exclusivity (stdio).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Server ServerConfig `yaml:"server"`
Storage StorageConfig `yaml:"storage"`
Embedder EmbedderConfig `yaml:"embedder"`
VectorIndex VectorIndexConfig `yaml:"vector_index"`
Memory MemoryConfig `yaml:"memory"`
Tenant TenantSchemaConfig `yaml:"tenant"`
}
Config is the top-level configuration loaded at startup.
func Default ¶
func Default() Config
Default returns a Config populated with the documented defaults.
No transport is enabled by default — the operator must explicitly declare which one(s) to run via server.transports. An empty transports map fails Validate() so config typos can't accidentally bring up an unwanted listener (or, in the case of stdio, take over the parent's stdin/stdout silently).
func Load ¶
Load reads and parses a YAML file at path, applying any unspecified fields from Default(). Returns a validated Config. Secrets that reference environment variables (`${VAR_NAME}`) are expanded in place before validation.
func (Config) EmbedderDim ¶
EmbedderDim returns the dimensionality of the configured embedder.
type DecayConfig ¶
type EmbedderConfig ¶
type EmbedderConfig struct {
Backend string `yaml:"backend"`
Gemini GeminiConfig `yaml:"gemini"`
Fake FakeEmbedderConfig `yaml:"fake"`
}
type FakeEmbedderConfig ¶
type FakeEmbedderConfig struct {
Dim int `yaml:"dim"`
}
type GeminiConfig ¶
type MemoryConfig ¶
type MemoryConfig struct {
ChunkWindowSize int `yaml:"chunk_window_size"`
ChunkStride int `yaml:"chunk_stride"`
RetrievalK int `yaml:"retrieval_k"`
RetrievalHops int `yaml:"retrieval_hops"`
RetrievalOversample int `yaml:"retrieval_oversample"`
StructuralRecentN int `yaml:"structural_recent_n"`
StructuralRecentDelta time.Duration `yaml:"structural_recent_delta"`
// RefractoryPeriod blocks repeated explicit Reinforce/Demote/Mark
// bumps on the same node within the window. Implicit Recall
// co-retrieval bumps are NOT throttled. Set to 0 to disable.
RefractoryPeriod time.Duration `yaml:"refractory_period"`
// LogDampening scales positive Reinforce/Mark deltas by
// (1 - weight/WeightCap), so saturation is asymptotic instead of a
// hard wall. Demote is unaffected.
LogDampening bool `yaml:"log_dampening"`
// MarkMaxNodes caps the number of recent nodes a single Mark call
// will walk.
MarkMaxNodes int `yaml:"mark_max_nodes"`
Scoring ScoringConfig `yaml:"scoring"`
Decay DecayConfig `yaml:"decay"`
Reinforce ReinforceConfig `yaml:"reinforce"`
Prune PruneConfig `yaml:"prune"`
WeightCap float64 `yaml:"weight_cap"`
}
type Neo4jStorageConfig ¶ added in v0.2.0
type PruneConfig ¶
type ReinforceConfig ¶
type ReinforceConfig struct {
NodeDelta float64 `yaml:"node_delta"`
EdgeCoRetrievalBase float64 `yaml:"edge_coretrieval_base"`
EdgeCoTraversalMultiplier float64 `yaml:"edge_cotraversal_multiplier"`
EdgeStructuralWeight float64 `yaml:"edge_structural_weight"`
EdgeStructuralTemporalWeight float64 `yaml:"edge_structural_temporal_weight"`
}
type ScoringConfig ¶
type ServerConfig ¶
type ServerConfig struct {
Transports map[string]TransportConfig `yaml:"transports"`
}
type StorageConfig ¶
type StorageConfig struct {
Backend string `yaml:"backend"`
Neo4j Neo4jStorageConfig `yaml:"neo4j"`
}
type TenantKeyConfig ¶
type TenantKeyConfig struct {
Description string `yaml:"description"`
Pattern string `yaml:"pattern"`
Enum []string `yaml:"enum"`
Required bool `yaml:"required"`
}
TenantKeyConfig describes one key in the tenant tuple. Tenant values are always strings (Go: map[string]string), so the type is implicit.
type TenantSchemaConfig ¶
type TenantSchemaConfig struct {
Description string `yaml:"description"`
Keys map[string]TenantKeyConfig `yaml:"keys"`
OneOf [][]string `yaml:"one_of"`
}
TenantSchemaConfig is the optional tenant-tuple schema. When empty, memmy accepts any string-keyed tuple; when set, every Service operation rejects tuples that don't match.
Stored memories are NOT migrated when the schema changes — TenantID is derived from the (validated) tuple as today, so data written under one schema remains addressable if the schema is changed back to one that accepts the original tuple shape.
func (TenantSchemaConfig) IsConfigured ¶
func (t TenantSchemaConfig) IsConfigured() bool
IsConfigured reports whether the tenant schema has any rules. An unconfigured schema means "accept any tuple" — today's behavior.
func (TenantSchemaConfig) Validate ¶
func (t TenantSchemaConfig) Validate() error
Validate parses regex patterns and cross-checks the tenant schema for internal consistency. Returns nil on success; the schema may then be handed to service.NewTenantSchema.
type TransportConfig ¶
type VectorIndexConfig ¶
type VectorIndexConfig struct {
// FlatScanThreshold is the per-tenant size below which Recall uses
// a Cypher flat scan instead of the native vector index. Neo4j's
// vector index has no exposed HNSW knobs; tuning it requires DDL
// on the index itself (see DESIGN.md §13.1).
FlatScanThreshold int `yaml:"flat_scan_threshold"`
}