Back to all articles
NewsDecember 4, 2026·10 min read

AI Agent Memory - Why Summary Notes Matched Full History but Lost the Count (2026)

You're building an agent that should remember a user from one session to the next: the package manager their repo uses, the branch they never push to, the staging host they mentioned once three weeks ago. The obvious move is to replay every past message. It works, until each request carries the whole history and the bill and latency grow with every session.

On December 4, OpenRouter published a test of exactly this choice, titled "Agent Memory: 4 Designs Tested Across 12 Sessions". It opens with a premise: "A model doesn't remember anything between API calls." What makes the post useful is that it compares the common designs on the same sessions, with the same questions, on three models, and reports where each one failed.

The short answer: summary notes, retrieval, and notes plus retrieval each scored 47 of 48 on recall questions, and full history scored 46 of 48 "while sending about 150 times as many tokens per request as summary notes". Every design got stable facts and updates right. The weak spot was counting events across sessions, and a structured JSON event log made it worse. OpenRouter's advice: start with summary notes, add retrieval for exact details, and keep counts in a database the agent can query.

This guide covers the four designs, how the test was set up, what the results show, why counts broke, what the test doesn't settle, how the findings map to memory features you already use, and how to apply them.

What OpenRouter means by agent memory

The post defines agent memory as "the information your application saves from earlier conversations and adds to new prompts, so an AI agent can use what it learned in past sessions".

It separates two problems:

  • Short-term memory is the current session's transcript, sent with each request.
  • Long-term memory is what your application stores when a session ends and puts back into later prompts.

It also separates memory from compaction. Shrinking an active transcript during a long task is a different problem. "This article is about carrying facts from session 1 into session 13 without resending every line of code written in between."

The four designs

OpenRouter says most applications use one of four designs:

DesignWhat it sendsWhen the work happens
Full historyEvery past message, every requestNothing between sessions; the prompt grows
Summary notesA short memory file in the system promptA model rewrites the file after each session
RetrievalThe closest few past messages for each questionMessages are embedded as they arrive
Notes plus retrievalBoth the notes file and retrieved messagesBoth of the above

Source: OpenRouter, December 4, 2026.

One distinction matters for the results. Retrieval sends original messages, so it "keeps exact strings, like a hostname or a date, that a summary might drop".

How the test was set up

OpenRouter wrote 12 synthetic sessions between a developer and a coding assistant, in two versions from two random seeds. Each version came to 95,000 to 130,000 tokens, depending on the tokenizer. Every session had 24 ordinary coding exchanges, with 19 facts, updates, and distractors planted at fixed points.

The facts included:

  • A stable preference: "we use pnpm in this repo, never npm or yarn."
  • A repo rule: "never push directly to main, always open a PR against develop."
  • A one-time detail: a staging database host and port.
  • Two updates: tests moved from Jest to Vitest in session 3, and the user moved from Lisbon to Berlin in session 7.
  • A launch date, and three staging deploy failures in sessions 1, 3, and 9, all from an out-of-memory error in the build step.

The distractors were deliberately similar: a production database host, a teammate in Lisbon, an earlier launch date, an old Jest config, a production deploy failure, and two successful staging deploys.

In session 13, the agent got 8 questions with exact answers, each worded differently from the fact it tested. The runs used Claude Haiku 5.5, GPT-6 Luna, and DeepSeek V4.1 Flash, plus a no-memory baseline. Code scored 48 answers per design by exact match.

What the results show

DesignCorrectMedian prompt tokens
No memory0 of 48261
Full history46 of 4897,341
Summary notes47 of 48639
Retrieval47 of 48785
Notes plus retrieval47 of 481,163

Source: OpenRouter, December 4, 2026. Times and costs in the original post depend on its setup.

Three findings stand out.

Accuracy was close; prompt size was not. OpenRouter says it directly: "a one-point gap between 46 and 47 is noise. The real difference is prompt size."

The basics held in every design. "Every memory design got the stable preference, both updates, the staging host, the launch date, and the cause of the failures right in every run." Outdated facts weren't a problem when the notes writer was told to replace them.

Full history's cost grows with each session. OpenRouter's cost table lists it as the only design that "Grows every session". On one model, the history crossed a token threshold where the input price rises, and full history was the only design that crossed it.

Why the count broke

The question "How many times has the staging deploy failed, not counting production?" was the hardest. Across all memory runs, it was right 22 times out of 30.

The failures came in two kinds:

  • Mixing up similar events. With full history, two models answered 4 on one seed "because they counted the production failure even though the question said not to". Retrieval made the same mistake once.
  • Dropping the number. In one summary-notes run, the model answered "unknown". Its notes read "Staging builds have had reported OOM failures", with no number. OpenRouter's comment: "It kept the event and lost the count."

Notes plus retrieval was the only design that got the count right in all six runs.

The structured log made it worse

OpenRouter tried a sixth design: a JSON memory file with facts, rules, and an append-only list of events. It scored 43 of 48. The count was right in 2 of 6 runs, the event logs grew to between 24 and 79 entries, and the models "logged the same kind of failure differently from one session to the next". Each request also got bigger.

The conclusion is direct: "A model that summarizes or logs events will sometimes miss one or count one twice." For anything that needs counting or totaling, such as failed deploys or support tickets, OpenRouter recommends recording events "from your own code in a database table" and giving the agent a tool that queries it.

What the test doesn't settle

