Agent Memory on LoCoMo: Nearly as Accurate as the Full History, With 12× Fewer Tokens
Murtaza Shajapurwala ·
An assistant that talks to the same person for weeks has to decide what to put in front of the model on each turn. The simplest answer is everything: paste the whole history into the prompt. It works until the history is long, and then every question pays for tens of thousands of tokens. The alternative is memory: store what was said, and retrieve only what is relevant to the question.
We measured the trade-off on LoCoMo, a benchmark built for exactly this: ten conversations, each running for weeks across 19 to 32 sessions, and 1,540 questions about what was said. With the same model, prompt and grading both ways:
| Context given to the model | Correct | Prompt tokens per question |
|---|---|---|
| The full conversation history | 65.8% | 32,024 |
| 50 memories retrieved from KiviDB | 62.3% | 2,708 |
| 20 memories retrieved from KiviDB | 51.9% | 1,184 |
Fifty retrieved memories came within 3.5 points of the full history with 12 times fewer tokens, and on questions about when something happened, memory scored higher than the full history.
How we ran it
Storing. Every one of the 5,882 messages became one memory in a KiviDB agent-memory store on a free database, written as [session date] Speaker: text so the date travels with the words. Images shared in the chat are represented by their captions, as LoCoMo provides them. Each conversation is its own actor, so a search only sees that conversation's memories. We computed the vectors ourselves with BAAI/bge-small-en-v1.5 on a laptop (85 seconds for every message and question) and sent them with each memory; loading all 5,882 took 167 seconds.
PUT /instances/{db}/agent-memory/locomo
{ "embed_provider": "none", "llm_provider": "none", "dimensions": 384,
"dedupe_threshold": 1.0, "redact_pii": false }
POST /instances/{db}/agent-memory/locomo/memories
{ "text": "[1:56 pm on 8 May, 2023] Caroline: I went to a LGBTQ support group yesterday and it was so powerful.",
"type": "episodic", "actor_id": "conv-26", "vector": [ ... ] }
Retrieving. For each question, a hybrid search of the store (by meaning and by words, fused), filtered to the conversation, returning the top 20 or the top 50:
POST /instances/{db}/agent-memory/locomo/memories/search
{ "query": "When did Caroline go to the LGBTQ support group?",
"vector": [ ... ], "mode": "hybrid", "actor_id": "conv-26", "limit": 50 }
Answering. Amazon Nova Lite on Bedrock, temperature 0, with the same instructions both ways: answer in a short phrase, and work out relative times such as "yesterday" from the date of the message that mentions them.
Grading. Amazon Nova Pro compared each answer with LoCoMo's gold answer, counting it correct when it means the same thing or names the same date in another format. LoCoMo's fifth category, questions with no answer in the conversation, is left out, as published evaluations usually do.
Where memory wins and where it loses

| Question kind | Memory, top 20 | Memory, top 50 | Full history |
|---|---|---|---|
| Single-hop (841) | 62.5% | 72.9% | 81.6% |
| Multi-hop (282) | 32.6% | 46.5% | 51.1% |
| Temporal (321) | 46.4% | 55.1% | 45.5% |
| Open-domain (96) | 33.3% | 39.6% | 39.6% |
| All (1,540) | 51.9% | 62.3% | 65.8% |
How much you retrieve matters. Going from 20 memories to 50 raised accuracy by more than ten points. The reason is visible in recall: LoCoMo marks which messages are the evidence for each answer, and the top 20 contained 60% of them; the top 50 contained 71%.
Dates belong in the memory. On temporal questions, retrieval beat the full history. In a 13,000-word transcript, the date of a session sits many lines above the sentence that needs it, and the model has to connect them. A memory carries its date in the same line.
Multi-hop is the gap. Questions that join facts from several sessions lost the most. Storing raw messages is the simplest form of memory. Extracting facts and summaries with a model, which a KiviDB agent-memory store can do when an extraction model is configured, is the obvious next step, and one we have not measured here.
What each answer costs

At Nova Lite's on-demand list price, 1,000 questions cost about $0.07 with 20 memories, $0.17 with 50, and $1.93 with the full history, in model input and output. A larger model raises all three in proportion, so the ratio is what carries over. The whole study, including grading, cost under $4 in model calls.
The memory search itself took 33 ms at the median and 100 ms at the 95th percentile for the top 50, measured inside the KiviDB Cloud API in the database's region: a hybrid search over 5,882 memories, filtered to one conversation, on a free-tier database.
What this does not show
These numbers are not comparable with LoCoMo results published elsewhere, which use other answer models, judges and prompts. The comparison that holds is the one on this page: the same model, prompt and judge, with and without memory. A stronger model would raise every row.
Repeat it
LoCoMo is public from Snap Research, the embedding model is on Hugging Face, and the requests above are the ones we sent. A free KiviDB Cloud database holds an agent-memory store; set embed_provider to none to send your own vectors, or to openai or an OpenAI-compatible endpoint to have the store embed for you. The full method and every figure are on the case study page.
LoCoMo: Maharana et al., 2024. We report scores only and do not republish the conversations.