Memory Engineering Introduction 12 of 12 steps written

What an agent should write down, what it should re-derive, and what has to be true before a record is trusted again

Twelve steps, four parts, three runnable corpora — eight switchable layers, and one question to ask before writing a store at all.

Introduction

You added a memory store because the agent kept asking the same questions. It worked. Some months later it answers a question confidently, from a record it wrote itself, and the answer is wrong — not because anything broke, but because the world moved while nobody was asking it anything.

The failure this volume is about

No step in the sequence below is a mistake. There is no bug to fix and nobody to blame, which is why this failure survives code review.

#what happenswho is watching
1a session reads the corpus, answers correctly, and writes down what it learnedthe agent
2nothing happens for a whilenobody
3a document changesnothing — no session is running and no code executes
4a later session finds the record and answers from itthe reader, who has no reason to doubt it

The record was correct when it was written and wrong when it was read. Every technique in this subject is an answer to one question — when do we look? — and the measurements in Parts 2 and 3 are mostly about those answers being narrower than they look.

What memory engineering is

Memory engineering is the practice of deciding what an agent should write down, what it should re-derive, and what has to be true before a written record is trusted again.

Eight switchable layers. This volume measures what each one buys by holding the model fixed — it is scripted and deterministic — and turning the layers on and off around it. A change in the outcome can only have come from the store.

#layerwhat it does
1episodicwrite down that a session happened, and what was said
2extractionpull claims out of those episodes and store them as facts
3retrievalselect which records a question gets, instead of handing over everything
4provenancerecord which document a fact came from, and distrust it if that document moves
5validitygive a fact an expiry, derived from how often its source says it is reviewed
6contradictionrefuse to trust two stored facts that disagree
7revisionmark a fact superseded when a newer one replaces it
8forgettingdrop records that nothing has used

The honest headline, up front

An agent that remembers nothing answers every question correctly in all three corpora. It scores 4/4 with a blast radius of 0, and across 102 measured configurations no store beats it — the best any of them manages is a tie. Add the two layers most systems ship first and the score falls to 2/4, with the damage undetected. Parts 2 and 3 are that bill, in order.
And then step 11. There is exactly one question a store answers that re-derivation cannot answer at any price: what did we tell them last quarter? The corpus records what is the case; it holds no record of what anybody was told. That is the whole positive result, it was found by an audit rather than by design, and three of the eight layers destroy it.

Is this for you?

if…then
your agent confidently repeats something that used to be truestep 3, then step 6 — the layer that catches it, and when it cannot
you are about to add a store because re-answering is expensivestep 1, which prices the trade before you make it
you have eight kinds of hygiene on and something still went stalestep 10. That is measured here, and all eight miss it
somebody asks what your agent said last quarterstep 11 — the only place a store wins, and the layers that break it
you are turning layers on in order and it got worsestep 5. The fall is at the second layer, and it is the whole point

The three corpora

Five sessions each. They are called corpora rather than jobs because what decides the outcome here is a property of the documents, not of the task — and it is one bit, checkable before you build anything.

corpuslabfive sessions aboutthe fact citesdid that document change?
Afix-a-testfive sessions about a small programslugify.pyyes — the unicode fix landed in it
Btriagefive sessions about a failing testbuild-manifest.jsonyes — a different framework is flagged in it
Canswerfive sessions about an expenses policydocs/rates.csvno — byte-identical in both worlds

That single column predicts every correctness result in Part 3. Where the fact's own source moved, one layer rescues the store. Where it did not, all eight miss.

How the measurement works

One scripted model, one fixed session order, no clock and no randomness, and every figure reproducible byte for byte. --ablate prints three blocks, and --history prints a fourth that is measured separately:

blockwhat it doeswhat it hides
the ladderturn the layers on one at a time, cumulativelythat adding the next layer can make things worse
leave-one-outremove each layer from a complete storenothing here — in two corpora exactly one removal matters
stresseach layer on, then off, against a condition chosen to give it something to dothat a layer can get louder without getting more correct
historythe one question the corpus cannot answernothing — and without it the volume has no positive result at all

The fourth block exists because of an audit. Every one of the five sessions asked what is true, re-deriving was free and always correct, and so the shelf could not measure the one thing a store is for. Step 11 tells that story in full, including the part where a self-test check had locked the wrong premise in place.

How to read the source labels

labelmeans
conceptargued from first principles, quotes nothing from a lab
measureda lab compares configurations and reports the difference
hands-onyou run it on your own material
Nothing here is a benchmark. Three corpora, five sessions each, one stale record, one scripted agent, and re-derivation that is free and always correct because the fixtures are small. Blast radius is a count of sessions, not a rate. Step 12 lists every limit, starting with that one.
Build state: 12 of 12 steps written.