Your personal memory, across sessions, agents, and devices.

Long-Term Agent Memory: What Microsoft's New Paper Shows

memU Team memU Team

Seven researchers at Microsoft posted a paper on long-term agent memory to arXiv on October 29, 2026. It keeps two kinds of memory side by side: short write-ups of each conversation, and small structured facts about people and things. A periodic cleanup pass merges and prunes them. The authors report 90.2% on the LoCoMo benchmark and 85.5% on LongMemEval-S. By the end you will know how the method works and what the two benchmarks test. You will also know what you would still have to build yourself.

What is the paper's hybrid memory, in one sentence?

The paper's hybrid memory is a long-term agent memory design that saves each conversation as timestamped episodes and entity-relation tuples, then prunes both in an offline consolidation pass.

The PDF lists the seven authors under one affiliation, Microsoft. It names no specific lab. The arXiv listing files it under artificial intelligence and multiagent systems. It is a research method with prompts in the appendix. The paper does not link any code.

How does it differ from Mem0 and Zep?

Mem0 and Zep are the two memory frameworks most readers will know. The authors compare their design with both in an appendix, and their results table includes both scores.

This paper Mem0 Zep
Unit of memory Episodes plus entity-relation tuples, in two flat stores Extracted facts A temporal knowledge graph of entities and fact edges
When it writes Once per session, after the session ends Every turn, with add, update and delete operations Maintains the graph, with entity resolution and edge deduplication
Cleanup Offline clustering, then an LLM merges or deletes Per-turn update and delete Validity intervals and conflict detection on edges
LoCoMo LLM score with gpt-4o-mini 83.5% 61.3% 58.5%

All scores are from the paper's own table and are author-reported. The Mem0 and Zep numbers were not rerun by this team. The caption says they were taken from the Nemori paper, an earlier memory study.

How does long-term agent memory work in this design?

There are three stages. Curation runs after each conversation session ends, over its full transcript. One prompt writes episodic memories, each with a short title and a one-sentence summary. A details paragraph and the session date complete the record. A second prompt extracts relational tuples that link an entity to an object through a relation. Every tuple also carries a timestamp and the source sentence it came from.

The source sentence is the clever part. A tuple like "Caroline, will present, Q1 strategy" loses the speaker's intent. Keeping the original line next to it preserves that. The timestamp records when the fact was true. The authors call missing dates a common failure of relation-based memory. Both prompts tell the model to turn relative dates like "last Saturday" into absolute ones.

Consolidation handles growth. All memories are embedded and then clustered with UMAP plus HDBSCAN. An LLM then reads each cluster and decides what to merge and what to delete as outdated or conflicting. The appendix suggests running it every 10 to 20 sessions.

At question time, the system runs two separate similarity searches. It takes the top 10 episodes and the top 20 tuples, embedded with OpenAI's text-embedding-3-small. The paper says this fixed retrieval adds no extra LLM calls at query time. The main experiments ran every LLM step on gpt-4.1-mini or gpt-4o-mini.

What do LoCoMo and LongMemEval measure?

LoCoMo comes from a 2024 paper by Maharana and colleagues. Its conversations average about 300 turns over up to 35 sessions. The public release has ten conversations, a subset of the original 50. The Microsoft paper uses 1,540 questions from those ten, in four types: single-hop, multi-hop, temporal and open-domain.

LongMemEval was published at ICLR 2025 by Wu and colleagues. It has 500 questions testing five abilities: information extraction, multi-session reasoning, temporal reasoning, knowledge updates and abstention. Its authors found that commercial chat assistants and long-context models lost 30% accuracy on facts spread over long interactions. The S variant used here puts each question in a history of about 115,000 tokens and roughly 40 sessions, per the benchmark repository.

Both benchmarks test recall over long chat histories. Neither tests a coding agent working on a repository.

How well does it score, and at what token cost?

On LoCoMo, the paper scores answers with an LLM judge. With gpt-4o-mini, the hybrid scored 83.5%. That beat every memory baseline and also beat putting the whole history in context (79.0%). With gpt-4.1-mini it scored 90.2%.

That 90.2% is not the top number in its row. Full context with gpt-4.1-mini scored 91.3%. The authors argue the trade is worth it on tokens. With gpt-4o-mini, the hybrid used 2,738 tokens per question. Full context used 21,788, and the paper calls this 87% fewer tokens. Nemori, the strongest memory baseline, used 2,745 tokens and scored 74.4%.

