When to reach for it
- Conversations or tasks outgrow the context window.
- Salient facts must survive across very long horizons.
- Which information is salient changes over the run.
/pattern/virtual-context-management/
The agent treats its finite context window like RAM and an external store like disk, paging information between the tiers under its own control so it can operate over histories far larger than the window.
In practiceA legal-research agent managing a 200-page contract pages out early clause summaries to an external store and pages them back in only when a downstream question references that section.
When to reach for it
When it backfires
The tradeoff
Effectively unbounded memory under a fixed window is gained against extra inference calls to manage the paging and the risk of evicting something the agent later needs.
Content is paged in and out to fit the context window.
Self-editing memory means the agent decides what to drop. Under token pressure it can page out a fact that becomes critical several steps later, then confabulate a replacement.
Fix · Pin invariant facts (task goal, constraints, identity) to a non-evictable region and only let the pager touch the discretionary tier.
Each eviction compresses already-compressed content. After many cycles the paged-back summary is a summary of a summary, and details mutate or invert relative to what was originally said.
Fix · Page the verbatim content out to the store and summarise only the resident working view; recall the original on demand rather than re-compressing repeatedly.
Keep going
Search patterns, frameworks, and pages.