003 / NOTES · PAPER READING← All notes

What if context worked more like a desk than a warehouse?

Memory like an operating system.

MemGPT asks what happens if a language model manages what belongs in and out of its working context.

Limited working context need not mean limited accessible history—if the system can deliberately move information between an in-context working area and storage outside the context window.

MOVE MEMORY / DESK ↔ ARCHIVEclick a record
CONTEXT DESK · 2 SLOTScurrent task
recent message
ARCHIVEdataset v3
normalization rule
old meeting
draft note
dataset v3

The record exists, but it is not yet on the desk. Click it to retrieve it.

The desk and the archive

Think of a small desk in a huge library. The desk holds only a few open books. There may be thousands more available, but reading requires choosing which ones to bring onto the desk. The problem is not the library's size; it is who decides what to fetch, when, and why.

A language model's context window is the desk. MemGPT: Towards LLMs as Operating Systems calls this the main context, and pairs it with external context that sits outside the model's current prompt. The system uses function calls to move information between these tiers, creating a form of virtual context management rather than trying to keep the entire history in one prompt.

Where the operating-system analogy helps

Traditional operating systems use memory hierarchies because fast, immediately available memory is limited. MemGPT borrows that intuition: the model's finite context acts like fast memory, while external storage acts like a larger but out-of-context tier. In the paper, external context is further split into recall storage for past events and archival storage for a general read-write datastore.

The interesting design decision is not merely having a vector database. It is memory management: what remains in main context, what is written outside it, when older information is searched, and when the working context is edited. MemGPT makes these operations self-directed through function calls, and also uses event-driven control flow and function chaining so the agent can perform several memory operations before yielding back to the user.

Walk through an example

Suppose an assistant helps a researcher over several weeks. Today's main context contains the immediate task and recent messages. An older experiment's dataset version and normalization rule sit outside that context. When the user asks to reproduce the experiment, the agent must decide to search the external memory, retrieve the relevant record, and place enough of it back into main context for the model to use.

If it retrieves the wrong version, or retrieves the right one but ignores it, expanding accessible memory hasn't solved the task. Storage, retrieval, and correct use remain separate responsibilities.

What I would test

The paper itself evaluates MemGPT in multi-session conversation and long-document analysis, including deep-memory retrieval and long-context retrieval tasks. A further evaluation I would want is deliberately conflicting, versioned records: measure whether the right information was stored, retrieved, brought into context, and then used correctly. That last sentence is my extension of the paper's evaluation logic, not a reported MemGPT experiment.

My takeaway

MemGPT gives me a systems-design lens on agent memory: a fixed-context model can be wrapped in a system that actively manages what is in-context and what lives outside it. The paper's contribution is the virtual-context architecture and control policy, not a claim that external memory automatically makes reasoning faithful. Storage, retrieval, context editing, and final use can still fail separately.

Read the source: Packer et al., MemGPT: Towards LLMs as Operating Systems (2023).