← Blog

Building a useful agent · Memory

How memories become knowledge

August 4, 2026 · 7 min read

You go to bed with a day of moments and wake up knowing things. Our agents do the same: a nightly pass turns repeated moments into knowledge that lasts.

The last post ended with the agent holding a growing pile of moments: what happened, when, who said it. But a pile of moments is not what knowing feels like. You do not replay every Monday morning to work out where the weekly meeting is. Somewhere along the way, moments that kept pointing the same way became a thing you simply know.

Here is that end state, as our agents store it: the knowledge on top, and threads down to the moments that earned it. By the end of this post you will have seen exactly this get built.

factMaya has an upcoming offsite in Lisbon with Sara, for which she has booked flights, a three-night hotel stay, and a workshop room.
2026-07-19
Maya booked flights to Lisbon for the offsite with Sara.
2026-07-26
Maya booked the hotel in Lisbon for the offsite with Sara, three nights.
2026-08-02
Maya reserved a room for the offsite workshop in Lisbon.
A fact as it sits in the store, holding threads back to the moments that earned it: three moments, spread across days, became a thing the agent simply knows. Everything the night does exists to build this structure.

In your brain, most of that work happens while you sleep. The hippocampus replays the day, and what repeats settles into the neocortex as knowledge. Our agents keep the same schedule: once a night, a background pass reads the moments that have piled up and works them into facts. This post is about that pass.

Hippocampus
Encode
conversation → separate episodes
Amygdala
Weigh
salience at capture
this post
Neocortex
Consolidate
episodes → facts, nightly
Recall
Resurface
the right memory, per turn
The lit stage is this post: the nightly pass that turns accumulated episodes into facts. Capture was the previous post; recall comes next.

What belongs together

Prose does not sort. A moment is written the way it happened, in whatever language it happened in, and no two are phrased alike. So before anything is grouped, a small model reads each moment once and pulls out the things it names. The phrasing, the when and the how much stay behind in the moment. The result is kept, so no night ever pays for the same moment twice.

The test for making the list is having a name. Book flights to Lisbon for the offsite with Sara, and Maya, Sara and Lisbon make the list while the flights do not: nothing names them. A word like flights turns up in any number of unrelated moments, but a name points at one particular place or person, which is exactly what can tie two moments together. The list is typed and kept whole, and everything about grouping ahead runs on it and nothing else.

Maya booked flights to Lisbon for the offsite with Sara.
MayapersonSarapersonLisbonplace
Maya booked the hotel in Lisbon for the offsite with Sara, three nights.
MayapersonSarapersonLisbonplace
Maya reserved a room for the offsite workshop in Lisbon.
MayapersonLisbonplace
The same three moments from the opening figure, through the extraction. Only the named come out: the flights, the hotel and the room stay behind, generic words that nothing names. And the same names keep returning across the moments. Hold on to that; it is what the night will group on.

With every moment reduced to its things, the night can start sorting. First, every thing in the night's window is counted. A thing mentioned only once cannot tie anything, and a thing mentioned everywhere would tie everything, so both are set aside. What remains gets a weight: the rarer the thing, the heavier it counts.

weightthe bandonce1 in 10every momentmentioned in more of the window →
Lisbon · 6 of 200weight 3.5
Three fates for a thing. Mentioned only once, there is nothing to tie. Mentioned in almost everything, it would tie everything, and is set aside. In between sits the band grouping runs on, where the rarer the thing, the heavier it counts.

A tie between two moments is the sum over what they share in the band. Shared things add up, so two moments with several rare things in common bind hard, while a pair that shares nothing in the band gets no tie at all.

Maya booked flights to Lisbon for the offsite with Sara.
Maya booked the hotel in Lisbon for the offsite with Sara, three nights.
Lisbonplace2.3in 2 of 20
+
Saraperson2.3in 2 of 20
=
4.6their tie
Maya booked a table at Lucia's for the team dinner.
Maya booked flights to Lisbon for the offsite with Sara.
share only Maya, outside the band · no tie
Two of Maya's moments, weighed. A tie is the sum over what a pair shares in the band; contributions add. The second pair shares only Maya, and she is outside the band, so there is nothing to sum. The numbers are the real computation for this window of twenty moments.

It matters what you group on. Group on the person, and you have grouped nothing: you are in every moment of your own life, so every moment matches every other. Group on the words, and moments that merely phrase alike get pulled together, a table at Lucia's in one and a flight to Lisbon in the other, chained by the word booked. So the night groups on the things a moment mentions, the named people, places and products on its list, and the threads of your life come apart cleanly.