On LongMemEval-S with gpt-4.1-mini, the hybrid averaged 85.5%. Nemori scored 74.6% and full context 65.6%, at about 101,000 tokens. The hybrid used 3,000 to 6,900 tokens. It lost one category badly: on single-session preference questions it scored 50.0% against Nemori's 86.7%.

Each store alone scores lower. Episodes alone scored 87.1% with gpt-4.1-mini. Tuples alone scored 83.7%. Together they reached 90.2%. The largest gains came on multi-hop and temporal questions.

Consolidation shrank the memory store by 16.34% and cost about one point, from 90.2% to 89.2%. It is a storage trade with no overall accuracy gain.

What should you read in the fine print?

Every number above is reported by the authors. We found no independent reproduction.

  • The memory-framework baselines on LoCoMo were copied from another paper. The prompts and judge settings behind them may differ from this team's runs.
  • On LongMemEval-S, the only comparisons are full context and Nemori. Mem0 and Zep do not appear in that table.
  • The paper reports tokens per question. It gives no latency figures and no dollar cost for curation or consolidation.
  • No code is linked. To check the results, you would reimplement from the prompts and the hyperparameters in the appendix.

The authors list their own limits. The evaluation is text only. Curation quality also depends on the model: moving from gpt-4.1-mini to gpt-4o-mini cost 6.7 points. With gpt-5.4 as the backbone, the hybrid scored 90.6%. The open-weight Qwen3-8B reached 76.2%.

The bottom line

The ablation supports one narrow finding. Episodes and tuples catch different questions, and combining them helps most on multi-hop and temporal ones. Building memory for a chat assistant? Copy the two prompts. Their date handling is worth taking too. Treat the headline scores as author-reported until someone reruns the baselines, and budget for building every piece yourself.

What does it take to run hybrid agent memory in your own stack?

Say you read this paper on Monday and want it behind your coding agents by Friday. You start with two prompts and a set of clustering settings. You still need a vector store and a job that runs after each session. Consolidation needs a scheduler, and every agent you use needs an integration. Then you find that LoCoMo never tested an agent working in a codebase.

The paper's method memU
What you get A paper with prompts. No code is linked An Apache-2.0 open-source repo, installed with one message to your agent
Who does the extraction Separate LLM calls for curation and consolidation The host agent itself. memU's MemoryService makes no LLM calls
What memory looks like Embedded episodes and tuples in two flat stores A readable Markdown wiki you can open and fix
Who reads it The single assistant in the benchmark One memory shared by Codex, Claude Code, Cursor and other supported hosts
What else it keeps Facts and events for answering questions Reusable skills distilled from agent history

If you are building your own memory layer for a conversational product, the paper is the better starting point. Its prompts are tested on two public benchmarks, and the appendix gives you what you need to reimplement it. memU fits if your agents are coding agents, which neither benchmark tested, and you want them to share one memory.

To try the hosted version, get an API key from memu.so and send your agent one message:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is YOUR_MEMU_API_KEY.

The self-hosted setup and the per-host support matrix are in the memU GitHub repository. More on the design is at memu.pro. For a managed alternative on another platform, see our post on Databricks Agent Memory.

FAQ

What is the LoCoMo benchmark?

LoCoMo is a 2024 benchmark of very long conversations, averaging about 300 turns over up to 35 sessions. The Microsoft paper reports its question-answering set, scored by an LLM judge over four question types.

What is LongMemEval-S?

LongMemEval-S is the standard version of LongMemEval, a 500-question ICLR 2025 benchmark. Each question sits in a chat history of about 115,000 tokens and roughly 40 sessions, so a system must find the right facts across many sessions.

What is agent memory consolidation?

Consolidation is a periodic pass that groups similar memories and merges or deletes them, so the store stops growing without limit. In this paper it cut the store by 16.34% and lowered the LoCoMo score by about one point.

Is the code for this Microsoft memory paper available?

The paper and its arXiv page link no code as of November 2, 2026. The appendix includes both curation prompts and the clustering settings.

Does hybrid memory beat full context?

It depends on the model. With gpt-4o-mini it scored 83.5% on LoCoMo against 79.0% for full context. With gpt-4.1-mini it scored 90.2% against 91.3%, using far fewer tokens by the authors' count. All of these scores are author-reported.