AI engineering glossary · Agents tools MCP
What is context compaction?
Context compaction: Shrinking an agent's working context, by summarising or dropping older steps and tool outputs, so a long task can continue without exceeding the context window. Done poorly it removes facts the agent still needs.
Context compaction: an example
When the transcript nears the limit, the agent replaces raw tool logs with a 300-word summary and keeps the last five turns.
Related terms
- Conversation summary
- Context window
- Short-term memory
- Context management
More Agents tools MCP terms
- Conversation summary
- CrewAI
- Debate (multi-agent)
- Deep research agent
- Durable execution
- Episodic memory
- Error recovery
- Escalation
Where you learn it
Context compaction is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.