Diagnosing Context Window Failures
This lesson explains the symptoms, causes and fixes of the four context window failures the skills outline names, sliding-window amnesia, summary drift, vector-only recall and entity continuity issues, so they can be recognized in scenarios.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish sliding-window amnesia from summary drift.
- Explain why vector-only recall misses exact identifiers.
- Prevent entity continuity issues with stable entity IDs.
Sliding-window amnesia and summary drift
Sliding-window amnesia appears when an agent keeps only the most recent N messages or tokens. Facts stated early, such as an account number, a constraint ("no flights before 9 a.m.") or a decision, silently fall out of the window, and the agent asks again or violates the constraint. The fix is to pin key facts in structured state or memory that is always injected, and to summarize rather than drop older turns.
Summary drift appears when context is compacted by summarizing, and later the summary itself is summarized again. Each pass loses or subtly alters details: amounts are rounded, conditions disappear, a tentative idea becomes a decision. The fix is to summarize from the original turns (kept in storage), preserve critical fields verbatim in structured state, and test summaries against their sources.
Amnesia or drift?
Vector-only recall
Vector-only recall appears when memory or retrieval depends only on embedding similarity. Embeddings capture meaning, so they miss exact identifiers (order numbers, codes), numbers, negations and recency: the agent cannot find "invoice INV-2026-0418" or retrieves an older, similar memory instead of the latest one. Fixes are hybrid retrieval with keyword search, structured lookups by ID for entities, metadata such as timestamps with recency weighting, and filters.
Vector-only recall
Entity continuity issues
Entity continuity issues appear when the agent loses track of which entity a reference means: "the second order", "her account", "that supplier". They are common after hand-offs between agents, after compaction and in conversations involving several similar entities. The fix is an explicit entity registry in shared state, with stable IDs, display names and the current focus, passed to every agent and updated when the user's focus changes.
The following table summarizes the four failures.
| Failure | Symptom | Cause | Fix |
|---|---|---|---|
| Sliding-window amnesia | Early facts forgotten | Only last N turns kept | Pinned state, memory, summaries |
| Summary drift | Details change over time | Summaries of summaries | Summarize from source; keep fields verbatim |
| Vector-only recall | Exact IDs or latest facts missed | Similarity-only retrieval | Hybrid, ID lookups, recency |
| Entity continuity | Wrong person, order or account | References lost across turns or agents | Entity registry with stable IDs |
Symptoms to fixes
The wrong patient
A clinical scheduling assistant hands off between an intake agent and a scheduling agent. When a parent books appointments for two children in one conversation, the scheduling agent sometimes books the second appointment for the first child.
This is an entity continuity issue. An entity registry in the shared state, listing both children with stable patient IDs and marking which one the current request concerns, lets the scheduling agent resolve "her" and "the second appointment" correctly; the booking tool should also confirm the patient name before committing. A larger context window would not resolve the ambiguity.
What is the difference between sliding-window amnesia and summary drift?
Show answer
Amnesia is when early facts fall out of the context window. Drift is when details change through repeated summaries.
Exam Tips
Remember for the exam
- Amnesia: early facts fall out of a window. Drift: details change through repeated summaries.
- Vector-only recall misses exact IDs and recency; add keyword and structured lookups.
- Entity continuity needs a registry with stable IDs shared across agents.