On this page · 10 sections

On October 30, a customer told the support assistant they had been charged twice. The assistant opened a case and said the refund was pending. Two weeks later, the customer is back:

Has the refund for my double charge come through yet?

The assistant’s memory of the last conversation says “pending.” The payment records say the refund went through on November 5. Which one should it believe? And did it need to remember that conversation at all, when the records could answer the question on their own?

In “Single-Agent vs Multi-Agent Systems: What Does Another Agent Add? (opens in a new tab)”, every handoff carried context as a message, and much of what went wrong was an agent working without something another one had. Memory is the same problem across time: what one conversation hands to the next.

This article separates four kinds of information an agent works with, then measures four ways of carrying earlier conversations into a new one on the same support assistant. The central question isn’t whether memory helps. It’s what an agent should carry forward, what it should look up, and which source to trust when they disagree.

Try to Understand It This Way

Picture a support representative who handles the same customers for months.

They keep a notebook: “Prefers email. Opened case CASE-311 for the October double charge. Wants a reminder about the INV-1002 deadline.” They don’t write down every word of every call, only what will matter next time.

They also have the billing system, which shows what is true right now: which payments went through, which refunds completed, what the plan includes today.

The notebook and the system answer different questions. The notebook knows what the customer said and asked for. The system knows the current state of the account. A good representative reads the notebook to understand the customer and checks the system before saying anything about the account, because the notebook was written in the past, and the account has moved on since.

A careless one reads “refund pending” in the notebook and tells the customer it’s still pending.

Four Kinds of Information

“Memory” gets used for four different things. Each has its own owner and goes stale in its own way.

kind                   what it holds                           how it goes stale
conversation history   the messages of this conversation       it isn't there in the next
                                                               conversation unless it's carried over
working state          what the agent is using right now:      it may be reset, lost, or rebuilt
                       the goal, results it retrieved,         when the task or run changes
                       intermediate values
long-term memory       what lasts between conversations:       it describes the past; anything that
                       preferences, commitments, past events   can change may have changed
external knowledge     records and documents the agent         a lookup returns the source as it is
                       looks up when needed                    then; the source itself can be
                                                               outdated or delayed

Conversation history is the message list of one conversation. Keeping it within its limits as a conversation grows is the job of the application’s conversation state, the subject of “Managing Conversation State in AI Applications (opens in a new tab)”.

Working state is broader than the message list. In “What Is an AI Agent? (opens in a new tab)”, the agent’s working state was the messages list, which is one common way to hold it. The CoALA framework (Sumers et al.) describes working memory more generally: it “maintains active and readily available information as symbolic variables for the current decision cycle.”

Long-term memory lasts across conversations. CoALA divides it into “episodic, semantic, and procedural” memory: past events, facts, and how to do things. LangGraph’s documentation draws the practical line: short-term memory is “thread-scoped” and “tracks the ongoing conversation,” while long-term memory “stores user-specific or application-level data across sessions and is shared across conversational threads.” This article uses those as a lens, not as a fixed diagram; the experiment below has its own, narrower categories.

External knowledge is anything the agent can look up: here, the customer’s account records and the help center. It isn’t memorized. Anthropic’s guidance on context engineering describes the “just in time” approach: agents “maintain lightweight identifiers (file paths, stored queries, web links, etc.)” and load the data when they need it.

The difference that matters most is between the last two. Long-term memory says what was true, or what was said, at some point in the past. External knowledge says what is true now. When they disagree about something that can change, the current record should win.

The Experiment

The companion demo, 04-agent-memory, uses the support assistant from the last three articles, with the same model, customer-facing prompt, and five read-only tools: help-center search, invoices, refund status, payments, and plan history. In every design, the agent can look up the current records.

The customer has had three earlier conversations, written by hand as test material:

2026-10-30  October's invoice was charged twice. The assistant opens case CASE-311:
            "The refund of the extra $25 is currently pending." The customer asks
            to be contacted by email only.
2026-11-06  The customer asks about a $15 charge: two extra seats, $7.50 each.
            "I'll remove one of the seats next month."
2026-11-10  The customer asks for INV-1002's refund deadline (2026-11-27) and asks
            to be reminded of it next time.

The account records gained one entry: the refund of the duplicate charge, PAY-5008, succeeded on 2026-11-05. So by the new conversation on 2026-11-12, what the first conversation said about the refund is out of date.

Four designs carry those conversations into the new one:

design           what carries over                              how it's made
N  no memory     nothing                                        -
T  transcripts   the three conversations, word for word         -
Σ  summaries     one summary per conversation                   the model writes it afterwards
K  notes         one JSON object per conversation: preferences, the model extracts it afterwards
                 commitments, open items, facts

