Skip to content
Expedify
8 min

Remembering the conversation

Memory is a budget, not a virtue. Use it to resolve references — never to hold a fact.

A desk that forgets the previous sentence is exhausting to talk to. "The second one", "same as before", "what about that other course" — all meaningless without the turns that came before.

So memory feels like a straightforwardly good thing to add more of. It is not.

The one idea. Memory is a budget, not a virtue. Every remembered turn is paid for on every subsequent turn — and the older a fact gets, the more likely it is to be wrong while still sounding authoritative.

Two settings

That is the entire memory surface.

memory_type

What it holds
Type of memory to use ('summary' was never implemented and is treated as 'buffer'; real persistent memory lands in P3) One of: none · buffer Defaults to buffer.

max_memory_messages

What it holds
Maximum messages to keep in memory Defaults to 50.

buffer keeps the last N messages verbatim. none keeps nothing — every turn is the first turn. The default is buffer at 50, and 50 messages is twenty-five exchanges, which is a long conversation to carry into every request.

Desk — remembering the conversation

The lesson-2 agent, with a memory budget chosen on purpose and a prompt that says what must not be carried forward.

Scroll for all 4 steps →

This build sets 12 — roughly six exchanges. Enough to resolve any reference a customer actually makes, short enough that something said twenty turns ago cannot drift back in as current.

What memory is for, and what it is not for

The left column is what a conversation needs. The right column is how a desk starts lying.

Resolve a reference — "the second one", "that one"

Never use memory to…
Supply a fact — a price, a date, a policy

Remember they already told you their name

Never use memory to…
Remember what the price was ten turns ago

Avoid asking the same question twice

Never use memory to…
Repeat a commitment a human made earlier

Keep the tone of an ongoing conversation

Never use memory to…
Skip retrieval because you "already looked"

That distinction is the same one from lesson 3, arriving in a new place. References are prose. Figures are facts. Memory is a perfectly good place to keep the first and a dangerous place to keep the second, because a remembered fee has no source attached — it is just as fluent as a retrieved one, and there is nothing to check it against.

Which is why the prompt in this build says, in as many words:

Do NOT use memory as a source of FACTS. A price, a date or a policy must come from what was retrieved THIS turn, even if you stated it earlier in the conversation. Retrieve it again and quote it again.

Asked "you mentioned two courses at ₹12,000 earlier — what's the difference?", the agent went back to the catalogue and re-read both rather than recalling them, and returned the two ₹12,000 courses with their SKUs. The reference came from the conversation; the figures came from the knowledge base. That is the behaviour you want.

Verified honestly: the single-turn behaviour above is from a real run. Multi-turn buffer behaviour needs a live chat session rather than a headless execution, so treat the twelve-message budget as a starting point to tune against your own conversations, not as a number this lesson has proven optimal.

Choosing your number

  • Short conversations, factual questions: 8–12. Most support desks live here.
  • Consultative, multi-topic conversations: 20–30, and expect to pay for it on every turn.
  • Anything where a stale figure is dangerous: keep it low and lean on retrieval instead.
  • none is a real option. A desk answering one-shot factual questions does not need memory at all, and turning it off removes an entire class of failure.

This is where a much bigger subject starts. What to keep, what to summarise, what to discard and what to re-fetch is context engineering, and it is the subject of From Prompt to Harness — the next path up. This lesson is deliberately the shallow end: set a budget on purpose, and never let memory hold a fact.

Next: with the desk answering, remembering and knowing when to stop, it is time to make it count in the CRM.

Related lessons