Lesson 1266 of 1596
Context Compaction: How AI Agents Survive Long Sessions
Compaction strategies — summarization, eviction, and offloading — let agents work past their context limits productively.
Creators · AI Foundations · ~17 min read
The premise
Long-running AI agents inevitably outgrow their context window. Compaction strategies — recursive summarization, episodic eviction, file-based offload — keep them productive past the wall.
What AI does well here
- Recursively summarize older turns to preserve narrative
- Evict tool-call noise while preserving outcomes and decisions
- Offload artifacts to files and re-load by reference
What AI cannot do
- Avoid losing some information at every compaction step
- Substitute for genuine long-context model capability
- Recover details the agent never explicitly recorded
Key terms in this lesson
End-of-lesson quiz
Check what stuck
10 questions · Score saves to your progress.
Tutor
Curious about “Context Compaction: How AI Agents Survive Long Sessions”?
Ask anything about this lesson. I’ll answer using just what you’re reading — short, friendly, grounded.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Creators · 11 min
KV-Cache Eviction: The Hidden Quality Knob
KV-Cache Eviction reshapes serving and quality tradeoffs. This lesson covers why it matters and how to evaluate adoption.
Creators · 11 min
Attention deep dive: queries, keys, values, and why it works
Understand attention as a content-addressable lookup over a sequence — and where the analogy breaks.
Creators · 11 min
Tokenization economics: why your bill depends on the tokenizer
Tokenization decisions ripple into cost, latency, and capability — for languages, code, and rare strings.
