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 storage