← Blog

Building a useful agent · Memory

How memories become knowledge

July 28, 2026 · 7 min read

While you dream, your experiences become facts. The same is true for our agents.

Things you know, like Paris being the capital of France or that the local Italian restaurant always serves arrabiata on Thursdays, all come from experience, consolidated while you dream.

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 in an agent's memory, and the three moments it came from.

In the last post we talked about how memories are created by experiences. In this post we will talk about how the neocortex groups these memories to find facts and patterns.

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

What belongs together

When we dream, we sort and group memories. For our agents that grouping is based on names. Maya's trip is Lisbon, the friend is Sara, and every moment that belongs to the trip says so. A name points at one particular thing however a moment was phrased, while a word like flights shows up everywhere and means something different each time.

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, reduced to the names they mention. Maya, Sara and Lisbon come out, while the flights, the hotel and the room stay behind as generic words. The same names keep returning across the moments, and that is what the night groups on.

Names are scored on how often they are present, a higher value if uncommon but removed if unique or too common. The idea comes from Hans Peter Luhn, who used it in 1958 to summarize texts by keeping the words that carry significant meaning.

weightkeptonceevery momentmentioned in more of the window →
Lisbon · 6 of 200weight 3.5
What a name is worth depends on how often it is mentioned. Only once and there is nothing to tie. In almost everything and it would tie everything, so it is set aside. In between, the rarer the name, the heavier it counts.

Ties can then be calculated as the sum of the scores of the names two moments share. Rare names in common make a strong tie, sharing only a common name makes a weak one, and a pair that shares nothing 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.
Lisbonplace3.5in 6 of 200
+
Saraperson2.6in 15 of 200
=
6.1a strong tie
Maya moved the team dinner at Lucia's to Friday, so Sara can join.
Maya booked flights to Lisbon for the offsite with Sara.
Saraperson2.6in 15 of 200
=
2.6a weak tie
A strong and a weak tie, scored in a month window of two hundred moments. The flights and the hotel share Lisbon and Sara, and the two scores add up to a strong tie. The dinner and the flights share only Sara, who is around far more often, so their tie is weak. Maya is in nearly every moment, set aside, and adds nothing.

The moments are then grouped on the strength of their ties, using a method called Louvain. The idea is to make the groups as large as they can get while each group still hangs together more strongly than chance would explain. Like the groups of friends you can spot at a large party.

Lucia's · dinnerLucia's · dinner · Sara07-19Lisbon · Sara07-26Lisbon · Sara08-02Lisbon
Five moments and their ties. The night found two groups, a dinner group and a Lisbon group, each hanging together more strongly than chance would explain. Sara ties the two sides, but too thinly to pull them into one.

Writing the fact

A well-studied phenomenon in psychology is the spacing effect, that learning is more effective when study sessions are spaced out. A group of moments from one busy evening will stay as moments, but a group of moments spread over time can become facts. The exception is corrections, they take effect the same night, nobody should have to say them twice.

The nightly read only sees one day, enough for corrections and the heaviest moments. The repeated patterns show up on the wider reads, the month behind about once a week, and everything about once a month.

From each group that passes we create zero or more facts. A fact is a single sentence about how things are now, the when and how of the moments removed. It can be a world fact that simply is, like Paris being the capital of France. A habit, something that repeats, like the arrabiata on Thursdays. Or a state, true for now but expected to change, which gets an expiry date so it can retire instead of going stale. And every fact points back to the moments it came from, like how thinking about something you know brings back the times you learned it, so the agent can go back to when and where it happened.

what the model reads · one group · 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.
From a real run, one call per group. The model reads the group's dated moments plus today's date, and answers with a typed fact citing the moments that support it. This one is a state, an upcoming offsite is only true for now, so the fact carries an expiry.

Changing its mind

Sometimes things change, and sometimes the agent misunderstood. So each new fact is compared against what the agent already knows. Saying the same thing again just makes the old fact stronger. A contradiction is settled by who said it, a correction from the user beats something the agent believed on its own, and newer evidence beats older. The losing fact is retired, not deleted, and it keeps a reference to what replaced it. And sometimes the agent takes back a claim with nothing new to put in its place, then the fact is closed.

correction
retired · supersededThe Tideline planning meeting with Sara is on Wednesday.
corrected by ↓
activeThe user's Tideline planning meeting with Sara is on Thursday.
retraction
retired · closedThe offsite budget was approved.
no replacement
Two ways the agent changes its mind. A correction retires the old fact and leaves a reference to what replaced it, so history is kept. A retraction closes the fact with nothing in its place.

What the night leaves behind

The agent ends up with two types of memories. The moments fade away with time, the knowledge stays until something retires it. Ask where the weekly meeting is and the agent does not have to replay a month of Thursdays, the fact is there, with the moments behind it one step away.

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 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.
What the nights leave behind. On the left the knowledge, standing until something retires it, each fact pointing back to the moments behind it, one kept as history. On the right the month's moments, fading at their own speeds.

But knowledge is only useful if it comes back mid-conversation. How the agent brings the right memory back at the right time is the next post.

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. What is left is recall, getting the right memory back into the conversation. That is the next post.