config

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceIsolated = "isolated" // default: each agent reads only its own namespace
	NamespaceAll      = "all"      // every agent reads across all namespaces
	NamespaceCustom   = "custom"   // per-agent readable set from VisibleTo
)

Namespace modes.

Variables

This section is empty.

Functions

func APIKey

func APIKey(envName string) string

APIKey resolves the API key for a config that declares an env var name. Returns "" if the env var is unset.

Types

type Config

type Config struct {
	Server     ServerConfig     `yaml:"server"`
	LLM        LLMConfig        `yaml:"llm"`
	Embedding  EmbeddingConfig  `yaml:"embedding"`
	Fork       ForkConfig       `yaml:"fork"`
	Verify     VerifyConfig     `yaml:"verify"`
	Wiki       WikiConfig       `yaml:"wiki"`
	Search     SearchConfig     `yaml:"search"`
	Log        LogConfig        `yaml:"log"`
	Recall     RecallConfig     `yaml:"recall"`
	Worker     WorkerConfig     `yaml:"worker"`
	Namespaces NamespacesConfig `yaml:"namespaces"`
	MCP        MCPConfig        `yaml:"mcp"`
	// InterestMemory holds interest-memory service-level toggles (as opposed
	// to per-session runtime state). KanbanExclude lists board names or IDs
	// whose data must be skipped entirely during kanban collection/import —
	// excluded boards never reach embedding, memory storage or token stats.
	InterestMemory InterestMemoryConfig `yaml:"interestmemory"`
}

Config is the full runtime configuration for the interest-memory service. Loaded from a YAML file with env-var overrides for secrets.

func Default

func Default() Config

Default returns the built-in defaults (used when no file is given).

func Load

func Load(path string) (Config, error)

Load reads a YAML config file (path == "" → defaults only), then applies env-var overrides for API keys. It returns the merged config.

type EmbeddingConfig

type EmbeddingConfig struct {
	BaseURL    string `yaml:"base_url"`
	APIKeyEnv  string `yaml:"api_key_env"`
	Model      string `yaml:"model"`
	Dimensions int    `yaml:"dimensions"`
}

type ForkConfig

type ForkConfig struct {
	PrefixStep       int     `yaml:"prefix_step"`     // prefix-window step in user turns
	MaxWindows       int     `yaml:"max_windows"`     // max prefix windows (keeps the longest N when exceeded)
	MaxConcurrency   int     `yaml:"max_concurrency"` // window-extraction / adjudication parallelism
	SimilarityMerge  float64 `yaml:"similarity_merge"`
	SimilarityRelate float64 `yaml:"similarity_relate"`
	ImportanceBoost  float64 `yaml:"importance_boost_per_seen"`
	MaxCandidates    int     `yaml:"max_candidates_per_window"`
	MinConfidence    float64 `yaml:"min_confidence"`
	// ClusterSim is the s1 dedupe-merge clustering threshold: candidates whose
	// pairwise embedding cosine exceeds it join a merge cluster (default 0.6).
	ClusterSim float64 `yaml:"cluster_sim"`
	// HistSim is the s2 threshold for a current point to pair with a
	// historical interest point (default 0.8).
	HistSim float64 `yaml:"hist_sim"`
	// Route selects the extraction strategy:
	//   "prefix"     prefix-window split, full render (incl. tool output)
	//   "non_prefix" non-overlapping user-turn windows, compressed render
	//   "full"       single full-context window, compressed render, one pass
	//   "full2"      single full-context window, compressed render, two passes (append; default)
	Route string `yaml:"route"`
}

type InterestMemoryConfig added in v0.2.0

type InterestMemoryConfig struct {
	// KanbanExclude is the list of kanban board names or IDs to exclude from
	// collection/import. Empty (default) means no board is excluded — behaviour
	// is identical to the pre-configuration state. Matching is case-insensitive
	// and whitespace-trimmed against board name or board ID.
	KanbanExclude []string `yaml:"kanban_exclude"`
}

InterestMemoryConfig groups service-level interest-memory settings.

type LLMConfig

type LLMConfig struct {
	BaseURL   string `yaml:"base_url"`
	APIKeyEnv string `yaml:"api_key_env"`
	Model     string `yaml:"model"`
	MaxTokens int    `yaml:"max_tokens"`
}

