BACK TO INTERVIEW BANK
context-memorysenior

Why does agent quality degrade over a long session?

Answer

Three mechanisms, and they compound.

The window fills and history gets compressed. Once compression starts, detail is lost. The agent does not know what was dropped, so it cannot ask for it back. Corrections you made early are often the first casualty, because they read as resolved.

Attention is not uniform. Models attend more reliably to the start and end of a long context than the middle. As the session grows, instructions given early sit in the least attended region while remaining nominally present. The instruction is technically in context and effectively ignored.

Signal to noise falls. A long session accumulates failed attempts, verbose tool output, and abandoned approaches. All of it competes for attention with the actual task. A wrong approach that was tried and rejected is still sitting there looking like relevant context.

Observable symptoms: re-reading files it already read, reintroducing a bug it already fixed, drifting from a convention it followed earlier, and answers becoming vaguer.

Mitigations, in order of value:

  • Start fresh sessions per task. By far the most effective and the least used.
  • Put durable knowledge in files that are re-read each session rather than relying on conversation history.
  • Keep tool output small. Truncate logs, summarise rather than dumping.
  • Re-state key constraints when they matter, rather than trusting an instruction from forty turns ago.

Common wrong answer

Attributing it to the model "getting tired" or degrading over time. Each request is independent and stateless. Nothing about the model changes during a session. What changed is the input you are sending it, which has grown longer, noisier, and partially lossy.

Likely follow-ups

  • How would you detect this happening?
  • What is the cheapest mitigation?