Skip to main content

Module config

Module config 

Source

Modules§

config_keys
Canonical name strings for the legacy v1 flat config keys (plus the [embeddings] section name) that appear on multiple production sites (#1558). Shared between the AppConfig surface in this file (the manual Debug impl + warn_unknown_top_level_keys) and the ai-memory config migrate rewriter in src/cli/commands/config.rs, so each key spelling has one source of truth. The serde wire names themselves derive from the AppConfig field identifiers (no #[serde(rename)]), so serde needs no literal at all.

Structs§

AdminConfig
v0.7.0 SHIP cluster (#946 / #957 / #960 / #961, 2026-05-20) — [admin] top-level block. The operator-configured allowlist of agent_ids whose authenticated HTTP requests are treated as admin-class callers, granting full cross-tenant visibility on endpoints whose payloads necessarily expose corpus-scale metadata (GET /api/v1/export, GET /api/v1/agents, GET /api/v1/stats, the POST /api/v1/quota/status list path).
AgentDefaults
v0.7.0 (issue #518) — [agents.defaults] sub-block. Today exposes a single field: recall_scope. Future expansion (per-call timeouts, per-call tag filters, …) lives here.
AgentsConfig
v0.7.0 (issue #518) — [agents] top-level block. Today only carries the defaults sub-block ([agents.defaults.recall_scope]); future agent-scoped knobs (per-agent quota overrides, per-agent autonomy hook policy) can stack here without bloating the top-level AppConfig surface.
AppConfig
Persistent configuration loaded from ~/.config/ai-memory/config.toml.
AuditComplianceConfig
AuditConfig
[audit] block in config.toml. Drives the hash-chained audit trail emitted from every memory mutation call site.
BootConfig
[boot] block in config.toml. Drives the privacy kill-switch + title-redaction behaviour of ai-memory boot. Both fields default to the historical (pre-v0.6.3.1) behaviour so existing users see no change.
Capabilities
Top-level capabilities report for a running instance.
CapabilitiesV1
Legacy (v1) capabilities shape — the structure shipped before the v0.6.3.1 honesty patch. Returned only when a client opts in via Accept-Capabilities: v1 (HTTP) or the MCP accept argument set to "v1". Default response is v2.
CapabilitiesV3
v0.7.0 capabilities schema (A1 increment). Additive over Capabilities (v2): the top-level summary field carries a pre-computed, plain-language description of the LLM’s operational tool surface so reasoning-class LLMs converge on accurate first-answer descriptions without having to traverse families[] and count manually.
CapabilityApproval
Approval-API block (capabilities schema v2). pending_requests counts the existing pending_actions table (live signal).
CapabilityAtomisation
v0.7.0 WT-1-G — atomisation capability surface.
CapabilityCompaction
Compaction block (capabilities schema v2). v0.8 Pillar 2.5 work — reports {planned, version, enabled} plus optional run stats. The honesty patch (P1) replaced the bare enabled: false with the planned-feature shape so operators can distinguish “feature exists but disabled” from “feature not in this build”.
CapabilityConfidenceCalibration
v0.7.0 Form 5 — operator-facing confidence-calibration capability surface. Names every Form-5 substrate the binary actually ships:
CapabilityFeatures
Boolean feature flags exposed in the capabilities report.
CapabilityFeaturesV1
Legacy v1 feature-flag block. Notably, memory_reflection is a bool here (it became a PlannedFeature object in v2).
CapabilityForensic
v0.7.0 L3-5 — forensic-evidence capability surface.
CapabilityGovernance
v0.7.0 L3-5 — substrate-rules governance capability surface.
CapabilityHnsw
HNSW vector-index health (capabilities schema v2, v0.6.3.1 P3).
CapabilityHooks
Hook-pipeline block (capabilities schema v2). Pre-v0.7 reports webhook subscriptions as the closest analogue. The full hook pipeline lands in v0.7 Bucket 0 (arch-enhancement-spec §2).
CapabilityMemoryKindVocab
v0.7.x Form 6 (issue #759) — Batman-taxonomy memory-kind capability surface. Names the recall-filter / auto-classify surfaces shipped under Form 6.
CapabilityModels
Model identifiers exposed in the capabilities report.
CapabilityPermissions
Permissions block (capabilities schema v2). Pre-P4 reports a live count of namespace standards carrying a metadata.governance policy; the full enforcement gate lands in P4. The honesty patch (P1) renames the mode from "ask" (which implied an interactive prompt loop) to "advisory" (governance metadata is recorded but not enforced).
CapabilityProvenanceSubstrateLayer
v0.7.0 #973 Item C — substrate-layer provenance posture. Lets an LLM agent self-describe ai-memory’s do-calculus intervention/observation distinction (Pearl 2009) per Ortega & de Freitas (2026) framing. Honesty discipline: every enforcement_layers entry must map to a shipped substrate primitive in source.
CapabilityReflection
v0.7.0 L3-5 — substrate-native reflection capability surface.
CapabilitySkills
v0.7.0 L3-5 — Agent-Skills capability surface.
CapabilityTranscripts
Sidechain-transcript block (capabilities schema v2). v0.7 Bucket 1.7 work — reports {planned, version, enabled} until the subsystem ships. The honesty patch (P1) replaced the bare enabled: false with the planned-feature shape.
CompliancePreset
ConfidenceConfig
v0.7.0 Cluster G (#767) — [confidence] config block. Carries the retention window for confidence_shadow_observations consumed by the periodic GC sweep wired into daemon_runtime::spawn_gc_loop.
ConfidenceTierThresholds
v0.7.0 Gap 4 (#887) — the three thresholds powering the ConfidenceTier enum. confirmed and likely are inclusive lower bounds; ambiguous is the implicit floor (everything below likely).
CuratorSection
#1671/n15 (v0.7.1) — [curator] sectioned per-namespace curator configuration.
EmbeddingsSection
v0.7.x (#1146) — [embeddings] sectioned embedding-model configuration.
GovernanceConfig
v0.7.0 SEC-2 (Cluster D, issue #767) — [governance] top-level block. Today exposes a single fail-closed knob; future governance knobs (e.g., signature-rotation policy timestamps, per-rule override timeouts) can stack here.
HooksConfig
[hooks] config block. v0.7.0 K7 — operator-facing knobs for the outgoing-webhook surface.
HooksSubscriptionConfig
[hooks.subscription] sub-block. K7 ships one knob today (hmac_secret); future K-track work may add per-event opt-out filters or alternate signing algorithms.
IdentityConfig
Identity-resolution configuration (Task 1.2 follow-up #198).
LimitsSection
v0.7.x — [limits] sectioned operator-tunable capacity limits.
LlmAutoTagSection
v0.7.x (#1146) — [llm.auto_tag] sub-table. Fast structured-output sibling of LlmSection. Fields fall back to the parent [llm] section field-by-field when unset; commonly only model is overridden to point at a faster model (default gemma3:4b, ~0.7s p50 vs ~15s p50 for thinking-mode Gemma 4 per L15 patch).
LlmSection
v0.7.x (#1146) — [llm] sectioned LLM configuration.
LoggingConfig
[logging] block in config.toml. Every field is Option; missing fields fall back to the documented defaults.
McpConfig
[mcp] block in config.toml — v0.6.4 addition. Today this only carries the named tool profile. v0.6.4 Track D will extend with [mcp.allowlist] for per-agent capability gating.
PermissionsConfig
[permissions] block in config.toml. Carries the gate’s enforcement posture and (v0.7.0 K9) the declarative rule list the unified crate::permissions::Permissions::evaluate pipeline consults before mode + hook fall-through.
PermissionsDecisionCounts
Snapshot of decision counts per mode since process start. Surfaced by ai-memory doctor and the capabilities permissions block so operators can verify the gate is wired and observe drift between “policies advertised” and “policies enforced”.
PlannedFeature
Generic “planned but not implemented” marker used by v2 capability fields whose underlying subsystem is on the roadmap but not in this build. Operators reading the JSON can distinguish “disabled but available” from “not in this build” by inspecting planned.
RecallScope
v0.7.0 (issue #518) — operator-configured recall defaults. Each field is optional; when present and the inbound recall request omits the corresponding axis AND passes session_default=true, the handler splices in the configured value before dispatching to the storage layer.
RecallScoringConfig
Per-tier half-life (days) overrides loaded from [scoring] section of config.toml.
ReflectionBoostReport
v0.7.0 L2-8 — per-field report of the reflection-aware reranker boost surfaced through memory_capabilities. Mirrors crate::reranker::ReflectionBoostConfig but expressed in capability-report shape (serde-friendly, schema-tagged).
RerankerSection
v0.7.x (#1146) — [reranker] sectioned cross-encoder configuration.
ResolvedEmbeddings
Canonical resolved-embedder configuration. Produced by AppConfig::resolve_embeddings.
ResolvedLimits
Canonical resolved operator-tunable capacity limits. Produced by AppConfig::resolve_limits. Consumed at daemon boot to install the quota-row auto-insert defaults (crate::quotas::set_quota_defaults) and the HTTP list/bulk page-size cap (AppState::max_page_size).
ResolvedLlm
Canonical resolved-LLM configuration. Produced by AppConfig::resolve_llm. Every LLM-init surface (MCP stdio, HTTP daemon, ai-memory atomise, ai-memory curator, embed-client fallback, boot banner) consumes this struct rather than reading raw config / env / tier presets.
ResolvedModels
v0.7.x (issue #1168) — bundle the three model-resolver outputs into a single triple consumed by the capabilities surface. Lets callers thread ONE struct through handle_capabilities_with_conn / handle_capabilities_with_conn_v3 / build_capabilities_overlay instead of three independent borrows, and makes the contract loud: memory_capabilities.models.* reflects the operator-resolved configuration, NEVER the compiled tier preset.
ResolvedReranker
Canonical resolved-reranker configuration. Produced by AppConfig::resolve_reranker.
ResolvedScoring
Resolved scoring values after merging config overrides with compiled defaults. Half-lives are clamped to the range [0.1, 36_500.0] days (≈100 years) to keep the decay math well-behaved.
ResolvedStorage
Canonical resolved-storage configuration. Produced by AppConfig::resolve_storage.
ResolvedTranscriptLifecycle
Resolved transcript-lifecycle parameters for a single namespace. Produced by TranscriptsConfig::resolve and consumed by the I3 sweeper to drive the archive + prune SQL.
ResolvedTtl
Resolved TTL values after merging config overrides with compiled defaults.
SpecReferences
v0.7.0 #973 Item C — academic citations. Vendor-neutral.
StorageSection
v0.7.x (#1146) — [storage] sectioned storage configuration.
SubscriptionsConfig
v0.7.0 H11 (#628 blocker) — [subscriptions] block. Operator knobs for the outgoing-webhook surface that are NOT specific to HMAC signing (which lives under [hooks.subscription]).
TierConfig
Runtime configuration derived from a FeatureTier.
ToolEntry
v0.7.0 A3 — per-tool entry in the capabilities-v3 tools array.
ToolExample
v0.7.0 issue #803 — single worked example for tools[].examples.
TranscriptNamespaceConfig
Per-namespace overrides nested under [transcripts.namespaces."<pattern>"]. Each field independently overrides the TranscriptsConfig global default; an unset field inherits.
TranscriptsConfig
[transcripts] block in config.toml — per-namespace TTL and archive grace overrides for the I3 lifecycle sweeper.
TtlConfig
Per-tier TTL overrides loaded from [ttl] section of config.toml.
VerifyConfig
v0.7.0 H5 (round-2) — [verify] config block. Operator-facing knobs for POST /api/v1/links/verify. Today exposes one knob: require_nonce (default false).

Enums§

AllowlistDecision
v0.6.4-008 — outcome of an allowlist check.
ConfigSource
Provenance tag for a resolved Resolved* field’s value, surfaced by the boot banner and ai-memory doctor so operators can see WHICH source won the precedence ladder.
EmbeddingModel
Supported embedding models for semantic search.
FeatureTier
Feature tiers control which AI capabilities are active based on the available memory budget on the host machine.
KeySource
Provenance tag for a resolved API-key value.
PermissionsMode
Enforcement posture consulted by crate::db::enforce_governance.
RecallMode
Live recall-mode tag (P1 honesty patch). Reflects the runtime state of the embedder + LLM, not the configured tier.
RerankerMode
Live reranker-mode tag (P1 honesty patch). Reflects the runtime CrossEncoder enum variant, not the configured cross_encoder flag.

Constants§

DEFAULT_LLM_CALL_TIMEOUT_SECS
v0.7.0 H8 (round-2) — compiled default per-LLM-call timeout. Applied when AppConfig::llm_call_timeout_secs is None.
DEFAULT_REQUEST_TIMEOUT_SECS
v0.7.0 H7 (round-2) — compiled default per-request HTTP timeout. Applied when AppConfig::request_timeout_secs is None.
DEFAULT_TRANSCRIPT_ARCHIVE_GRACE_SECS
Compiled-in default for the post-archive grace window: 7 days. A transcript whose archived_at is older than this is hard-deleted by the prune phase; the I2 join table is cleaned up via ON DELETE CASCADE.
DEFAULT_TRANSCRIPT_TTL_SECS
Compiled-in default for the transcript TTL: 30 days. After this many seconds elapse from created_at AND every memory that links the transcript has expired (or been deleted), the I3 background sweeper marks the transcript archived.
ENFORCED_AGENT_ACTIONS
v0.7.0 L1-6 — the canonical agent-external action kinds the substrate gates via the operator-signed rules engine. Matches the variant set in crate::governance::agent_action::AgentAction (minus the open-ended Custom extension point).
ENV_DB_MMAP_SIZE
#1579 B7 — env override for the sqlite PRAGMA mmap_size ([storage].db_mmap_size_bytes), in whole bytes. 0 disables memory-mapped I/O; negative / unparseable values fall through to the [storage] section, then to the compiled 256 MiB default (crate::storage::DEFAULT_DB_MMAP_SIZE_BYTES).
ENV_EMBED_API_KEY
#1598 — env carrying the embedding Bearer-auth secret; highest-precedence layer of the [embeddings] API-key resolution ladder (mirrors ENV_LLM_API_KEY).
ENV_EMBED_BACKEND
#1598 — env override for the embedding backend selector ([embeddings].backend). Same accepted values as the section field: ollama, any #1067 alias, or openai-compatible.
ENV_EMBED_BACKFILL_BATCH
#38 — env override for the embedding backfill batch size ([embeddings].backfill_batch). Hoisted from a raw literal in the resolver per the no-hardcoded-literals discipline (#1598).
ENV_EMBED_BASE_URL
#1598 — env override for the embedding endpoint base URL ([embeddings].base_url / [embeddings].url).
ENV_EMBED_MODEL
#1598 — env override for the embedding model id ([embeddings].model).
ENV_LLM_API_KEY
#1067 — env carrying the LLM Bearer-auth secret; highest-precedence layer of the [llm] API-key resolution ladder (KeySource).
ENV_MAX_LINKS_PER_DAY
Env override for [limits].max_links_per_day.
ENV_MAX_MEMORIES_PER_DAY
Env override for [limits].max_memories_per_day.
ENV_MAX_PAGE_SIZE
Env override for [limits].max_page_size.
ENV_MAX_STORAGE_BYTES
Env override for [limits].max_storage_bytes.
ENV_PG_ACQUIRE_TIMEOUT_SECS
v0.7.0 (a) — env override for the pool acquire-timeout (postgres_acquire_timeout_secs), in whole seconds.
ENV_PG_POOL_MAX
v0.7.0 (a) — env override for the postgres pool ceiling (postgres_pool_max_connections). Byte-matches the name documented in docs/enterprise-deployment.md §5.6.
ENV_PG_POOL_MIN
v0.7.0 (a) — env override for the postgres pool floor (postgres_pool_min_connections). Byte-matches the name documented in docs/enterprise-deployment.md §5.6.
ENV_RERANK_MAX_SEQ
#1604 — env override for the tokenized length of rerank inputs ([reranker].max_seq_tokens), in tokens. Values that are zero, unparseable, or above the model ceiling (crate::reranker::CROSS_ENCODER_MAX_SEQ) fall through to the [reranker] section, then to the compiled default (crate::reranker::RERANK_MAX_SEQ_DEFAULT).
ENV_RERANK_SCORE_FLOOR
#1691/n14 — env override for the recall-reranker score floor. Value grammar (case-insensitive): off | absolute:<f> | relative:<f> (see crate::reranker::RerankerScoreFloor::parse). Highest-precedence layer of the score-floor ladder (env > [reranker].score_floor > compiled default crate::reranker::RerankerScoreFloor::Off). Unparseable values fall through to the next layer.
GOVERNANCE_BYPASS_IMPOSSIBILITY_TESTS
v0.7.0 L1-6 — number of bypass-impossibility tests pinning the rules-engine activation posture. Tracks the #[test] count in tests/governance_l16_activation.rs. Bumping this requires both an audit and a matching test landing in that file.
HOOK_EVENTS_COUNT
Compile-time count of HookEvent variants. Updated here when new variants land; the corresponding enum exhaustiveness check in src/hooks/timeouts.rs enforces the count at test time.
KNOWN_EMBEDDING_DIMS
v0.7.x (issue #1169) — known canonical embedding-model id → vector dim mappings.
SKILL_TOOL_NAMES
Canonical skill tool names as registered in [crate::mcp::registry]. Pinned here (not derived from the registry) so the capability surface remains a stable, declarative contract; the regression test cap_v3_l3_5_skill_tools_match_registered_mcp_dispatch ensures the two stay in sync.

Functions§

active_hooks_hmac_secret
v0.7.0 K7 — read the process-wide webhook HMAC override. Returns None when unset (the K6-and-earlier behaviour: only per-subscription secrets sign outgoing payloads).
active_max_decompressed_bytes
Read the process-wide decompression cap, falling back to the compiled default when unset.
active_permissions_mode
Read the process-wide active PermissionsMode installed at boot by set_active_permissions_mode (sourced from AppConfig::effective_permissions_mode, whose v0.7.0 secure default is PermissionsMode::Enforce).
allow_loopback_webhooks
v0.7.0 H11 — read the process-wide loopback-webhook opt-in. Returns false when unset (the safe default — loopback URLs are rejected by the SSRF guard).
build_capability_models
v0.7.x (issue #1168) — build the models.* block of the capabilities report from the resolver-aware ResolvedModels triple, NOT the compiled tier preset.
canonical_embedding_dim
v0.7.x (issue #1169) — look up the vector dim for a canonical embedding model id. Returns None when the model is not in the KNOWN_EMBEDDING_DIMS table; callers fall back to the tier preset (preserving pre-#1169 behaviour for unrecognised ids).
configured_default_namespace
#1590 — the operator-configured default namespace, or None when the operator never explicitly configured one (callers then apply their historical per-surface default).
default_capability_provenance_substrate_layer
default_tier_llm_model
Provider-agnostic default backend LLM model tag for the LLM-capable feature tiers (smart / autonomous).
is_api_embed_backend
#1598 — true when the embedding backend speaks an API wire shape (OpenAI-compatible /embeddings + Bearer auth) rather than the local Ollama-native /api/embed shape. "ollama" is the ONLY non-API backend; every #1067 alias and the generic openai-compatible escape hatch classify as API backends. Sits next to [alias_api_key_env_vars_for_resolver] / [backend_default_base_url] — the alias machinery it complements.
lock_configured_default_namespace_for_test
Test-only gate serialising mutations of the process-wide [CONFIGURED_DEFAULT_NAMESPACE] slot (same pattern as [lock_permissions_mode_for_test]). Every test that seeds the slot — or asserts the unseeded default — takes this guard first so parallel tests cannot observe each other’s transient state.
parse_duration_string
v0.7.0 (issue #518) — parse a duration string of the form "<integer><unit>" into a chrono::Duration. Supported units: s (seconds), m (minutes), h (hours), d (days), w (weeks). Whitespace and case are tolerated. Returns None on malformed input — the caller falls through to “no since filter applied”.
permissions_decision_counts
Snapshot the current per-mode decision counts.
record_permissions_decision
Increment the decision counter for mode. Called by the gate on every consult. Relaxed is fine: the counters are observability, not load-bearing for correctness.
set_active_hooks_hmac_secret
v0.7.0 K7 — set the process-wide webhook HMAC override. Called from main/daemon bootstrap with the value from [hooks.subscription] hmac_secret. Last writer wins — this is production-safe because boot only invokes it once; tests use the same setter to flip mid-process.
set_active_max_decompressed_bytes
Set the process-wide decompression cap. Boot reads [transcripts] max_decompressed_bytes and calls this; tests flip mid-process to exercise both branches.
set_active_permissions_mode
Set the process-wide active PermissionsMode. Called from main (CLI) and the daemon bootstrap path with the value resolved from [permissions].mode in config.toml. Last-writer-wins so a future SIGHUP / ai-memory reload surface can refresh the mode without restart (#1174 PR7); the previous OnceLock shape made repeat callers silently no-op.
set_allow_loopback_webhooks
v0.7.0 H11 — set the process-wide loopback-webhook opt-in. Called from boot with the value of [subscriptions] allow_loopback_webhooks. Defaults to false (loopback rejected).
set_configured_default_namespace
#1590 — seed (or clear) the process-wide operator-configured default namespace. Called once at boot; pass None for deployments without an explicit [storage].default_namespace.