What Is Agent Memory?
Asha opens Tripmate a month after her Jaipur trip and types, "Same as last time, but to Udaipur." For a good assistant that is a complete request: same dates pattern, same class, window seats, vegetarian meals. For a bare model it is meaningless — it has never "met" Asha. Agent memory is what closes that gap.
The rule
A model remembers nothing; memory is what your app writes, stores and puts back.
Every model call starts from zero. So "memory" in an agent is not inside the model. It is a system around it with three moves:
- Write — decide what is worth keeping ("Asha prefers window seats").
- Store — save it somewhere: the running message list, a database, a file, a search index.
- Retrieve — at the right moment, find the relevant pieces and put them into the context.
Memory is usually split by how long it lasts:
- Short-term memory — the current conversation and task: recent messages, tool results, the plan so far. It lives in the context window and ends with the session.
- Long-term memory — facts and history kept across sessions: preferences, past trips, what worked before. It lives in storage and is brought back only when relevant.
session starts → retrieve relevant long-term notes → add to context
during the task → short-term history grows in the context
session ends → write the notes worth keeping to long-term storageThe shortcut
For any piece of information ask: "Will I need this after this conversation ends?" No → short-term; let it live in the context and fade. Yes → long-term; write it down deliberately, and plan how it will be found later.
"Show me trains after 6 pm"
Only matters for this search. Short-term: keep it in the conversation.
The trap is keeping everything. A store full of stale search results makes retrieval noisier and slower, and it holds personal data you have no reason to keep. Memory is as much about choosing what to forget as what to save.
Drills
Answer fast — trust the rule.
Where does an agent's long-term memory live?
Which fact belongs in long-term memory?
What are the three moves of any agent memory system?
Why not save every message forever?
Remember
- A model remembers nothing; memory is what the app writes, stores and retrieves into context.
- Shortcut: "Will I need this after the conversation ends?" — no is short-term, yes is long-term.
- Trap: keeping everything, which clutters retrieval and holds data you should not.
