How should an AI agent manage its memory: what to store, update and forget?

Short answer

AI agent memory management is the set of rules for what an agent writes to memory, how it updates or removes memories when facts change, and when old memories expire. The 2025 Mem0 paper lets an LLM choose add, update, delete or no change for each new fact, and Anthropic's docs advise capping memory size and deleting files that have not been used for a long time.

Memory management is a lifecycle, not a database

Most writing about agent memory is about retrieval: how to find the right memory. The harder problem comes earlier and later. What deserves to be stored at all, what happens when a stored fact stops being true, and when does a memory leave? An agent that only adds memories ends up with three versions of the same price list and no idea which one counts.

The four decisions

Decision Question Common practice
1. Write Is this worth remembering? Extract distilled facts, decisions and lessons, not whole transcripts
2. Update Does this change something already stored? Compare with similar memories, then add, merge or replace
3. Forget Is this contradicted or no longer used? Delete contradicted memories, expire unused ones
4. Guard May this be stored at all? Strip secrets and personal data, cap size, restrict paths

Write. The Mem0 paper extracts candidate facts from each new message pair, using a running conversation summary and the last 10 messages as context. LangGraph distinguishes facts (semantic memory), past events (episodic) and instructions (procedural); deciding which type you are storing helps decide where it goes.

Update. The system in the 2025 Mem0 paper compares each candidate fact with the 10 most similar existing memories and lets the LLM choose ADD, UPDATE, DELETE or NOOP through a tool call. LangGraph warns that a single growing profile becomes error-prone, while a collection of small memories means the model must “delete or update existing items in the list, which can be tricky.”

Forget. Anthropic’s memory tool docs give two plain rules: cap how large a memory file can grow, and “periodically delete memory files that haven’t been accessed in a long time.” Claude’s tool description already tells it to keep the memory folder organized, and you can reinforce that in your prompt by asking it to rename or delete files that are no longer relevant.

Guard. The same docs note that Claude usually refuses to write sensitive information, but recommend validation that strips sensitive data before your handler writes a file, and strict checks that every path stays inside /memories.

When to write: during or after the task

You can write memory in the hot path, while the agent works, or in the background afterwards. LangGraph lists the trade-off: the hot path makes memories available at once and visible to the user, but adds latency and an extra job for the agent. Background writing avoids that, but you must choose how often it runs. Many teams combine both: the agent notes what it learns during the task, and a separate pass tidies, merges and removes later.

The misunderstanding: memory management means saving tokens

Compression and summarization do save tokens, but the bigger reason to manage memory is correctness. A stale memory is worse than none, because the agent acts on it with confidence. The same goes for a memory that was written by mistake or planted on purpose; see What is memory poisoning in AI agents? and What are the privacy risks of AI agent memory?

Store lessons, not only facts

Facts about users are the classic example, but the most valuable memories for work are often lessons: what went wrong last time and how to avoid it. The ReasoningBank paper distills reasoning strategies from both successful and failed attempts, and reports that including failures improved results compared with storing successes only. See What is ReasoningBank?

What this means for a team

In a team, memory management gains a social layer. Who may change a shared memory? What happens when two colleagues teach the agent opposite rules? Personal preferences should not overwrite team decisions, and every change should leave a trace, so a wrong memory can be found and undone. Those questions are why shared memory needs ownership and history, not only storage. For how teams set this up across tools, see How can a team share one AI memory?

Where Bombos fits

For a team, these decisions about storing, updating and forgetting belong in one shared place rather than in each agent. Bombos is a plugin: a shared memory layer underneath the AI your team already uses, from Claude, ChatGPT, Copilot, Grok, Codex, Cursor and your own agents. It learns how your team works, draws on what already sits in mail, documents and repos, and shows with every answer what it rests on. It runs in the cloud in Europe or standalone on your own server, and one person can try it first with their own agents.

Related questions

Should an agent store everything?

No. Storing every turn makes retrieval noisier and keeps outdated facts alive. Store distilled facts, decisions and lessons, and keep raw history separately if you need an audit trail.

How does an agent know a memory is outdated?

Usually by comparing a new fact with similar stored ones. In the 2025 Mem0 paper, an LLM looks at the 10 most similar memories and can update one or delete one that the new information contradicts.

Who should manage memory: the agent or the developer?

Both. The agent can write and edit in the moment, but the developer sets the rules: what kinds of information may be stored, size limits, expiry, and what must never be written, such as secrets.

Should failures be stored too?

Often yes. The ReasoningBank paper found that adding lessons from failed attempts improved results over storing successes only.

Sources

  1. Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory (arXiv 2504.19413)
  2. Memory tool (Claude Platform docs)
  3. Memory overview (LangChain / LangGraph docs)
  4. ReasoningBank: Scaling Agent Self-Evolving with Reasoning Memory (arXiv 2509.25140)
The first half hour · free

What does your AI forget?

  1. 01You tell us which AI you use and where it keeps starting over.
  2. 02We show what a shared memory changes there, on your own examples.
  3. 03You keep the plan, with or without Bombos.
Piet Baudoin
Piet BaudoinYou talk to Piet, from the Bombos teamDutch team from Utrecht and Nijmegen · data in Europe
We reply the same working day.