Skip to main content
As your agent runs, it accumulates memories. Some are high-value long-term facts, while others are transient noise or duplicates. Mneno’s Auto-Compaction engine helps keep your memory store lean and useful.

How Compaction Works

The compaction engine analyzes your memories and makes one of three decisions for each:
  • Kept: The memory is high-value or recently updated and remains unchanged.
  • Merged: Near-duplicate memories are combined into a single, consolidated memory.
  • Discarded: Stale or low-scoring memories are removed to save space and reduce noise.

Preview vs. Compact

Mneno allows you to preview the changes before they are applied to your storage.
To actually apply the changes, use the compact() method:

Compaction Policy

You can control how aggressive compaction is by passing a CompactionPolicy.

Policy Parameters

Explainable Merges

When memories are merged, Mneno creates a new memory that consolidates the metadata and tags of the sources. The CompactionDiff includes a list of created memories and links them to the merged sources via related_memory_ids.