type LogConfig

type LogConfig struct {
	Retain int `yaml:"retain"` // retained log entries per agent (0 = unlimited)
}

LogConfig controls the change-log retention.

type MCPConfig added in v0.2.0

type MCPConfig struct {
	Enabled    bool   `yaml:"enabled"`     // connect to MCP servers for search
	Servers    string `yaml:"servers"`     // JSON array of MCP server configs (see my-agent-core mcpclient.ServerConfig)
	SearchTool string `yaml:"search_tool"` // MCP tool name to use for web search (e.g. "exa_search"); empty = first "*search*" tool
}

MCPConfig configures the optional MCP-backed web search (replaces the built-in web_search backends when enabled + selected via verify.web_tool).

type NamespacesConfig

type NamespacesConfig struct {
	Mode      string              `yaml:"mode"`       // isolated | all | custom
	VisibleTo map[string][]string `yaml:"visible_to"` // custom only: agent → namespaces it may read (one-way)
}

NamespacesConfig controls cross-namespace visibility on the read side (recall / search / get). Writes are always isolated to the agent's own namespace. Default is isolated — behaviour identical to no configuration.

type RecallConfig

type RecallConfig struct {
	TopK        int     `yaml:"top_k"`
	IncludeWiki bool    `yaml:"include_wiki"`
	MinScore    float64 `yaml:"min_score"`
}

type SearchConfig

type SearchConfig struct {
	TopK       int `yaml:"top_k"`        // default number of results for semantic search
	MaxBodyLen int `yaml:"max_body_len"` // body/summary truncation cap (claims/evidence/edges not truncated)
}

SearchConfig controls the consumer-side memory_search tool.

type ServerConfig

type ServerConfig struct {
	Host   string `yaml:"host"`
	Port   int    `yaml:"port"`
	DBPath string `yaml:"db_path"`
}

type VerifyConfig

type VerifyConfig struct {
	UseWebSearch   bool    `yaml:"use_web_search"`
	SearchMax      int     `yaml:"search_max"`
	WebTool        string  `yaml:"web_tool"`        // web tool name (active in the registry)
	MaxConcurrency int     `yaml:"max_concurrency"` // candidate fact-check parallelism
	MinConfidence  float64 `yaml:"min_confidence"`  // minimum confidence to store a contradiction (0~1; 0 = disabled, default disabled)
	SimThreshold   float64 `yaml:"sim_threshold"`   // semantic-grouping similarity threshold (same-topic candidate gate, default 0.45)
	MaxCandidates  int     `yaml:"max_candidates"`  // max candidate pairs per window for semantic grouping (default 30)
}

VerifyConfig controls the correction layer (verify#1 fact-checking).

type WikiConfig

type WikiConfig struct {
	Enabled   bool   `yaml:"enabled"`    // master switch: false skips wiki writes entirely (interest points only)
	Selective bool   `yaml:"selective"`  // selective writes: fork LLM judges each point's wiki_worthy; not-worthy points stay as interest points only
	MaxHops   int    `yaml:"max_hops"`   // graph propagation depth for reconciliation
	BatchSize int    `yaml:"batch_size"` // related pages per reconcile agent-loop batch
	Language  string `yaml:"language"`   // wiki page output language (default English)
	// VerifyClaims controls whether the wiki agent loop exposes the
	// verify_claims (web fact-check) tool. false removes it so the model
	// cannot trigger network search. Independent of verify.use_web_search.
	VerifyClaims bool `yaml:"verify_claims"`
	// GroupSim is the wikiloop EBD clustering threshold (pairs above it join a
	// write cluster). Grouping only — never merges (merging already happened in
	// V1.3 persist). Default 0.75.
	GroupSim float64 `yaml:"group_sim"`
}

WikiConfig controls the wiki writing / reconcile stage.

func (WikiConfig) OutputLanguage

func (c WikiConfig) OutputLanguage() string

OutputLanguage returns the configured wiki output language, defaulting to English when unset.

type WorkerConfig

type WorkerConfig struct {
	JobTimeout time.Duration `yaml:"job_timeout"` // per-job context timeout
}

WorkerConfig controls the async transcript-processing worker.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL