How Agents Remember Information
Learn the kinds of memory an agent can have, and how long-term memory works without retraining anything.
Tell an assistant on Monday that you’re vegetarian. On Thursday, in a new conversation, ask it to book lunch for your team meeting. Does it remember?
By default, no. As Track 2 showed, a model is stateless: it only knows what’s in the current context window. A new conversation starts with an empty one. Anything that should survive has to be stored somewhere else and brought back. Agent builders usually think of three kinds of memory:
- Working memory is the context window itself: the current conversation, the tool results so far. Fast and detailed, but it disappears when the session ends.
- Long-term memory is a store outside the model, often a vector database (Track 6). The agent saves useful facts (“vegetarian”, “prefers aisle seats”, “manager: Dana”) and later retrieves the ones relevant to the current request. It’s RAG over the agent’s own notes.
- Procedural memory holds how-to knowledge: instructions, rules and lessons learned, such as “expense reports go to finance”. Often it’s simply part of the system prompt, or a file the agent can read and update.
The hard part isn’t storing, it’s deciding what to store. Save everything and retrieval drags in junk (“it was raining on Monday”) that distracts the model and costs tokens. Good memory systems save selectively, update facts that change, and forget what’s outdated.
And because memories are personal data, users should be able to see what’s stored about them and delete it.
Key takeaways
- Models are stateless: a new conversation starts with an empty context window.
- Working memory is the context window; long-term memory is an external store searched when relevant.
- Procedural memory holds how-to rules, often in the instructions or a file.
- Save selectively, update or forget outdated facts, and let users see and delete their memories.
Check your understanding
Go deeper (more technical)
Research systems such as MemGPT (2023) treat the context window like a computer’s RAM and long-term storage like its disk, with the agent itself deciding what to page in and out. Some products let users view and edit an assistant’s saved memories directly.
Memory raises privacy questions: what may be stored, for how long, and who can see it. Regulations such as the EU’s GDPR give people rights over personal data, including memories an assistant keeps about them.