mnesis.models.config¶
config
¶
Configuration models for Mnesis sessions and components.
CompactionConfig
¶
Bases: BaseModel
Configuration for the compaction engine.
Everyday knobs::
CompactionConfig(
auto=True,
compaction_output_budget=20_000,
compaction_model="anthropic/claude-haiku-4-5-20251001",
)
Advanced tuning¶
The following fields control internal compaction behaviour and should only be changed with a thorough understanding of the compaction loop:
soft_threshold_fraction— when to start early background compactionmax_compaction_rounds— cap on summarise+condense cyclescondensation_enabled— whether to merge accumulated summary nodes
auto
class-attribute
instance-attribute
¶
Whether to automatically trigger compaction when overflow is detected.
prune
class-attribute
instance-attribute
¶
Whether to run tool output pruning before compaction.
level2_enabled
class-attribute
instance-attribute
¶
Whether to attempt Level 2 (aggressive) compaction before falling back to Level 3.
FileConfig
¶
Bases: BaseModel
Configuration for large file handling.
StoreConfig
¶
Bases: BaseModel
Configuration for the SQLite persistence layer.
OperatorConfig
¶
Bases: BaseModel
Configuration for LLMMap and AgenticMap operators.
SessionConfig
¶
Bases: BaseModel
Configuration for session-level behaviour.
MnesisConfig
¶
Bases: BaseModel
Top-level configuration for an Mnesis session.
All sub-configs have sensible defaults and can be overridden individually.
Example::
config = MnesisConfig(
compaction=CompactionConfig(
compaction_output_budget=30_000,
compaction_model="anthropic/claude-haiku-4-5-20251001",
),
file=FileConfig(inline_threshold=5_000),
)
To override model context/output limits without constructing ModelInfo
directly, use model_overrides::
config = MnesisConfig(
model_overrides={"context_limit": 128_000, "max_output_tokens": 16_384},
)