The grouping itself is a joining game. Check every pair of moments once and record what they share in the band: that is the web, every moment a dot, every surviving connection a tie. Then every moment starts alone and drifts to the neighbor whose tie most beats the luck-bar, the tie chance alone would give them. Settled groups shrink into single dots and the game repeats, so threads assemble bottom-up: pairs first, then pairs of pairs, until nothing wants to move.

Lucia's · dinnerLucia's · dinner · Sara07-19Lisbon · Sara07-26Lisbon · Sara08-02Lisbon
The web, settled. Moments tie where they share things, threads are the clumps denser than chance, and the night found two: a dinner thread and a Lisbon thread. Sara's ties are real but thin, so they never merged the threads.

None of this sorting is our invention. Ignoring the things too common to mean anything is an idea from 1958, and the grouping itself is the Louvain method, the standard way of finding communities in a network. Each night places a moment in exactly one group, but that is not where it ends: the same moment can go on to support several pieces of knowledge, and a deeper pass on a later night can sort it differently as more of the story arrives.

Two guards finish the job. A group that grows past what one theme can hold is split and sorted again, so a large store cannot melt into one pile. And moments that are just the agent reminding you of things are set aside in a lane of their own, where they cannot pass for knowledge.

The bar for becoming a fact

Most groups never become knowledge. The bar is not how much happened but how it is spread: a group earns a fact when a few of its moments come from more than one day. A busy evening can fill a group on its own, but a burst is still one experience. Come back to the same thing tomorrow and it starts to look like a regularity. The gap is doing the work, and psychology has a name for that: the spacing effect. Post 1 stated it as a rule: importance alone doesn't make knowledge, repetition does. This is where that rule is enforced.

One kind of moment bends the bar. A correction never waits: set the agent straight on the meeting day and the fact is written the same night, even when that correction is the only moment on its side. Nobody should have to correct an agent three times before it takes. Other heavy moments get no such pass of their own: with company they can carry their whole group through the same night, but alone they stay what they are, a vivid moment. The view from the tower in post 1 never became a fact, and it never should. What counts as heavy here is exactly the salience post 2 built; the amygdala's number follows the moment all the way into the night.

The gate can only judge what a pass can see, and one night is a narrow window. So the same machine runs at three exposures. Every night it reads the day behind, enough to catch corrections and anything that ran hot within the day. About once a week it re-reads the month behind, wide enough for the rhythms of a week to show. And about once a month it re-reads everything, for the threads that move slowest of all. These are not retries, they are longer exposures: a weekly rhythm simply does not exist inside a single day, no matter how carefully you look.

every nightthe day behind
corrections · today's hot threads
about once a weekthe month behind
the weekly rhythms
about once a montheverything
the slowest threads · the whole story, re-read
← further backtonight
One machine, three exposures, every window ending tonight. The nightly pass sees the day: corrections, and whatever burned hot enough to recur before morning. The Sunday pass sees the month behind, wide enough for weekly rhythms to repeat inside it. The monthly pass re-reads everything. A pattern is only visible in a window wide enough to hold its repeats.

Writing the fact

A group that passes the gate goes to a stronger model than the one that pulled out the things, and it gets the group whole: today's date, and every moment dated and numbered, in its own words. What it may answer is narrow. One sentence of knowledge, what kind of fact it is, which of the numbered moments actually support it, and whether it should ever expire. It is also allowed to answer nothing: a group can pass the gate and still hold no regularity worth keeping, and declining is the right call.

what the writer reads · one group, one call · today: 2026-08-03
1 · 2026-07-19
Maya booked flights to Lisbon for the offsite with Sara.
2 · 2026-07-26
Maya booked the hotel in Lisbon for the offsite with Sara, three nights.
3 · 2026-08-02
Maya reserved a room for the offsite workshop in Lisbon.
what it answered
fact · statecites moments 1 · 2 · 3weight inherited from its heaviest moment
Maya has an upcoming offsite in Lisbon with Sara, for which she has booked flights, a three-night hotel stay, and a workshop room.
One call per group, from a real run. The writer reads the group's dated moments, in their own words, plus today's date, and must answer in a fixed shape: a typed fact citing the moments that support it, by number. This one came back as a state, not a timeless truth: an upcoming offsite is only true for now, and a fact that could rot must say so.

