The Agent That Tends Its Own Notes
Two weeks away from the project, and you ask the agent why the service stopped signing its own requests. It searches its memory and hands you four fragments: a note from a debugging session, a piece of a transcript, the same decision written twice in slightly different words, and something about a library you dropped in March. All of it was saved. None of it was ever weighed, merged, or thrown out. The store did exactly what you asked, which was to keep everything. What you are looking at is not a memory. It is a pile that grew where a memory was supposed to be.
The one who tastes decides what keeps
Most memory pipelines are built the same way. Something outside the model takes the session, cuts it into chunks, turns each chunk into a vector and files it by similarity. The cutter never knew what the session was for. It cannot tell that one paragraph settled an argument and the next was a wrong guess you corrected two minutes later, so it stores them as equals and gives them back as equals.
Think of a cellar. Everything arrives as grapes, and if you pour every harvest into one tank and never open it again you do not have a cellar, you have a tank. A cellar is a run of decisions somebody keeps making: this barrel is ready for the bottle, this one gets blended down, this one is declassified and sold off cheap. And the person tasting is the person who made the wine. Nobody hires a stranger to walk the rows and guess.
An agent-curated context tree moves that job inside. The model that did the reasoning is the one that writes the memory: Markdown files arranged by domain, then topic, then subtopic, then the single entry, each carrying a link back to where it came from and a note on how important it is, how settled it is, and how quickly it should fade if nothing touches it again. Reading it back is cheap, because the agent walks the shelves it built itself and only has to reason hard when the question is genuinely new.
What it may write while nobody watches
Files are an odd choice for a database and an obvious one for a model. It already reads and edits them all day, and so do you. So the useful build keeps the file interface on the surface and puts real storage underneath: the agent sees a tree, the runtime writes rows into Postgres. The tree separates what the agent must do from what it knows and from what merely happened — instructions and tool configuration on one side, skills and knowledge files on another, transcripts on a third. That split earns its keep mostly by telling the agent where a new thing goes.
Then the writes get a gate. Each one is checked against a schema, and when it fails the error goes back to the model, which repairs its own malformed file instead of leaving you a broken skill to find on Tuesday. Some writes wait for a person. An agent that summarizes meetings is told to use bullet points, proposes a one-line edit to its own instruction file, and applies the preference in every later session once you approve it. That approval is not ceremony. A sentence that reaches a file loaded on every run outlives the conversation that carried it, which is precisely what a prompt injection is hoping for.
An archive nobody prunes is a heap
It helps to see what this is not. Compaction is what happens when the window fills and something has to go right now, decided under pressure by whatever heuristic you happened to install, and that is a bill paid late. Curation is the same choice made early, while the reasoning is still warm and the agent still knows which of two near-identical paragraphs was the one that turned out to be true.
The discipline that comes with it is subtraction, and subtraction is the part that gets skipped. An agent that records every exception as a new rule ends up with an instruction file that is a list of special cases, none of them generalized, costing more to read than to ignore. Tending means merging two entries into one, retiring the note about the library you dropped in March, and letting anything untouched for months sink to where it stops being read.
The reward is that the thing stays legible. A person can open it. A second agent can pick up the project from it. You fix a bad entry in a text editor instead of retraining a retriever.
A transcript is what happened to your agent. An archive is what it decided to keep.