Skip to content

The agent that forgets the goal

On a long task, as the context window fills and older turns get truncated, the agent can drift from or forget its original goal, which looks like the model quietly getting worse for no reason.

incident

Twenty turns into a research task, the agent has lost the original question and is confidently answering a subtly different one.

where_are_you

The maturity ladder, worst to best

These are the rungs the Agent Reliability Scorecard scores for this dimension, straight from the tool. Find where your agent sits, then aim for the top rung.

  1. It can drift or forget the goal; older content just gets truncated

  2. We cap turns to avoid overflow, nothing smarter

  3. We summarize/compress history to keep the goal in view

  4. Structured memory, and the invariant goal is re-anchored each turntarget

the_fixKeep the goal in view as context fillsSummarize or compress history and re-anchor the invariant goal each turn, so the agent doesn't lose the thread on a long task. Context rot is a slow failure that looks like the model getting dumber.

why_it_matters

Context is finite, and a long agent run fills it. When it overflows, the oldest content, which often includes the original instruction, gets truncated first. The agent doesn't announce this. It just starts optimizing for whatever's still in the window, which may be a sub-goal, a tangent, or the shape of the last few tool results. From the outside it reads as the model getting dumber partway through a task, when really it has lost the thread.

Keep the goal in view as context fills. Summarize or compress history so the window holds meaning rather than raw transcript, and re-anchor the invariant goal each turn so it can't be truncated away. Structured memory, where the durable facts live outside the rolling context, is stronger still. Context rot is a slow failure, so it survives casual testing and shows up only on the long tasks that matter most.

window fills → goal truncatedthe model looks like it's getting dumbercompress history, re-anchor the goal each turn

faq

Questions & answers

Why does my agent lose track of the task on long runs?
Because the context window filled and the original goal got truncated with the oldest turns. The agent then optimizes for whatever's left in the window, which drifts from the real task. Summarize or compress history to preserve meaning, and re-anchor the invariant goal on every turn so it can't be dropped.
What is context rot in an AI agent?
It's the slow degradation that happens as a long run fills the context window and important early content, including the goal, gets truncated. The model appears to get worse partway through the task. The fix is managing what stays in context: compression, structured memory, and re-anchoring the goal rather than letting raw transcript push it out.

Fixing one failure mode is a day. Hardening the whole loop is the work.

I review where your agent loop terminates, how it escalates, how it fences tool output, idempotency on the side effects, and the evals that catch a regression before users do. Book a call, or leave your email.

Book a call

No spam. You'll get a reply from me.

Prefer proof first? See how this plays out in real case studies →