# Virtual context (LLM)

**Source:** https://promtable.com/glossary/virtual-context

> 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.

---
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.

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.

## When to use

- Long-running assistants without persistent fine-tuning.
- Agent memory experiments and research.

## 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.

## Related terms

- [context-distillation](https://promtable.com/glossary/context-distillation)
- [context-window](https://promtable.com/glossary/context-window)
- [stateful-agent](https://promtable.com/glossary/stateful-agent)

## Sources

- [MemGPT paper](https://arxiv.org/abs/2310.08560)

*Last updated: 2026-06-01*
---

Original page: https://promtable.com/glossary/virtual-context
Maintained by Promtable (https://promtable.com). Content: CC BY 4.0. Cite as "Promtable — https://promtable.com/glossary/virtual-context".
Contact: info@vibecodingturkey.com.