Module 3 · Agent Tools, Knowledge, Memory & Research Design · scripted
Memory: The Journal Between Conversations
Overview
Compaction, the library, the archive with handles — powerful, and all of it lives inside one conversation. Every conversation ends in amnesia. So when a system seems to remember you from last week, nothing in the model remembered anything. Someone wrote that part of the old conversation down somewhere else, and it was put into the new conversation as a user or system message. That is the whole trick. Memory is context engineering across conversations: what gets written, who writes it, and how the right page gets into tomorrow's context. One reframe makes every answer easier — you are not leaving notes for someone who was there. You are briefing a stranger who will claim to be you.
Where this fits
Memory is text the agent wrote in an earlier conversation, found again later, and injected into a new one. It is discovered information — but discovered from the agent's own past, then provided to the stranger who claims to be you. It answers "where is it" with a journal, and the whole craft is curating that journal so the right page is findable.
Where this fits
Every conversation ends in amnesia
Go back to the fact we started with: the LLM has no memory. Inside one conversation we solved that — the whole transcript rides along, the journal reread every morning. But every technique so far has lived inside a single conversation. Compaction, the library, the archive with handles — all of it dies when the conversation ends. Tomorrow's conversation starts from nothing: same model, empty context, no idea you exist.
So when a system appears to remember you, look for the text. It is always there:
If it appears to remember
No memory faculty has appeared anywhere. What happened is:
1. Something WROTE part of the old conversation down
somewhere else — a file, a database, a journal.
2. Something PUT that text into the new conversation,
as a user or system message, before the model spoke.
The model reads it like any other text in its context,
because that is all it is.The design question isn't mystical. It's the journal question, asked in full: what do you write in the journal, who writes it, and how does the right page get into tomorrow's context? And one reframe sharpens every answer: the reader of a memory is a future self who remembers nothing. You are not leaving notes for yourself. You are writing to a stranger.
The handoff, one level up
We've built this shape before. Compaction was the handoff within a task — the night nurse briefing the day nurse mid-shift. Memory is the handoff between tasks, across days and weeks:
Two handoffs
And the efficiency lesson carries over. A transcript archive is not memory. Keeping every old conversation and replaying it later is the record error again, at scale — almost everything in an old conversation was scaffolding for a task that is now finished. What deserves to survive the amnesia is small: preferences, standing rules, hard-won facts, corrections. Memory is curation, or it is just a bigger context, filling up again.
Two ways to hold the pen
Someone has to decide what goes in the journal. There are two places to put that decision, and they are the two architectures:
Who writes the journal
The dotted line on the left is the scribe: a second conversation running alongside the first, reading the exchanges and deciding. The thick line on the right is the historian: the agent writing to the journal itself, with a tool. Both end at the same journal, and the journal reaches tomorrow the same way — as text pasted into a new conversation.
Architecture 1 · The scribe
The scribe is a parallel, disposable conversation — self-dialogue in a new costume. It never joins the agent's work. It watches each exchange and decides whether anything in it belongs in the journal. Its prompt is the memory policy, so read it closely:
The scribe's prompt
"You observe one exchange from an agent's conversation, plus the journal of existing memories. Decide if the exchange contains anything worth writing down. A memory must be:
[the exchange under review — user speaking to the main agent:] "No — flag the over-limit expenses, don't fix them silently. I need to see them. Also my SAS EuroBonus number is 991-22-417, use it for the rebooking, and my back's been bad this week so aisle seat."
Reviewing against the journal. Three candidates:
STORE("When preparing reports for this user, flag policy violations explicitly rather than correcting them silently — the user wants to see them.") — a standing preference, stated as a rule, useful in every future reporting task.
STORE("User's SAS EuroBonus number: 991-22-417.") — stable, task-transcending, and the user volunteered it for reuse.
SKIP(reason = "The bad back and aisle-seat request are temporary — 'this week'. Storing a health detail also fails the privacy test: usefulness does not justify keeping it. Apply it now; let it die with the conversation.")
The scribe never forgets to watch — every exchange passes through it. Its weakness: it has to guess what the future needs, and it watches from outside, without the agent's sense of what actually mattered.
Architecture 2 · The agent as its own scribe
The second architecture skips the observer and puts the pen in the agent's own hand. Two words added to its language:
You have the following tools available for use:
- draft_agreement( … )
- store_memory( text )
- search_memory( query )
Task: Set up the data-sharing agreement with the NTNU group.
search_memory(query = "NTNU collaboration agreements, data sharing
preferences")2 memories: "User's institution requires the data steward to be
notified before any external data access (governance §5)." ·
"User prefers agreements drafted from the university template, not
from scratch."draft_agreement(template = "university-standard",
notify = "data-steward")Draft created. NOTE: NTNU returned a revised clause — they require
Norwegian-law jurisdiction, which the university template accepts.store_memory(text = "NTNU's legal office requires Norwegian-law
jurisdiction clauses in agreements; the university standard
template is compatible. Confirmed 2026-08.")- The scribe watches everything but understands from outside; the agent-as-scribe understands from inside but may not stop to write. Which failure is worse for your research agent — and which is easier to fix?
- Candidate 3 in Example 1: argue the other side. When should a system remember a health constraint — and what would have to be true of its storage, retrieval, and deletion first?
How the journal gets into tomorrow's context
Writing is half the system. The other half is the return trip, and it is machinery you already own: memories are text, text has an address in meaning-space, and tomorrow's task can pull the memories near it — then paste them in. Watch one memory cross three weeks:
This report is way too long. Stop sending me ten pages — one page, findings first, always.
Understood — one page, findings first, from now on.
····················································· [retrieved from memory, possibly relevant: "Reports for this user: maximum one page, findings first."] ····················································· Put together a report on the Q3 sensor calibration drift.
analyze_drift(quarter = "2026-Q3")[per-sensor drift series for Q3 returned — 9 sensors, daily]Findings (1 page): Calibration drift exceeded tolerance on two of nine sensors, both installed pre-2024… [one page follows]
Where memories actually live
A memory is never "in the model." At the moment it matters, it is a few lines of text sitting in a user or system message, indistinguishable from anything else the user typed. That is why the framing rule from retrieval applies here too: label it as retrieved and possibly relevant, not as orders.
One mechanism, three distances
Now step back over this whole module, because three machines have turned out to be one:
The same act, at three distances
Three sources. One act: text, selected, placed into the next prompt.
The unification
Knowledge is what the world wrote down. Memory is what the agent writes down. The context holds both the same way. There is no memory faculty and no knowledge faculty. There is only the conversation — and the engineering of what enters it.
Design the memory system for your research agent. (1) Write the scribe's prompt: your acceptance criteria, your privacy line, your format rule. (2) Run it on paper against three exchanges from a realistic task — at least one candidate must be rejected, and the rejection reason written out. (3) Write the two memories you'd want waiting in the context when a conversation starts in six months — for a stranger who has never met you or the project. (4) Decide: scribe or agent-as-scribe, and defend the choice with the failure mode you fear more.