On day one, the support agent is a delight. It greets the customer by name, remembers the order from last week and answers in two seconds. On day thirty, it recommends a pharmacy in the city the customer left in June, takes six seconds to answer, and the monthly invoice has grown a hockey stick nobody budgeted for.

Nothing broke. The agent just ran into the two problems almost every agent hits: it forgets or misremembers what it should know, and every turn costs more than the one before. They look like one problem. They aren't, and treating them as one is how teams end up buying the wrong tool.

This post separates them, shows the cost curve you're actually paying for, and gives you a small test to run before you choose a memory layer. It builds on Google's AI Agent Clinic episode on agent memory, which compares four memory options and three context fixes. Read it for the ADK implementation. This piece adds the cost math, a way to test any memory layer, and the failure modes that tend to show up later.

Two Problems That Look Like One

Both start in the same place: how much of the conversation you send to the model, and what you keep between sessions. But they need different fixes:

  1. Forgetting is a correctness problem. The agent doesn't know something it should, or it knows an old version of a fact.

  2. Slowing down is a cost problem. If you resend the whole conversation every turn, each turn is bigger than the last.

A useful way to hold both is to think of three clocks: the turn clock (what this single call needs), the session clock (what this conversation needs) and the lifetime clock (what this user needs next month). Each clock has its own tool.

The Cost Curve You're Paying For

If every turn resends the full history, total tokens grow with the square of the number of turns, because turn t carries t turns of history. Here's an illustration with assumed numbers: 500 tokens of system prompt and tool schemas that go out with every call, and 150 new tokens added each turn. Compare four strategies:

  • Flat: resend the whole conversation every turn.
  • Window: send only the last six turns.
  • Summary: send a 200-token summary of everything older, plus the last two turns.
  • Memory: send 100 tokens of recalled long-term facts, plus the last two turns.

I ran the numbers over a 50-turn conversation. By turn 50, the flat strategy sends 8,000 tokens in a single call, against 1,400 for the window, 1,000 for the summary and 900 for memory. Across all 50 turns, the totals come to 216,250 tokens for flat, 67,750 for the window, 49,450 for the summary and 44,850 for memory.

These figures are assumptions, not benchmarks, and they leave out the cost of producing summaries and extracting facts, which is real. The shape is the point: the flat strategy grows without limit, while the other three level off after a few turns. Plug in your own numbers and see where your curve bends.

The Three Context Fixes (One Per Clock)

1. Turn clock: a rolling window. Don't give every component the whole transcript. In Google's demo, a voice agent that receives new text every two seconds feeds its intent classifier only the last 40 words, which used about 86% fewer classifier tokens on one short test conversation. That's one demo, not a benchmark, and 40 words is a starting value for speech, not a rule.

The failure mode is intent that started before the window. A cheap classifier is rarely the problem. A missed context is. The fix is to log every low-confidence call next to the full transcript and tune the window on real misses instead of a guess.

2. Session clock: a rolling summary. A running summary replaces everything said so far. In the demo it came to 92 tokens. Its weakness is subtle: a summary is lossy compaction of facts you didn't know were facts. "Prefers window seats" and "is anxious about flying" compress identically, and corrections like "I moved" quietly drop out.

Three habits help. Keep standing rules in a separate pinned file that's read every session and never summarised. Summarise into a fixed shape (decisions, constraints, open questions) so important categories can't vanish. And test whether your summary and your long-term memory ever disagree about the current fact.

3. Lifetime clock: durable memory. Store extracted facts, not transcripts. In the demo, the memory service stored about 24 tokens of facts where ingesting the whole conversation would have taken about 1,400. This is the layer that answers across sessions.

A fourth fix is free: **separate conversation history from execution state. **Raw tool output and verbose tool schemas eat budget quickly. Keep a compact, typed state object, strip tool schemas the agent isn't going to call, and trim tool results before they re-enter the prompt.

Four Memory Options, One Question

Google's episode compares four options. Here they are, with the question that separates them: what does each one hand the model when the user asks something?

  • Flat prompting hands over the full chat history. Easy to build, but the cost curve above is yours.
  • Vector RAG **hands over every chunk that matches, old and new. It saves tokens, but similarity doesn't say which fact is current. - A knowledge graph** hands over the current fact, because relationships can be updated. You build the extraction, schemas and update logic. -** A managed memory service **also hands over the current fact, and does extraction, deduplication and updates in the background.

The sentence worth remembering, which one commenter on the original post phrased well: RAG answers "what's similar", memory answers "what's current". RAG is still the right tool for searching a knowledge base. Memory is a different job: keeping facts about a user true as they change.

