Skip to content

AI Glossary · Concepts

What is Context Compaction?

Context Compaction

Context compaction reduces the material in an agent's active context while trying to retain what the task needs. Some implementations summarize older history; others move full records outside the window and retain references for retrieval.

· Updated · Chain of Thought

Context ManagementAgent Memory

  • 1 explainer
  • 1 episode
  • 1 source

A coding agent can accumulate pages of test output while working on one bug. Our suggested compacted state preserves the goal, constraints, files changed, checks completed, and unresolved problems. It can drop repeated logs while retaining pointers to the full records.

The terminology varies. Anthropic’s context-engineering guide calls summarizing a long conversation and starting a fresh window with that summary compaction. In episode 53, at 36:33, Richmond Alake uses compaction for moving full context into external storage and retrieving it when needed. Alake distinguishes that approach from lossy summarization. The episode’s sponsor read names Galileo.

Agent memory is the broader question of what persists and how it is retrieved. Compaction manages the active context window. Retaining full records allows later retrieval; a summary alone can discard details.

Our suggested check is to resume from the compacted state and ask whether the agent still respects the original constraints and can recover the supporting evidence. A summary saying “deployment approved” is dangerous if the original approval applied to a different commit. Keeping a concise handoff in context and an auditable full record outside it can serve different needs.

Sources

Go deeper

From the conversation