Virtual context (LLM)
Virtual context is the agent-memory pattern introduced by MemGPT (now Letta) — a small in-context working memory plus an external archival memory the model can read from and write to as the conversation grows.
In more detail
What it means
MemGPT (Packer et al., 2023) introduced virtual context inspired by OS virtual memory. The model sees a small main context (a few thousand tokens of recent conversation + system prompt + scratchpad) and has explicit functions to read from / write to an archival memory layer. As conversation grows, the model selects what to evict to archival and what to recall. The pattern lets the model handle conversations longer than the underlying model's context window. Letta (the productised version) and several derivatives ship this architecture in 2026.
Part 1 of 2
When to use it, and when not
Use it for
- Long-running assistants without persistent fine-tuning.
- Agent memory experiments and research.
Part 2 of 2
Common mistakes
- Treating virtual context as a panacea — it adds latency + complexity vs simpler memory layers.
- Skipping eviction policy thought — what to forget matters as much as what to keep.
FAQ
Questions readers ask.
What is virtual context (llm)?
Virtual context is the agent-memory pattern introduced by MemGPT (now Letta) — a small in-context working memory plus an external archival memory the model can read from and write to as the conversation grows.
When should you use virtual context (llm)?
Long-running assistants without persistent fine-tuning. Agent memory experiments and research.
What are the common mistakes with virtual context (llm)?
Treating virtual context as a panacea — it adds latency + complexity vs simpler memory layers. Skipping eviction policy thought — what to forget matters as much as what to keep.
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/virtual-context.md. Found a mistake? Tell us.