import{_ as o,o as t,c as a,ag as r}from"./chunks/framework.DXGyWiRo.js";const g=JSON.parse('{"title":"Memory Compaction","description":"","frontmatter":{},"headers":[],"relativePath":"getting-started/compaction.md","filePath":"getting-started/compaction.md","lastUpdated":1774787421000}'),i={name:"getting-started/compaction.md"};function n(s,e,l,m,c,d){return t(),a("div",null,[...e[0]||(e[0]=[r('
As a bot accumulates memories over time, the memory pool can grow large and contain redundant or outdated entries. Memory Compaction is an automated process that consolidates and optimizes the bot's memory store, keeping the most relevant information while reducing noise.
Each conversation turn can generate new memory entries. Over weeks or months of use, thousands of memories accumulate. Many of these may overlap, become stale, or lose relevance. Compaction addresses this by:
Configure compaction from the General tab in the Bot Detail page.
| Field | Description |
|---|---|
| Compaction Enabled | Toggle automatic memory compaction on or off. |
| Compaction Model | The LLM used to evaluate and merge memories during compaction. This can be different from the chat model. |
When enabled, compaction runs periodically as part of the bot's memory maintenance cycle.
You can also trigger compaction manually from the bot's Memory tab:
0.8, 0.5, 0.3). Lower values mean more aggressive compaction.The Compaction tab in the Bot Detail page provides an audit trail of all compaction runs:
Compaction works with whatever Memory Provider is assigned to the bot. The compaction process:
This process preserves the semantic content of important memories while reducing the total count. After compaction, the bot's memory retrieval becomes faster and more focused.