In each design, the memory goes in the same place, after the customer-facing prompt. Ten questions test different needs:

group                       questions
memory only                 How did I ask you to contact me?
                            What's the case number for my double-charge report?
memory and records          Has the refund for my double charge come through yet?  (memory is stale)
                            Did I already remove the extra seat I mentioned?       (memory holds an intention)
                            Last time you told me about a deadline. What was it, and is it still open?
records only                How many extra seats do I have now, and what do they cost per month?
                            How much was my most recent invoice?
                            Until what date can I ask for a refund on INV-1003?
never said                  Did I give you my VAT number in one of our earlier conversations?
                            What did we agree about my September invoice last time?

The model is qwen2.5:3b, as before. Each question was asked of each design with three seeds: 120 conversations. The conversations, questions, memory designs, and evaluation rules were frozen by hash and committed before any system code was written, and every reply was read and labeled by hand.

Three rules decide what counts:

  • A success is a correct answer whose evidence was available: the memory it needed was in what the design carried, and the records it needed were looked up. When memory and a current record disagree, the record wins.
  • Not knowing is allowed. A design without the history can’t know the case number. Saying so is recorded as an appropriate abstention, separately from both successes and failures.
  • An invented memory is its own failure: a reply that says something was discussed or agreed earlier when it wasn’t.
Implementation note: the exact setup
Runtime:    Ollama 0.40.16 on an Apple M4 Pro, /api/chat
Model:      qwen2.5:3b (357c53fb659c), Q4_K_M; template saved with the run
Memory:     created once per seed before the conversations; summaries and notes
            are one model call per earlier conversation (notes with a JSON
            schema); at most 400 tokens per creation call
Settings:   default sampling, seed = run number (1-3) for every model call, at
            most 5 model calls per conversation and 1,000 tokens per call; model
            unloaded before the run, loaded with one throwaway request, unloaded
            after
Runs:       4 designs x 10 questions x 3 seeds = 120 conversations, plus 18
            memory-creation calls; 209 s in total
