Context Rot: How Long-Running Agents Lose Their Mind
An agent deployed on day one has a coherent knowledge state. The policies it knows are current. The vendor contracts match reality. The regulatory requirements reflect the law as it stands.
Six months later, none of that is guaranteed. The policy was updated. The vendor changed their pricing. The regulation was amended. The agent’s memory still contains the old versions — alongside the new ones.
This is context rot. It is not a bug in the agent. It is the inevitable result of operating a long-running system against a world that changes.
The Survival Equation
Research published in 2026 formalized context rot as a survival equation:
A(t) = R₀ · e^(−Cₜ)
Where A(t) is reasoning accuracy at time t, R₀ is baseline accuracy with a clean knowledge state, and Cₜ is the volume of accumulated contradictions.
The exponential decay matters. This is not a gradual linear degradation. As contradictions accumulate, accuracy collapses. An agent with 10 unresolved contradictions in its memory graph does not perform 10% worse than a clean agent. It performs exponentially worse on the queries where those contradictions are relevant — which tends to be the most important queries, involving the most frequently updated information.
The practical consequence: an agent that was reliable at deployment becomes unreliable over time, in a way that is difficult to observe without measuring reasoning quality directly. The agent does not throw errors. It produces confident, internally consistent answers that are wrong.
What Contradictions Look Like
A contradiction is not two logically incompatible statements sitting next to each other in the memory graph. It is subtler:
- The 2025 vendor contract is stored as a node with pricing terms. The 2026 amendment is added as a new node. Both are present. Neither is marked as superseded.
- The regulatory requirement from Q3 2025 is stored. The Q1 2026 amendment is added. Both are present. The agent draws from both depending on retrieval order.
- The infrastructure configuration from before the migration is stored. The post-migration configuration is added. The agent reasons about both as if they are simultaneously true.
These are not logical contradictions in the formal sense. They are temporal contradictions — facts that were true at different times, stored without temporal ordering that would allow the model to prefer the current one.
The Fix: Cognitive Sleep
The OSF research paper on “Cognitive Sleep for LLMs” describes the structural fix: asynchronous contradiction metabolism running during idle periods, separate from the inference path.
The process:
- Background scan of the memory graph during idle periods
- LLM-based pairwise comparison of potentially conflicting fact pairs
- Resolution: one fact is marked superseded, the other is weighted as current
- Decay applied to stale facts without permanent deletion (audit trails must be preserved)
- Pre-validated context state ready for the next inference call
The key architectural commitment is asynchrony. The contradiction resolution cannot happen at inference time — that would add latency to every call. It must happen in the background, as a continuous maintenance process, so that inference always starts from a pre-validated state.
This is the “cognitive sleep” analogy: biological memory consolidation happens during sleep, not during active cognition. The engineering pattern maps precisely: context engineering happens during idle periods, not during active inference.
What This Means for Agent Architecture
Context rot is not a problem that improves with better prompting. Telling the model to “prefer more recent information” does not help when both versions of a fact are present without temporal metadata that would identify which is recent.
It is an infrastructure problem. The memory layer must:
- Store temporal metadata on every fact at ingestion
- Run contradiction detection during memory updates, not at inference
- Apply decay on explicit curves rather than assuming freshness
- Maintain historical records for audit purposes while preventing superseded facts from entering the active context
An agent without this infrastructure will rot. The rate depends on how fast its operating environment changes. For agents in finance, law, compliance, or infrastructure — domains where facts update frequently and errors are expensive — context rot is not a theoretical risk. It is an operational certainty.
The question is whether the architecture resolves it before it resolves the agent’s usefulness.