Context management
Keeping an agent's context small and relevant. When the window fills, compaction replaces the history with a summary, which keeps the gist and loses details; and a long, cluttered context tends to work worse even before it's full. One task per session, decisions in files.
Depth 1 · Foundation
You can explain what compaction gains and loses, why a crowded context gives worse answers, and use habits that keep the context clean.
Sign in to prove what you know with a short quiz, see how deep you've gone, and earn XP for it.
Sign in with GoogleDepths of understanding
- 1
Foundation
You can explain what compaction gains and loses, why a crowded context gives worse answers, and use habits that keep the context clean.
- 2
Deeper
You can build it: compaction as one extra request that asks the model to summarise the session, with the same system prompt and tools, replacing the history with the task and the summary; or trimming that drops whole turns from the oldest so no tool_use loses its tool_result.
Master depth 1 first
Your path here
What's still between you and Context management, depth 1, in the order you can learn it.
- 1Language modelDepth 1 · Foundation · Language Models
- 2TokenDepth 1 · Foundation · Language Models
- 3CountingDepth 1 · Foundation · Number Systems
- 4Comparing numbersDepth 1 · Foundation · Number Systems
- 5ProbabilityDepth 1 · Foundation · Probability
- 6Flat shapesDepth 1 · Foundation · Geometry
- 7Equal partsDepth 1 · Foundation · Fractions
- 8LengthDepth 1 · Foundation · Measurement
- 9LengthDepth 2 · Deeper · Measurement
- 10Equal partsDepth 2 · Deeper · Fractions
- 11FractionsDepth 1 · Foundation · Fractions
- 12ProbabilityDepth 2 · Deeper · Probability
- 13ProbabilityDepth 3 · Connected · Probability
- 14ProbabilityDepth 4 · Deeper still · Probability
- 15ProbabilityDepth 5 · Deeper still · Probability
- 16Next-token predictionDepth 1 · Foundation · Language Models
- 17Stateless modelDepth 1 · Foundation · Language Models
- 18Context windowDepth 1 · Foundation · Language Models
- 19Context managementDepth 1 · Foundation · Language Models
Where it fits
Builds on
This concept