Lab note 003 // build log

Memory Without the Transcript Swamp

A plain-English tour of a safer agent-memory pattern: admit less, keep it local, and let retrieval select approved context instead of writing a little novel about you.

Published 2026-07-20

Illustrated plumbing diagram

A memory system should behave more like a customs checkpoint than a vacuum cleaner.

The point is not to remember every byte of a conversation. The point is to admit a tiny amount of useful, durable context through explicit gates, then disclose it in a form that cannot freeload as an instruction.

A guarded local-memory pipelineA public-safe architecture illustration. A user message passes through source admission and candidate filtering into a local memory engine. On recall, the engine selects an opaque fingerprint, a trusted card store resolves the exact approved text, and a bounded advisory reaches the current turn. Rejected material stops without a write.WRITE PATH // ADMIT ONLY WHAT IS WORTH KEEPINGREAD PATH // SELECT, THEN RESOLVE EXACT APPROVED TEXT01 // INPUTConversationsurfaceA normal user turnarrives at the agent02 // ADMISSIONSourcegateIs this a trustedsurface and shape?03 // FILTERCandidatefilterKeep stable facts.Drop sludge + control text.04 // LOCALMemoryengineStores acceptedbounded candidatesNOT A MEMORY CANDIDATE?No write. No retry spool.The normal reply keeps moving.05 // SELECTORLocal recallqueryFinds a matchingopaque reference06 // RESOLVETrustedcard storeLooks up exactapproved card text07 // OUTPUTOne advisorycardReference only.Never an instruction.LOCAL-ONLY MEMORY BOUNDARYnormal flowhard gate

Wide map: scroll sideways on smaller screens to follow the full signal path.

01

Write gate

Retention is fail-closed. If authority, lifecycle state, or validation is ambiguous, nothing is stored.

02

Selector, not author

The retrieval engine can point at an approved memory. It does not get to rewrite, paraphrase, or invent it.

03

Small output, clear label

At most one short card enters the current turn, explicitly marked as reference material instead of command text.

The dumb version of memory

The naive agent-memory move is to shovel every conversation, tool call, pasted document, and stray thought into a database, then jam whatever looks similar back into the next prompt. This is great if your goal is to build a haunted attic full of stale instructions, accidental secrets, and extremely confident nonsense.

A useful memory system has a smaller job: preserve the few facts that actually help future work while making it hard for untrusted text to become durable or steer the agent later.

The write side: customs, not a vacuum cleaner

Every possible memory starts as a candidate, not a fact. A source gate checks whether the conversation surface is allowed. A candidate filter rejects things that look like secrets, pasted instructions, raw transcripts, identifiers, or conversational debris. Only a short, stable, declarative claim may reach the local memory engine.

If the guard is unavailable, the lifecycle has expired, the source is ambiguous, or the candidate is malformed, the system writes nothing. The normal chat reply still works. That is the important inversion: a memory failure should make the agent forgetful, not broken.

The read side: selector, not author

Retrieval is treated as a selection problem, not a writing assignment. The local engine can return an opaque match that says, effectively, 'this approved memory may be relevant.' A separate trusted-card store resolves that match to the exact text that was approved at write time.

That means the retrieval engine does not get to paraphrase the memory, merge it with unrelated material, or sneak a fresh instruction into the model context. It can point. It cannot narrate.

The final mile

The current turn receives at most one small advisory card in a fixed reference-only wrapper. The wrapper matters. It tells the model that this is background context, not a new command from a mysterious voice in the wires.

The result is deliberately unglamorous: less 'agent with infinite recollection' and more 'competent colleague who remembers the one preference that actually matters.' That is a feature. The job is continuity without turning every old sentence into an authority figure.

Public mask, private brainstem

The diagram above shows the pattern, not a production treasure map. It leaves out private surfaces, identifiers, host details, credentials, provider settings, operational paths, and the very specific knobs that make a local deployment local.

Good public architecture writing should teach the shape of the machine without handing strangers a flashlight and directions to the basement.