The sentence is phrased so it cannot silently rot. A truth that really is timeless, who someone is, what they own, what they can do, may be written that way; anything that only holds for now, a role, an arrangement, an open plan, is anchored to its time or written as a state with an expiry. And every date in a fact must come from the moments themselves; the writer is not allowed to guess one. The citing is not a courtesy either: every fact points at the exact moments that earned it, so it can always be opened back up, and the weight it starts with is inherited from the heaviest of them. A fact born of a correction starts heavy.

Changing its mind

Knowledge can be wrong, and the night is also when it gets fixed. A new fact is not simply added to the pile. Before it lands, it searches the store for what it might already mean; the store is indexed by meaning, so the newcomer pulls up its nearest neighbors, phrased however they were phrased. Usually nothing close comes up and the fact just lands. When something does, a judge reads the pair and rules: the store already says this, the two contradict, or they merely sit near each other.

A contradiction is where post 2's tag finally pays off. Who said it decides: a fact backed by your correction beats one the agent merely believed, however confident it sounded, and on equal footing the newer evidence wins. The loser is never deleted. Its validity is closed, it points at its successor, and it stays on the shelf as history.

the store held
factThe Tideline planning meeting with Sara is on Wednesday.
the night reads
marked · correctionThe user corrected the meeting day: the Tideline planning meeting with Sara is Thursday, not Wednesday.
found by meaning · the new candidate searches the store
The user's Tideline planning meeting with Sara is on Thursday.The Tideline planning meeting with Sara is on Wednesday.
judge: contradicts · authority decides · the correction wins
after
retired · supersededThe Tideline planning meeting with Sara is on Wednesday.
active · the successorThe user's Tideline planning meeting with Sara is on Thursday.
A correction changes the store, in a real run. The freshly minted successor searches the store by meaning and finds the old claim sitting right beside it; a judge confirms they contradict, authority decides, and the correction wins. The loser is retired, never deleted.

Some retractions replace nothing. The agent takes back a claim, and there is no new truth to put in its place. The night does not have to notice this by rereading anything: capture already marked the moment for what it was when it was written, the same ladder from the last post. Each marked moment then searches the store itself, and it has to match tighter than a new fact does, because a candidate that lands loosely just starts a comparison, while a retraction that lands loosely kills the wrong knowledge. When it truly matches, the fact is closed with nothing after it. The agent knows less than it did the day before, on purpose.

the store held
factThe offsite budget was approved.
the night reads
marked · retractionThe agent took back its earlier claim that the offsite budget had been approved.
found by meaning · the retraction searches, stricter
The agent took back its earlier claim that the offsite budget had been approved.The offsite budget was approved.
judge: invalidates · a retraction must be close to kill
after
retired · invalidatedThe offsite budget was approved.
no replacement
A withdrawal closes without replacing, in the same run. Here the retraction itself searches the store, and on a stricter match: a retraction must be close to kill. The judge confirms, the fact's validity is closed, and nothing new is asserted in its place.

What the night leaves behind

The store the night leaves behind holds two kinds of memory. Moments, which fade on their own schedule, and facts, which stand until something retires them, each pointing back at the moments that earned it. Ask where the weekly meeting is and the agent should not have to replay a month of Mondays. The fact is simply there, and the receipts are one hop away.

the moments · fade on their own schedule
2026-07-19
Maya booked flights to Lisbon for the offsite with Sara.
2026-07-21
The user corrected the meeting day: the Tideline planning meeting with Sara is Thursday, not Wednesday.
2026-07-26
Maya booked the hotel in Lisbon for the offsite with Sara, three nights.
2026-08-02
Maya reserved a room for the offsite workshop in Lisbon.
the knowledge · stands until retired
Maya has an upcoming offsite in Lisbon with Sara, for which she has booked flights, a three-night hotel stay, and a workshop room.from 07-19 · 07-26 · 08-02
The user's Tideline planning meeting with Sara is on Thursday.from 07-21
retired · supersededThe Tideline planning meeting with Sara is on Wednesday.
The store, zoomed out. On the left, the month's moments, already fading at their own speeds. On the right, what the nights made of them: knowledge that stands until something retires it, each fact holding threads back to the moments that earned it, one already retired and kept as history. This is what recall will reach into.

But a shelf of knowledge is only as good as what comes off it mid-conversation. The only memories that matter are the ones the agent can bring back at the right time, and that is the next post: how the right moment and the right fact find their way back into the conversation, exactly when they are needed.

Hippocampus
Encode
done
Amygdala
Weigh
done
Neocortex
Consolidate
done · this post
next post
Recall
Resurface
the right memory, per turn
The map from the top of the post, flipped: encoding, weighing and consolidating are behind us. One stage left, and it is the point of all the others: bringing the right memory back at the right moment. That is the next post.