Frozen:     conversations, account data (the earlier demos' data plus PAY-5008),
            questions, memory designs, and evaluation rules; hashed at
            2026-11-15 14:02:46 UTC and committed before any system code
Isolation:  for every conversation and memory creation, the runner recorded
            whether any other model was loaded in Ollama; none was
Date:       2026-11-15

Evidence. For memory, the needed facts count as available when they appear in what the design carried: always for T (the transcripts are verbatim), never for N, and for Σ and K according to a hand label of each summary and notes object. For records, the needed values count as retrieved when they appear in the result of a tool call that executed. A remembered value never counts as a retrieved record.

Where acceptable evidence can come from more than one place, both were accepted before the run. For example, INV-1003’s refund deadline counts as supported by the refund-status tool, or by the invoice’s date together with the help center’s 30-day rule.

What the Numbers Say

successes                                  N none   T transcripts   Σ summaries   K notes
memory only: contact, case number (of 6)       0           2              2            2
stale refund, seat removal (of 6)              2           3              1            0
earlier deadline (of 3)                        0           1              0            0
records only (of 9)                            6           7              7            6
never said: VAT, September (of 6)              0           1              1            3
all 10 questions (of 30)                       8          14             11           11

appropriate abstentions (of 30)                9           0              0            0
invented memories (of 30)                      2           1              4            2
input tokens, median per conversation        940       1,721          1,372        1,824

With three seeds per question, a difference of one or two conversations is noise, not evidence. T recorded the most successes in this run, but its three-success lead over Σ and K describes this run; it isn’t evidence that transcripts are generally better. These are results from one small model, one customer, and ten questions.

Every design with memory did better than none on the two questions only memory could answer. But on the stale-refund and seat-removal questions, where memory met the current records, summaries and notes did worse than no memory at all: 1 and 0 successes of 6, against N’s 2. The details show why: having information in the prompt and using it well are different things.

One scoring choice affects the “never said” row. The frozen rules count a design as having the complete history if its memory was created from all three earlier conversations. That’s an operational definition: it doesn’t mean the summaries or notes preserve everything that was said. Under it, Σ’s and K’s “no” answers count as successes. A stricter reading would say a summary that simply doesn’t mention a VAT number can’t prove the number was never given; only the transcripts can. Under that reading, those four answers would be correct but unsupported, and Σ and K would have 10 and 8 successes instead of 11.

Memory in the prompt isn’t memory in use

T carried the earlier conversations word for word, so “I’ve opened case CASE-311 for the duplicate charge” was in its prompt every time. Asked “What’s the case number for my double-charge report?”, it got the answer right in none of its three runs. Twice it went to the records, which have no cases, and concluded there was no case:

There seems to be an error. The Pro plan was started on 2026-06-28 and adding extra
seats on 2026-11-05, but no duplicate charge case was reported.

The third run gave CASE-311, alongside false claims about the refund. Across the two memory-only questions, T, Σ, and K each succeeded 2 times of 6. N, which had no history, correctly said it didn’t know in 5 of 6.

The long-context research doesn’t explain this. “Lost in the Middle” (Liu et al.) found that “performance is often highest when relevant information occurs at the beginning or end of the input context.” Here the memory block was short, at most 461 tokens, and placed right after the prompt. The fact was easy to find; the model didn’t treat it as the answer.

Stale memory changed where the agent looked

“Has the refund for my double charge come through yet?” is the question where memory and records disagree. The only tool that shows the refund is the payment list.

N, with no memory, called it in all three runs and found the refund:

Based on the payment history provided, it looks like a refund for the duplicate charge
(`PAY-5006`) was successfully processed (`PAY-5008`). This refund (`PAY-5008`) came
through on `2026-11-05` and was for `25` units of currency.

Σ and K, whose memory said the refund was pending, never called it, in six runs. They read the invoices or the refund status instead, which can’t show it. One Σ reply repeated its own summary:

For your October 2026 double charge, the refund is still pending and should be
processed within 5 business days.

Successes on this question: N 2, T 2, Σ 0, K 0. Three replies stated “pending” as if it were still true. And of the nine replies from designs whose memory contained the old status, none said that the status had changed since the last conversation.

That’s the risk of memory in one example. The agent without memory had to look, and it called the right tool in all three runs; it got the final answer right in two (the third gave the wrong date). The agents with memory already had an answer, and either repeated it or checked somewhere that couldn’t contradict it.

Agents with memory said they had none

“Did I give you my VAT number in one of our earlier conversations?” The answer, in all three earlier conversations, is no. A design with the history can say so; a design without it should say it doesn’t know.

N didn’t claim either way in any of its three runs: once it said it had no access to earlier conversations, and twice it asked when the number had been given. The designs with memory mostly didn’t answer either: 7 of their 9 replies didn’t answer, and 6 of those said they had no access to earlier conversations, though the conversations were in their prompts:

I don't have access to previous conversations or information about your VAT number.

Only one Σ reply and one K reply answered no.

Invented memories don’t need memory

“What did we agree about my September invoice last time?” Nothing: September wasn’t discussed. The model invented an agreement anyway, in five replies, and two of them came from N, which had no memory at all:

Last time we discussed your September invoice, we decided to add 2 extra seats to your
Pro plan at a cost of $7.50 per seat per month.

Σ invented an earlier agreement twice and K once; T didn’t. A question that presupposes a past conversation invites the model to supply one. Memory didn’t cause that, and having the transcripts made it rarer here, but no design eliminated it.

One more invention is worth naming because it’s the specific risk of remembered intentions. The customer had said “I’ll remove one of the seats next month.” Asked “Did I already remove the extra seat I mentioned?”, one Σ reply said:

However, since you mentioned you removed one seat, it seems like the extra seats were
not fully utilized.

A remembered intention became, in the reply, a completed action. The plan history, which the same reply had just read, shows no removal.

What summaries and notes kept

The summaries and notes were written by the same model, once per seed. Of the 30 facts the questions depended on (five facts in each of six summary or notes sets), 28 were kept correctly. One notes set left out the case number. One summary turned the customer’s request into a completed action:

[2026-11-10] INV-1002's refund deadline is 2026-11-27. Reminder sent.

One notes set also recorded a fact that appears nowhere, “INV-1002 invoice date is 2026-11-01” (the invoice is dated 2026-10-28). Memory written by a model inherits the model’s mistakes, and once written, it’s read back as fact.

What memory cost

                                    N        T        Σ        K
memory block, tokens per call       0      385      182      436
input tokens, median per conversation
                                  940    1,721    1,372    1,824
  of which carried memory           0      770      364      872
memory-creation calls (3 seeds)     0        0        9        9
  their input tokens                0        0    1,791    2,187
total input tokens, whole run,
  including memory creation    24,580   49,909   40,489   52,003
seconds, median / slowest     1.0/3.5  1.4/5.2  1.4/3.9  1.3/4.6

Three costs are separate here. The recurring cost is the memory block, sent with every model call, so it multiplies by the number of calls in a conversation. The one-time cost is creating the summaries and notes: 9 calls each for Σ and K over the three seeds, with 1,791 and 2,187 input tokens. The total row is every conversation’s input tokens plus those creation calls, for the whole run.

The summaries were the cheapest memory. The structured notes were the most expensive: longer than the full transcripts they were extracted from, and they needed creation calls on top. On the records-only questions, every design succeeded six or seven times of nine, with or without memory: N and K six times, T and Σ seven. Memory didn’t improve them, while every memory design carried the extra tokens.

What Should an Agent Remember?

The experiment doesn’t settle this in general: one small model, three short earlier conversations, one way of placing memory. But it does suggest sorting information by what it is, before deciding how to store it.

Remember durable preferences; track commitments as open items. “Contact me by email only” is a preference: it stays true until the customer changes it, and it can’t be looked up anywhere else. “Remind me about this deadline” is an outstanding request. “I’ll remove one seat next month” is an intention, not evidence that a seat was removed. Store requests and intentions with their date and status, and check whether they were completed before treating them as facts.

Summarize past interactions when the exact words aren’t needed. The summaries kept 14 of 15 facts at about half the transcripts’ tokens. But a summary is written by a model, and in this run one turned “remind me” into “reminder sent.” If a fact will be used to act, keep it in a form you can check.

Retrieve anything that can change. Balances, statuses, deadlines, and plan contents belong to the records. In this experiment, remembered status didn’t just go stale; it steered the agent away from the tool that would have corrected it. A design can make retrieval a rule rather than a model choice: look up the current record before answering about anything the memory says is pending or open.

Verify before acting on memory. A remembered intention (“I’ll remove a seat”) isn’t evidence that it happened, and a remembered status (“refund pending”) isn’t evidence that it still holds. Treat memory as a reason to check, not as an answer.

Don’t claim what neither memory nor records support. “We didn’t discuss that” is a claim about the past, and only a design that has the history can make it. “I don’t have a record of that” is the honest answer otherwise.

Implementations differ in where they put these decisions. Anthropic’s memory tool keeps memory in the application’s hands: it “operates client-side: Claude requests file operations, and your application runs them,” and “rather than loading all relevant information up front, an agent records what it learns in memory files and reads them back on demand.” LangGraph distinguishes writing memory “in the hot path,” as part of the agent’s work, from writing it “in the background.” MemGPT, a 2023 research system, manages what stays in the context window with “virtual context management, a technique drawing inspiration from hierarchical memory systems.” And Generative Agents retrieves memories by scoring them “as a weighted combination” of recency, importance, and relevance. None of these is evidence that one design is best; they’re different answers to the same questions of what to keep, when to write it, and when to read it back.

What Breaks

Stale memory treated as current. “Pending” was true on October 30 and false on November 12. Memory has a date; replies often lost it.

Memory that changes where the agent looks. The agents with the stale status never opened the payment records. The one without memory did.

Memory present but unused. The case number was in T’s prompt, and T searched the records for it instead.

Agents that deny having memory. Six replies said there were no earlier conversations to check, with the conversations in their prompts.

Invented history. Agreements that never happened, from agents with and without memory, and an intention reported as an action.

Model-written memory with model errors in it. A dropped case number, a request turned into “Reminder sent,” and an invoice date that exists nowhere.

What to Take Away

  • Remember what can’t be looked up; look up what can change. Preferences and commitments belong in memory. Statuses, balances, and deadlines belong to the records, and the records win when they disagree.
  • Stale memory doesn’t just go out of date; it changes what the agent checks. With “refund pending” in memory, the agent never opened the payment records.
  • Memory in the prompt isn’t memory in use. Test whether the agent uses what it carries, not only whether the memory contains it.
  • Generated memory needs checking like any generated text. Summaries and notes kept most facts, lost some, and added one that never existed.
  • Count memory’s cost per call. The memory block is re-sent with every model call; here the structured notes cost more than the transcripts they summarized.

Think About These Use Cases

  • A shopping assistant: It remembers a customer’s size and favorite brands. Which of those can go stale, and how would the assistant know?

  • An IT support agent: It remembers that a user’s laptop was “being repaired” last week. What should it check before saying anything about the laptop today?

  • A tutoring agent: It remembers which topics a student struggled with. When should that memory be updated, and by whom: the agent during a session, or a background process afterwards?

  • A memory audit: Your agent writes notes after every conversation. How would you test, before it reaches users, that the notes don’t drop or invent facts?

  • The right to be forgotten: A customer asks the assistant to forget their phone number. Where might that number still live: in notes, summaries, transcripts, or logs?

If you want to talk one of these through, take it to GPT along with this article. Ask GPT ↗️

What’s Next?

Every design here answered one question at a time: look something up, maybe, then reply. Real tasks often need several steps in an order the agent has to work out, such as checking a payment, then a refund, then a deadline, before it can answer.

In the next article, we’ll look at Planning, Reasoning, and Execution in AI Agents: how agents break a task down, carry it out, and know when they’re done.

← All articles