Every agent looks brilliant in the first five turns. The user asks a question, the agent answers, the thread feels like magic. Then turn forty arrives, the agent starts contradicting itself, forgetting constraints agreed in turn three, and confidently answering a different question than the one asked. Nothing broke. The context rotted.
Context rot is what happens when an agent's working memory fills up with stale instructions, superseded decisions, and irrelevant detail — and the model, unable to tell signal from sediment, starts weighting all of it equally. The longer the conversation, the worse the ratio of useful context to noise, and the worse the output. It is the most common reason long-running agents feel like they get dumber over time, and it is almost never a model problem.
The three ways context goes bad
First, accumulation. Every turn appends tokens, and the earliest instructions — the ones that define what the agent is supposed to do — end up buried under forty turns of clarifications, corrections, and tangents. Models pay more attention to recent tokens. Your carefully written system prompt is losing a fight with the last three messages.
Second, contradiction. A user changes their mind in turn twelve, then again in turn twenty-five. Both versions sit in the context window. The agent has no reliable way to know which one is current, so it picks one — often the wrong one — with complete confidence.
Third, drift. The conversation wanders from the original task to an adjacent one, and the agent keeps answering as if the original goal still holds. The user asked about refund policy in turn two and is now discussing pricing strategy, but the agent is still optimising for the refund answer it prepared twenty turns ago.
Prune, don't pile
The fix is to treat context as a budget, not a landfill. Keep a short, living summary of the conversation's decisions and constraints — updated every few turns, not appended — and let the raw transcript expire behind it. When a user changes a decision, the summary should record the new one and drop the old one, not keep both and hope the model sorts it out.
Set a hard ceiling on context size and design for it: when the thread approaches the ceiling, summarise and compress, or start a fresh thread with the summary carried over. Users rarely object to a clean handover when it keeps the agent sharp; they always object to an agent that forgot what they agreed.
And separate the durable from the disposable. The user's goal, their constraints, and their decisions are durable. The back-and-forth that produced them is not. If your agent stores everything forever, it is storing the raw material of its own confusion.
We build AI agents that stay sharp over long conversations — with context budgets, living summaries, and handover design — because an agent that degrades with use is not a product that scales. It is a demo that expires.
Field note: A client once showed us an agent that "broke" after an hour of use. The logs told a different story: at turn sixty, the context window held three conflicting sets of instructions from the same user, two abandoned sub-tasks, and the original brief. We added a summariser that rewrote the working context every ten turns and dropped superseded decisions. Same model, same prompts. The "broken" agent ran for a week without a single complaint.
Related service AI products