The post is careful about its limits, and they matter before you copy the design.

  • Synthetic sessions. The 12 sessions were written for the test, not taken from real users.
  • Small sample. With 48 answers per design, OpenRouter itself treats a one-point gap as noise.
  • One kind of workload. The sessions are a developer working with a coding assistant. Other domains may plant facts differently.
  • Untested split. OpenRouter suggests a smaller model could write notes for a larger agent model, but says "We didn't test the split setup".
  • Word limits drift. The notes instruction said under 250 words; "the files ran from 170 to 340".

How this maps to memory you already use

The test is about apps you build, but the same pieces show up in assistants you use every day, as their vendors document them.

Claude saves memory "as a set of individual topics as you chat, rather than summarizing conversations after they end", and on paid plans it can also search past chats. Anthropic says those searches "use Retrieval-Augmented Generation (RAG)". That's a notes-style store alongside retrieval over past conversations.

Claude Code keeps an auto memory with a MEMORY.md index. The first 200 lines or 25KB load at the start of a session, and topic files are read on demand. That's a notes file with a size cap.

OpenRouter's test didn't cover these products, so the results don't transfer directly. The lesson that does transfer: notes can keep an event and lose its number. If a count matters to you, write the number down yourself.

For the broader difference between memory and retrieval, see AI memory vs RAG.

What people try first

Replaying the whole history. It scored about the same while sending far more tokens.

Asking the summarizer to keep counts. In the test, a model kept the event and dropped the number.

Switching to a structured JSON log. It scored lower and made requests bigger.

Trusting retrieval with counting questions. Retrieval also counted the wrong failure once.

Skipping update instructions. The test told the notes writer to replace changed facts, and every model handled both updates.

The Fix: Build memory the way the test suggests

Step 1: Start with summary notes

Have a model rewrite a short memory file after each session, and tell it to replace outdated facts.

Step 2: Cap and check the notes

Set a word limit and measure it, since the test's files drifted past theirs.

Step 3: Add retrieval for exact details

Embed past messages and label each with its session number or date, so the model can pick the newest value.

Step 4: Keep counts in code

Log countable events from your app into a database table and give the agent a query tool.

Setting this up in MemoryLake

OpenRouter's test is about what an app should store between sessions. If you work across several assistants rather than one app, the same question applies to you: which facts should carry from one session to the next, and who keeps them current.

MemoryLake is a memory layer for that context, kept in one place you maintain and available to the assistants you connect, such as ChatGPT, Claude, Claude Code, and Codex.

You write the entries yourself. Nothing is read out of, written to, or deleted from your chats, Claude's memory, ChatGPT's memory, Claude Code's auto memory, or any vendor's store. Each assistant's memory works the way its vendor describes it.

Step 1: Create an API key

Sign in and generate a key from the dashboard. Keep it somewhere private.

The MemoryLake console showing the API keys screen, where a new key is created and copied for use in an agent
The MemoryLake console showing the API keys screen, where a new key is created and copied for use in an agent

Step 2: Upload your first memories

Start with the kinds of facts the test planted: stable preferences, repo rules, one-time details, and the current value of anything that changed.

The MemoryLake workspace with the first documents uploaded, listing each file as it becomes searchable memory
The MemoryLake workspace with the first documents uploaded, listing each file as it becomes searchable memory

Step 3: Connect your AI & agents

Connect the assistants you use, so the same facts are there in each new session.

The MemoryLake integrations screen listing the AI clients and agent frameworks that can be connected to the memory layer
The MemoryLake integrations screen listing the AI clients and agent frameworks that can be connected to the memory layer

What this changes in practice

The first difference is shorter prompts. A curated set of facts replaces replaying old conversations.

The second is fewer stale answers. When you replace a changed fact yourself, the old value doesn't linger next to the new one.

The third is honest counts. Numbers you track yourself don't depend on a summarizer keeping them.

Best practices for agent memory

Write facts as current values. Replace, don't append, when something changes.

Label anything retrieved with a date or session. It lets the model choose the newest value.

Keep counts and totals in a database. Query them with a tool.

Test with your own sessions. Plant updates, distractors, and counts, and score by exact match.

Separate run state from memory. OpenRouter's post treats saving one run's state and carrying facts across sessions as different jobs.

Watch prompt size as sessions add up. Full history grows; notes stay about the same size.

Conclusion

OpenRouter's test gives builders a clear starting point. Summary notes, retrieval, and their combination recalled facts as well as full history while sending a fraction of the tokens. Every design kept stable facts and updates when told to replace outdated values.

Counting events across sessions was the weak spot, and a structured log didn't fix it. The practical rule is to let memory hold facts and let your own code hold counts.

Frequently asked questions

What is agent memory?

OpenRouter defines it as information your application saves from earlier conversations and adds to new prompts, so an agent can use what it learned before.

Is summary-notes memory as good as full history?

In OpenRouter's test, summary notes scored 47 of 48 and full history 46 of 48, a gap the post calls noise. Summary notes sent far fewer tokens.

Is agent memory the same as RAG?

No. OpenRouter describes RAG as one way to build agent memory; summary notes are another.

Why do AI agents get counts wrong?

They mix up similar events in long transcripts or drop the number when summarizing. In the test, the count question was right 22 times out of 30.

Does a bigger context window replace memory?

Not on its own. Full history works while it fits, but every past token is sent on every request.

How do I stop an agent remembering outdated facts?

Tell the notes writer to replace changed facts, and label retrieved messages with a session number or date.

Which models did OpenRouter test?

Claude Haiku 5.5, GPT-6 Luna, and DeepSeek V4.1 Flash, with low reasoning effort.