Memory Summarization
Compress redundant short-term history into running summaries, merges, or reflection-driven updates to free context without discarding task state.
Human language is redundant for clarity; stripping redundancy shrinks the short-term footprint. Common approaches under memory management:
- Running summarization — same or separate model summarizes the conversation, often with named-entity tracking.
- Pairwise keep/merge decisions — after summarizing, a classifier chooses for each (memory sentence, summary sentence) pair whether to keep one, both, or neither, recovering facts a summary alone would drop.
- Reflection-based updates — after each action, reflect on new information and decide insert, merge, or replace when older facts are outdated (compatible with reflection and error correction).
Contradiction handling is use-case dependent: default to newer facts, or let a judge choose; sometimes keeping multiple perspectives is useful. Summarization beats naive FIFO context eviction when early goals must survive. Agent harnesses that summarise automatically call this compaction; it needs safeguards and competes with starting fresh from a handoff (compaction vs context reset). Under memory pressure eviction, flush can rebuild a recursive summary from the existing summary plus the just-evicted messages so goals survive after the FIFO shrinks. For bulk corpora outside the chat queue, use hierarchical summarization and decide whether summaries should be general or task-specific.
Sources
- AI Engineering (Chip Huyen), ch. 6
- MemGPT (Packer et al.), §2.2