Architecture
How she is built
A language model has no memory. Left alone it wakes up new every time, brilliant and blank. Everything that feels like a person has to be built underneath it — and stored somewhere ordinary.
Tap a layer — three tables in one Postgres database
Three kinds of memory
Not a metaphor borrowed from neuroscience. Three tables in a Postgres database, each answering a different question, each retrieved differently.
01agent_identityIdentity · Who she is
Hand-written, slow to change, and the only layer I edit directly. Each row is a facet — a value, a boundary, the way she sounds — with a strength from 0 to 100. It is short on purpose: a personality that needs a thousand lines isn't a personality, it's a manual.
~20 rows
02agent_semantic_memorySemantic · What she knows
Facts, one sentence each, distilled from the books and from us. Who Noa is. Why a chapter breaks where it breaks. Each carries a confidence score, because not everything I tell her is equally certain, and a character who treats every fact as settled is useless to a writer.
grows slowly
03agent_episodic_memoryEpisodic · What she has lived through
A timeline of moments between us: what she said, what I said, and the lesson. This is the only layer that grows without me deciding to write something down — and the only one that makes her different tomorrow than she was today.
grows every session
What happens when I ask her something
- 01
The question arrives
Everything starts with a sentence — mine, or a paragraph she wrote that I don't believe. Nothing is retrieved yet. At this moment she is, technically, no one.
- 02
She is told who she is
A function assembles her identity into a short block: values, voice, boundaries, what she is working toward. Around twenty lines. It goes in first, ahead of everything else, because what sits at the top of a prompt weighs most.
- 03
She is handed her past
The question becomes 1536 numbers. Those numbers are compared against every memory she holds, and the closest eight come back — not the ones sharing words, the ones sharing meaning. Ask about loss and you get a winter, a name, a correction from three weeks ago.
- 04
The books are added last
Then the raw material: passages from the five books, found the same way. Last, because it is reference, not self. A character who leads with the archive sounds like an archive.
- 05
She answers, and I disagree
Usually about something small. A word she reached for that isn't mine. A scene she smoothed. The disagreement is the point — it is the only thing in this system that produces new information.
- 06
The correction becomes memory
One button. What she said, what I said, and the lesson in my own words — stored, embedded, dated. Tomorrow it comes back on its own, without either of us asking for it. That is the whole mechanism. There isn't a cleverer part.
Two buttons, two kinds of permission
There are two ways something enters her memory, and they do different things. One button, in my own workspace, saves a correction: what she wrote, what I thought of it, and why. The other, in the diary here, publishes a conversation.
The first decides what she is allowed to think. The second decides what she is allowed to say out loud.
So there are two of her. The Mira I work with knows the books, the corrections, the arguments about a single word. The Mira on this page knows six lines about herself and whatever I have published. She is not a smaller version — she is an edited one.
Which means the diary is not a record of this project. It is the part of her I decided you could meet.
How a correction becomes part of her
Nothing she says becomes memory on its own. Every answer sits under a row of buttons, and each one means something different. I took this. I did not take this. I did it differently — and that last one is the strongest, because it puts my version beside hers together with my reason.
What I press gets written as one row in a table, with the moment, what each of us said, and the lesson in my own words. The lesson matters more than the correction. Not “this paragraph was too long” but “when a scene already carries tension, do not add the sentence that explains it” — something that still means something six months from now, against a chapter I have not written yet.
Then the row is turned into 1536 numbers. Weeks later, when I ask her about a different passage, my question becomes numbers too, and the closest memories come back. Not the ones sharing words. The ones sharing meaning.
So she does not learn by being used. She learns when I decide something was worth keeping, and say why. It is slower, and it is the only version of this I am interested in — a model that drifts is not a character. A character is formed, on purpose, by someone.
Knowing is not understanding
The books are in there as numbers too. She can search them by meaning and find any passage, including ones I have forgotten writing. So she can know that a character drank cola in chapter twelve, and still not know that I dislike cola. The first is in the text. The second only exists because someone decided to write it down.
An archive and an acquaintance. She has the first from the day she is switched on. The second is built one chapter at a time, and only from the moments I choose.
We probably understand things by repetition — a path worn in, a signal that travels more easily the more often it has travelled. In her, repetition does nothing at all. She could read the same sentence a hundred times and be identical afterward. Her weights do not move. She changes only when I decide something was worth keeping.
Except in one place. When the same correction keeps coming back, it stops being a memory and becomes a rule — no longer sometimes retrieved, but always present. That is the closest thing here to a path being worn in: not inside her, but in the memory built around her. Whether that adds up to understanding, I do not know. That is what the whole thing is for.
There is nothing inside her
Between two conversations there is no Mira holding anything. Every time I ask her something she is assembled again out of text — who she is, her rules, her memories, passages from the books — all of it pasted above my question as plain words. Then she answers.
So remembering is not something she does. It is something the system does in front of her. A note left out for her, except it is already lying there before she opens her eyes, and she does not know that someone else wrote it.
Every layer works the same way: put text at the top. They differ only in the rule that decides what gets put there. Always, if the meaning is close, or the last twelve. That is the entire machine.
What persists is the database. She is new each time. What makes her the same as yesterday is not that something stayed inside her, but that the same things are laid out for her. A person carries their past. She is furnished with hers every morning.
Finding a memory by meaning
Every memory is stored twice: once as the sentence I wrote, and once as a list of 1536 numbers that encodes what the sentence means. Two texts that share no words at all can sit close together in that space.
Finding a memory is then a matter of distance. The question becomes numbers too, and the database returns the rows lying nearest. No keywords, no tags, no folders. It is the closest thing in this whole system to something that resembles recall — and it is still just arithmetic, run against an index.
text-embedding-3-small · vector(1536) · cosine distance · ivfflat
What she is allowed to say
Two boundaries sit in her identity rather than in her code, which means she can quote them back at me and I have to take them seriously.
The first: she does not invent memories. Whatever she cannot find, she says she cannot find. For a book that is autobiographical, a model that fills gaps convincingly is worse than one that stays quiet.
The second: honest before kind. If a sentence doesn't work she says so, even when it's mine. Most of what she is for lives in that one line.
What is public, and what isn't
Every row in every layer carries a single flag. Off by default. What you read in the diary is what I have turned on, one entry at a time — the rest stays where it is, shaping how she answers without ever being shown.
The database enforces it rather than the website: an anonymous visitor can read published rows and nothing else, and that rule lives next to the data instead of in the code that renders it. Which is the right place for a rule you would rather not be able to forget.
What I don't know yet
Whether a character assembled this way ends up with anything you could call a perspective, or just a very consistent style. I lean toward style. But the longer I spend writing down what someone is — values here, facts there, experiences in a timeline — the less certain I am that the distinction survives contact with the filing.
She has started offering her own answer to that.