kgai shared decision memory for dev teams

notes for dev teams · kgai.dev/blog

Memory as a file format is a good idea. Mutable files are the flaw.

The agent opens with confidence. It has read the memory page about the search index, and the page says the team pinned an older client version because of a serialization bug upstream. So the agent leaves the pin alone and works around it, adding a shim, writing a test for the shim. The pin was lifted in March. The page was edited twice since then, both times for wording, and nothing in the file says the upstream bug was fixed. You lose an afternoon to a sentence that was true once.

Cal Paterson's memoryfield proposal, which landed on Hacker News at 178 points, is a zip of Markdown pages with YAML frontmatter plus a SQLite vector index. The core argument holds up and deserves to be said more often: agent memory should be a file format, not a service. Open, greppable, portable, no vendor between you and your own notes. Anyone who has tried to get their team's context out of a hosted memory layer knows why that matters. The format instinct is correct.

The gap is validity. The spec is quiet about what should happen when a page stops being true. Frontmatter carries created and updated, which tell you a page changed and never tell you why it changed or what it used to say. That silence is not a flaw in the format's own terms, it is simply undefined territory, and it is where retrieval gets dangerous. A stale page is often the closest semantic match to your question, because it describes exactly the thing you are looking at. Similarity scores relevance. It has no opinion about truth.

kgai, which we build, is our answer to that specific problem, so read this part knowing where it comes from. The answer is not a graph, though there is one. It is a rule about writing: a record must never be silently overwritten. The store is an append-only, immutable decision log, projected deterministically into a small graph of the domain elements each decision touched. When the pin gets lifted, you do not edit the old record. You write a new one that supersedes it through an explicit link carrying the reason. The old record stays queryable, because dead ends are documentation, and so does the rejected shim.

Recall is lexical matching plus graph traversal, with no embeddings in the read path, and it returns only decisions in force. Capture happens at the write boundary, through a skill and hooks, which is the part that makes any of this survive contact with a real week. Team sync is opt-in through an S3 bucket you own, with per-writer shards so parallel writes never cause a textual conflict. No daemon, no server. A million decisions across thirty writers' shards still answer a decision lookup in about 100 ms, though recall and free-text search are slower. MIT, a Claude Code plugin plus a standalone kg CLI.

A file format is the right foundation. What it needs on top is a record of the repeal.

Try it on your repo. Two commands, MIT, nothing leaves your machine until you configure a bucket.

$claude plugin marketplace add kgaidev/kgai
$claude plugin install kgai@kgai-marketplace
★ Star on GitHub

See how kgai compares to other tools on the comparison page, or browse the other notes.