An AI agent starts every session with no memory. It doesn’t know what was decided yesterday, which rules apply or why the code looks the way it does. With one agent you can manage with a long prompt. With seven agents making hundreds of commits a day, knowledge has to live somewhere everyone reads the same version.
My answer is a Git repository of markdown notes that every agent reads before it starts. Here is how it is built, which rules keep it useful, and where it falls short.
The problem with prompts and private memories
There are three obvious places to keep knowledge, and all of them work badly in a team:
- The prompt grows until nobody knows what’s in it and nobody dares remove anything.
- The chat history disappears when the session ends, and it is too long to reread anyway.
- The tool’s own memory per project is seen by one agent only. Nobody else reads or corrects it, so it drifts away from reality.
So we have one rule: the shared vault is the only memory. No agent keeps knowledge in a private store on the side.
How it is built
The vault is plain markdown files in a Git repository. I read and edit them in Obsidian, on my phone too. The agents read them as files.
- One folder per app. It holds an
AGENTS.mdwith the app’s rules and a shortMemory.mdthat only routes: purpose, boundaries and links. - The repository points into the vault. Every code repository has an
AGENTS.mdlinking to the app’s folder in the vault, and aCLAUDE.mdlinking toAGENTS.md. Whether an agent starts in the code or in the vault, it lands in the same rules. - Everything in its place. Tasks live in Beads. The code and its documentation for customers and auditors live in the repository. Decisions, architecture and standing rules live in the vault. History lives in Git.
The repositories and what actually runs are always the truth. The vault is the memory of why things are the way they are.
Most things should not be remembered
A note gets in only if all four conditions hold:
- It has to survive across sessions or agents.
- Its absence could lead to an expensive or unsafe mistake.
- It changes ownership, boundaries, safety, delivery or the state of the product.
- It has a source: a commit, a task, something running, or an explicit decision of mine.
Everything else stays where it belongs. No transcripts, no delivery logs and no inventories you could just as well look up in the code.
Short, and only what holds now
A note describes what holds today, not how we got here. When a decision changes, the note is rewritten and the old text deleted. Git remembers the rest.
Each kind of note has a ceiling:
| Kind | Lines | Words |
|---|---|---|
| Decision, architecture, user journey | 80 | 1,000 |
| Infrastructure | 40 | 500 |
| Operations | 120 | 1,000 |
When a note hits its ceiling, it is split by subject or something is removed. Every fact has one place, and other notes link to it instead of repeating it.
The platform’s vault was started on 5 August 2026 and has 2,804 commits. Today it holds about 200 notes, and more than 450 times a note has been deleted along the way. A memory that only grows ends up like a test suite that only grows: expensive to maintain and hard to trust. I wrote about that here.
A rule says what it protects
A rule without its reason gets applied where it doesn’t belong. It happened to us. A rule that the platform should not keep asking for changes over and over was made for one situation. The agents started applying it everywhere, and in some places stale state was never corrected as a result.
Since then every standing rule has had to carry its scope: the situation it was made for, my own words and the date. That way an agent can see where the rule applies and where it doesn’t.
When two rules disagree
With hundreds of notes, two of them will sooner or later disagree. In ours, one place said every push is qualified and another that the user journeys run only at night.
The rule for contradictions is simple. When the choice affects cost, releases, data, security or anything outside the system, the agent may not choose on its own. It stops before it changes anything, quotes both rules, explains what each path means and asks me. My answer wins over the stale rule, and the stale rule is fixed at once, so the next agent doesn’t fall into the same hole.
What an agent may not do is pick the rule it read last, or the one that is easiest.
A tool that keeps it honest
Before every commit to the vault a small check runs, doctor --strict. It checks the structure, the ceiling for each note, dead links and anything that looks like a secret. The name of a secret and where it is kept may appear in a note. The value never may.
There is also a search command, so an agent can find the relevant notes in seconds instead of reading everything. It doesn’t replace the required reading before work, but it finds what you didn’t know to look for.
Good examples from real code
Besides rules, the vault holds a set of good examples: short extracts of code showing how we solve a particular kind of problem. An example may only be updated from code that has landed and been tested, at an exact revision. When the codebase moved from C# to TypeScript, 34 examples that no longer matched the code were removed. A wrong example is worse than none, because the agents copy it.
The downside
- Reading costs. Every agent reads a number of notes before it starts. That takes time and tokens, which is why the ceilings matter.
- Agents write too much. Without ceilings and a check, notes turn into long accounts of what happened. It needs ongoing pruning.
- Parallel agents in the same files. When several agents edit at once, every change has to be committed and pushed immediately, and each agent may include only its own files.
- The memory can be wrong. A note is only as good as its source. That is why the rules say the repository and what runs always win over the vault.
The conclusion
Memory for AI agents is not a technical problem, it is an editorial one. Markdown and Git are enough. What makes the difference is the rules: what may get in, keeping it short and current, every rule saying what it protects, and an agent stopping to ask when two rules disagree.