Solentrex · April 2026

Building the memory system from scratch

Every AI session used to start from zero. I rebuilt the memory as five layers that load themselves, save themselves, and never ask me to explain the same thing twice.

Five layers9 hooks, 6 events2,211 documents137 consecutive logsLocal only

What it was

An AI session forgets when it ends. I would explain the codebase, the vendors, the decisions we had already settled, and then the window closed and it was gone. The next morning I explained it again.

My first attempt at a fix was a folder of 116 files with nothing connecting them. It stored things. It did not compound.

What I did

On April 3, 2026 I rebuilt it as five layers, each with one job.

  • A personality file. How the assistant behaves and who it works for. Rarely changes.
  • Core context. What the business is, the current priorities, the conventions, who is on the team.
  • One living document per project, updated in place as things change. This is the part that compounds.
  • An append-only daily log. The safety net for anything that did not fit a project file. Never edited after the fact.
  • Structured records for decisions, discoveries, and failures, so a settled question is not re-argued and a failure is not repeated.

The shape is not original and I never claimed it was. I read six open source memory projects and two tutorials, took what worked in each, and assembled it for one person doing engineering work.

Then I made the loading automatic, because a memory that depends on remembering to use it is not a memory. Nine small scripts run on six events in the tool's lifecycle. Context is injected at session start and routed by which folder I am working in. A save marker is written before the context window is compacted. The session is reconciled back into the vault when it stops, and a staleness check runs at the end. If nothing has been written for fifteen minutes of active work, the session gets a warning. Each session has to open with an agreed short phrase; if the phrase is missing, I know the context was skimmed and not read.

What may be stored is written down and narrow. No keys, tokens, passwords, customer names, or raw API responses, ever. Patterns and placeholders instead of real values. It lives on one machine as plain text, syncs to no cloud service, and the owner can read, edit, or delete all of it in a minute.

What it produced

MeasureCount
Documents in the memory2,211
WordsAbout 4.4 million
Written rules for AI agents129
Consecutive working days logged137
Hook scripts, and lifecycle events they run on9 scripts, 6 events
Hook fires stamped and logged since August 3329

The practical result is that I stopped re-explaining. A session opens already knowing the state of every workstream and the mistakes we have already made. Work done on a Tuesday is available on Friday without me carrying it.

The same pattern now runs a second, much smaller vault for personal projects, loaded by the same hook and kept separate from work. That is the evidence it is a method and not one lucky folder. One addition came from a failure: a session ran out of context and lost two days of decisions, so I added a summary writer that reads the raw transcript and records the session itself. Keeping the memory current no longer depends on the AI choosing to do it.

Back