Which of the following are valid strategies for mitigating context pollution in a long-running agent?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Real mitigations actively shrink or filter the context: sliding window, summarisation, and pruning. A bigger window or disabling retries does not fix the underlying noise.
Imagine a detective's desk that fills with notes as a case drags on. Every lead, every dead end, every coffee-stained scribble piles up. Soon the desk is so cluttered the detective wastes time re-reading junk and misses the one note that matters. To stay sharp they can keep only the newest pages, rewrite the old ones into a tidy summary, or throw out notes that turned out to be irrelevant. What does not help is buying a bigger desk. The clutter just spreads to fill it, and the useful fraction stays just as low. An agent's context window is that desk. The fix is to manage what sits on it, not to make it larger.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define pollution as a noise ratio problem, name the three active mitigations with one tradeoff each, explain why a bigger window and disabling retries fail the test, then close with how production tiers these techniques and adds sub-agent isolation.
| Strategy | Mechanism | Main cost | Genuine mitigation |
|---|---|---|---|
| Sliding window | Keep recent N steps | Forgets early constraints | Yes |
| Summarisation | Compress old steps every K turns | Extra LLM call, lossy | Yes |
| Selective pruning | Drop low-relevance entries | Needs a relevance signal | Yes |
| Bigger window | More capacity | Noise still accumulates | No |
| Disable retries | Fewer failed calls stored | Breaks error recovery | No |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming a larger context window solves pollution. It only postpones the overflow while the noise ratio keeps climbing, so the model still drowns in stale steps.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.