A support assistant sees the full history of a customer account and still offers the wrong delivery window. The conversation contains an old preference for morning delivery, a newer temporary request and a warehouse note that supersedes both for the current order. Adding the entire history gives the model more information to sort through at the same time.
Context rot is a practical diagnosis
Context rot describes the loss of task performance that can occur as context grows or becomes harder to use. The effect depends on the task, model and structure of the input. A large context window tells you how much text can fit. Whether the model reliably finds the right record inside it is something you can measure. Chroma context rot study
Diagnose it with controlled comparisons. Give the assistant the current order and the authoritative delivery rule. Then add older tickets and near-duplicate policies while keeping the correct answer fixed. Check whether accuracy, citations and latency change. If stale records cause more trouble than unrelated records, the fix may involve better version filtering.
Compaction keeps a long run manageable
Compaction replaces part of the current conversation or tool history with a smaller representation. A support workflow can keep the current order ID, verified delivery constraints, completed checks and unresolved questions, while moving raw tool responses out of the immediate context. Keep references back to original records when later steps may need exact wording. Anthropic’s work on long-running agent harnesses
The acceptance test is whether the next step still works. If the summary says “customer asked for afternoon delivery,” it might omit that the request applied to a single delivery date. Use fields for details that control actions, such as order ID, approved action, deadline and source, and test that the agent can resume from the compacted state.
Memory consolidation helps across runs
Consolidation selects, merges and updates information worth retrieving in a future interaction. A confirmed standing delivery preference could qualify. A one-off accommodation should usually remain associated with its order. Store the scope, verification date and source with a durable memory record so the application can manage conflicting updates and delete expired information.
For example, a structured memory may say “morning delivery preferred when available,” while the current order record says “deliver after 2 p.m. this Friday.” Define which source has authority for this decision. In that case, the order-specific instruction applies to the active shipment. The standing preference still has value on future orders.
Test the handoff under realistic conditions
- ▸Long history. Add older notes and test that the current rule still determines the answer.
- ▸After compaction. Resume a paused run and verify the order, approval state and next action against the original records.
- ▸Across sessions. Start a new conversation on a different order and check that the standing preference is available only in the right scope.
- ▸After a correction. Update or remove the saved preference and verify that it no longer drives a recommendation.
Track correct-action rates and source accuracy alongside prompt size. A shorter prompt may reduce cost while increasing wrong decisions if it drops the constraints support staff rely on. Use the tests to decide what to compact, what to retrieve and which fields to preserve exactly.
Keep track of who can correct a saved fact and how it disappears from future prompts. If an employee edits a preference in the CRM, the retrieval layer should pick up that change without waiting for another conversation to consolidate it. Test the update with an account that has multiple orders, so a passing result shows that the new preference reached the right records.
For implementation patterns, read the production context engineering guide and the AI support desk architecture.
