For months I did not notice that the files my AI assistant draws its knowledge from had stopped being true. The reason was not too little content: everything was written down, and nothing ever left. Over a hundred markdown files, plain text files, each of them true on the day I wrote it. Together they add up to a memory that is confidently wrong. I had once called that stack the filing cabinet, and this post is about what the filing cabinet did while I was not looking inside.
The moment I caught it
I caught it in a recommendation. The assistant suggested running a local model on a machine we had ruled out for exactly that purpose months earlier, too small, and that decision was sitting in the files. The superseded plan from before it was sitting there too. It read the superseded one first.
Once I started paying attention, I saw it everywhere. I found a decision being retold with a status I had corrected twice since, and a topic spread across fifteen files, so the answer depended on which of them happened to be read first. None of it was broken: no error, no warning. Every single memory had been true on the day I wrote it.
I call this memory rot: what gets written down turns wrong over time, and the system never pushes back on its own. You only notice when you look again. It is not a bug, it is the default. A system that writes something down every day, never digests and never forgets, will eventually be confidently wrong, precisely because it records so diligently.
What I found once I finally looked
I built myself a small scanner and pointed it at my own setup. The first honest number was uncomfortable: roughly 5,300 tokens, a unit of text, were loading into every single chat before I had typed a word. That is the always-on part of the memory, and I had never seen it listed in one place.
The first full scan found 64 problems. I had files explicitly marked as rejected that were still steering active knowledge, plus three files that had fallen out of the master list and could only be found if you already knew they existed. Then came near-duplicates, dead links, and the same file in two places, carrying two versions of the truth.
My favourite finding took apart an assumption I did not know I held: the newest file is not the truest file. Twice, the richer and correct version was sitting in the older copy. File dates lie. Content decides.
Why the obvious fixes all fail at the same point
I tried three of them in order. Saving less does not help, because saving is exactly how the system learns who you are, and letting it record less just leaves you with an assistant that stays generic. Deleting old things automatically does not help either, because going stale is a question of meaning rather than age: my preferences from March still hold, a project status from last week may not. And leaving the sorting to the model while it reads fails because that is precisely what it cannot and should not do: a model has to be able to trust its own memory.
A memory needs a metabolism
The mental model that finally worked for me is biological. A memory system has to do three things with equal standing: take in, digest, let go. Mine had only ever eaten.
In practice that became three clocks. In every chat I write freely, but against a few writing rules, such as updating the existing file instead of creating a sibling, and when a fact changes, correcting it in place rather than putting the new version somewhere else. Every week a deterministic scan catches the mechanical drift: orphaned files, dead links, duplicates, stale markers. Every month a short ritual follows, in which I distil finished episodes into durable knowledge and then archive them.
Two rules carry most of the weight. Nothing is ever deleted: superseded files get marked and move into an archive with its own master list, so the history stays findable without steering anything. And every fact gets exactly one owner file, everything else only points there. When something changes, there is one place to correct instead of fifteen.
Whether it works is told to me by a single number: the always-loaded tokens. If they grow month over month, the system is eating without digesting.
What changed
The cleanup itself was three cleanup chats with the assistant: the scanner finds, I decide, it applies. From 64 problems to zero, plus around sixty deliberately marked as fine, each with a written reason. The weekly scan has held the line since.
The more interesting change does not fit into a chart. My assistant no longer gets things confidently wrong that we had corrected long ago. When I set a fact straight today, it stays straight, because the correction lands in the one owner file and the old statement gets marked where it stands.
I wrote the whole approach up as a small field guide, with the scanner as a readable reference implementation, around 700 lines of Python. Both are on GitHub: memory-metabolism. The guide is the actual product, the code is there so you can check that I am not just claiming.
What I would tell anyone running an agent with memory
I would audit first and clean up only afterwards, because knowing what loads into every chat and what it costs already changes how you write memory in the first place. And I would expect knowledge to go stale from the start. That is not a personal failing. It starts earlier than you think, on my setup after about three months.
In the end, one principle carries the whole system: remembering, digesting and forgetting need equal standing, on different clocks. A system that only remembers will, after enough months, remember you wrong.