The Four-Probe Test: Run It Before You Pick a Tool

Google's test is a good minimal case: a user says "I'm in New York", later "I moved to San Francisco", then asks "Where do I live now?" It checks one thing, that the newest value wins. Commenters on the original post suggested extra probes (history and future-dated facts) that catch stores that pass for the wrong reason. Add a forget probe and you have four:

1. Current fact: after the move, "Where do I live now?" should return San Francisco.
2. History: **"Where did I live before San Francisco?" should return New York. A store that overwrote the old fact has nothing to say.
**3. Future-dated fact:
"I'm moving to Seattle in March" must not change the answer today. It tests the difference between when a fact was said and when it becomes true.
*4. Forget: *"Forget that I lived in New York" must remove it everywhere.

To see what each data model can and can't answer, I ran the four probes against three toy stores. These are plain data structures, not an LLM, so the test measures the model of memory, not the model. The first store, overwrite, keeps one value per fact and lets the latest statement win. The second, append-only, keeps everything and returns every match, which is what retrieval looks like when it has no notion of "current". The third, temporal, records for each fact both when it was said and when it becomes true.

The results: overwrite passed 2 of 4 (current fact and forget, but not history or future-dated). Append-only passed 1 of 4 (only forget). Temporal passed all four. Overwrite passes the famous test and fails the next two, and append-only fails even the first. Only a store where facts carry the date they become true handles all four.

When you evaluate a real memory layer, write these probes as a short script against your actual agent, and re-run it after every change to extraction or summarising.

One caution about the forget probe: in the toy stores it passes almost everywhere, because there's only one place to delete from. In a real agent, a fact can also live in a rolling summary, an embedding index and a log. Forgetting has to reach all of them.

Memory Is Also an Attack Surface and a Liability

Once an agent can write to long-term memory, memory becomes something to defend and govern:

-** Write policy: decide what may be stored, by whom and from what. Anything the agent reads, such as a web page or an email, can try to write a false "fact" into memory.
-
Provenance: **store where each fact came from and when, so a wrong fact can be traced and corrected.

  • Correction path: make wrong facts fixable. If a bad extraction can win until someone notices, it will. - Visible and editable: *let users see and delete what's remembered. *- Retention: set an expiry for facts that shouldn't live forever, and check deletion requests against the legal advice you've been given.

It also helps to keep two stores apart in your head. What your model vendor retains is one question, which we covered in what "zero data retention" actually means. What your own memory layer retains is a separate store that you're responsible for.

Memory Checklist

  • You can say, for each piece of context, which clock it belongs to: turn, session or lifetime
  • Total tokens per conversation are measured, not guessed, and the curve is plotted
  • Components get the smallest context they need, not the full transcript
  • Low-confidence calls are logged next to the full transcript, and window sizes are tuned on real misses
  • Standing rules live outside the rolling summary
  • Summaries use a fixed shape and are tested against long-term memory for disagreements
  • Raw tool output and unused tool schemas are kept out of the prompt
  • The four probes (current, history, future-dated, forget) run against the real agent after every memory change
  • Facts carry a source and a date they became true
  • Users can see, correct and delete what's remembered
  • Deletion reaches summaries, embeddings and logs

Quick FAQ

Do I need a vector database for agent memory? Not necessarily. A vector database is good at finding similar text, which suits a knowledge base. Memory of user facts needs something that knows which fact is current. Some memory layers use embeddings underneath, but similarity alone doesn't give you currency.

Isn't a bigger context window the fix? It postpones the problem and raises the bill, since you pay for everything you send. It also doesn't tell the model which of two conflicting facts is current.

How long should the rolling window be? Start from your use case and tune on real misses. Google's 40 words is a value from a speech demo, not a recommendation.

**What about the right to be forgotten? **Treat deletion as a feature to design and test, covering the fact store, summaries, embeddings and logs. For legal requirements, take advice from your own counsel.

Final Thoughts

The useful reframe is that memory isn't a feature you bolt on. It's three small data-modelling decisions, one per clock, plus a test that keeps you honest. Teams that skip the test usually discover the gaps in production, one confused customer at a time.

If you'd like help designing memory for an agent, Kilowott's Kilowott Intelligence team reviews how AI tools are connected and governed, including what they store and for how long. You can also browse their case studies or get in touch.

What's the probe that broke your agent's memory first? Tell us in the comments.

Source and further reading: Why Your AI Agent Keeps Forgetting (and Getting Slower): 4 Memory Options and 3 Context Fixes by Frank Guan on the Google AI organization, and the AI Agent Clinic episode. The demo figures quoted above come from that episode and are from one demo, not benchmarks.