Build in publicGuardrails, Agentic & Future-proofing9 min read

Why I built Lorekeep: an LLM wiki is fine until it is your business on the line

Karpathy published the pattern and left the human review optional. Four months of running it as the only source of truth for a working consultancy is what turned that option into a gate, and the gate into a plugin.

Answer first

Lorekeep is the plugin I extracted from four months of running an LLM-maintained wiki as the only source of truth for a working consultancy. The pattern itself is Andrej Karpathy's: raw sources, an LLM-owned wiki, a schema file, and the operations that keep them current. What the pattern leaves optional is human review, and that is the part that breaks in a business. Wrong answers are survivable. Confident answers nobody can trace are not. So the human loop became a gate, the gate acquired a ledger, and the whole thing became something other people can install.

In April I moved my entire operation into a folder of Markdown files. Clients, projects, decisions, half-formed ideas, all of it plain text in version control, all of it read by an agent that treats one small file at the root as its standing orders. I wrote that system up in June, in Building an LLM-native wiki, and if you want the tour of the vault itself that is the piece to read.

This one is about what happened next. Four months of running that vault as the only source of truth for a working consultancy taught me that the pattern has a soft spot, and that the soft spot is not technical. It is governance. Lorekeep is what I built to close it, and it is now open source under Apache 2.0.

The pattern I started with

The idea is Andrej Karpathy’s, published as an idea file on GitHub. Rather than retrieving chunks of raw documents at query time, which means the model rediscovers your knowledge from scratch on every question, the model incrementally builds and maintains a wiki that sits between you and the sources. Three layers: immutable raw sources, a wiki of Markdown pages the model owns, and a schema file that tells it how the wiki is structured. Three operations: ingest, query, lint.

the wiki is a persistent, compounding artifact

Andrej Karpathy, LLM Wiki

The reason it works is not clever retrieval. It is that the maintenance is the part humans quietly stop doing. Updating cross-references, noticing that a new source contradicts an old claim, keeping a summary current across forty pages: that is why internal wikis die. A model does not get bored, and it can touch fifteen files in one pass. The cost of maintenance falls close enough to zero that the thing stays alive.

I can confirm all of that from use. It is the best knowledge structure I have worked in, and the graph in the walkthrough video is a fair picture of what compounding looks like: a few dozen nodes in April, a dense web by summer.

The word the whole thing turns on

The gist lists the contexts the pattern suits. Personal tracking, research, reading a book, competitive analysis. Then there is the business one: an internal wiki maintained by language models, fed by chat threads, meeting transcripts, project documents and customer calls, possibly with humans in the loop reviewing updates.

Possibly. For a research vault or a book companion, that is exactly right, and the friction of approving every page would ruin it. For a business it is the whole ballgame. The document is honest about being abstract, and it is not trying to be a governance spec. But the moment the knowledge base holds what a client agreed, what a project assumes and what you told someone you would do, the optional review stops being a preference and starts being the control that makes the system usable as evidence.

A wrong answer is survivable. You notice it, you correct it. A confident answer that nobody can trace is a different animal, because there is nothing to correct against.

Three failures that built the gate

None of these are hypothetical, and none of them announce themselves. That is the point.

The newest source wins. Feed in a call transcript that contradicts a decision from three months ago and an unattended maintainer will reconcile it, because reconciling is its job. Sometimes the transcript is right. Sometimes it is one person misremembering on a Tuesday. Either way the old position is gone, and the vault now reads as though it was never held.

Facts with a shelf life get stored as though they are permanent. A model version, an API behaviour, a rate, a person’s role. Every one of those was true at capture, and nothing in a plain wiki distinguishes a fact from a fact that expires. Months later the page still states it flatly, and the agent still believes it, and so do you.

Canon becomes unarguable. This is the expensive one. When a rule sits in the schema file and nobody can say when it arrived or what it replaced, you cannot remove it safely, because removing it might break something you have forgotten. So it stays, and it outranks the agent’s own eyes on every task, forever.

What Lorekeep adds

Each fix is unremarkable on its own. Together they are the difference between a knowledge base you enjoy and one you can run a company on.

  • A promotion gate. Knowledge moves raw, then quarantine, then canon. Promotion is a rewrite a human accepts, never an automatic copy. A machine may draft it. Only a person passes it.
  • An append-only oplog. Every promotion and demotion is logged with its reason and what it reverses against. Why is this in canon now always resolves to an entry, and every entry can be rolled back. Past entries are never edited. Corrections are new entries.
  • Ripple as proposal. A contradiction surfaces as a diff into quarantine rather than a silent rewrite across related pages. The ripple proposes. The human disposes.
  • Index-first retrieval. Answers read the index, open only what it points to, and cite the raw source rather than a derived page, so the knowledge base can never end up citing itself and calling that corroboration.
  • A decay sweep with two boundaries. Machine-checkable claims (versions, paths, whether a URL is still alive) are checked automatically. Positional claims such as a stance or a style rule cannot be, so they carry a date and a review cadence instead. Sweeping both together means the checkable half never actually gets checked.
  • Precedence rather than a flat pile. Your canon outranks your skills, which outrank forks of third party tools, which outrank stock add-ons. An add-on you installed, including anything it injects at session start, never carries the weight of a decision you made.

There is a consent-first interview in front of all of it, because the other common design, watching the user and writing inferences straight into context, gets preferences right and commercial facts wrong. It asks. You answer. Nothing becomes authoritative without you.

What I did not invent

The pattern is Karpathy’s, and his gist credits a longer lineage: Vannevar Bush’s Memex from 1945, a private, curated store where the trails between documents matter as much as the documents. Bush could not solve who does the maintenance. That is the part that finally became tractable.

What is mine is the governance layer, and I have tried to be careful about the claim. The open core is the interview, the promotion gate, the oplog, index-first retrieval, ripple as proposal and the precedence order. Ship patterns, keep payloads. Your content is yours, never bundles with the plugin, and never leaves your machine.

Who should bother

If you are keeping a research vault or reading your way through a subject, use the pattern straight from the gist and enjoy the lack of friction. You do not need a gate to protect you from yourself.

If the knowledge has commercial consequences, if someone else will act on it, or if you will need to defend a position in six months, the gate is the feature. It costs about ten seconds a promotion and it is the only reason the vault is still trustworthy four months in.

Lorekeep is at github.com/PIE-AI-cmd/lorekeep, and the product page has the vault structure, the nine skills and the walkthrough video. If you would rather see what it does for an operation than how it is built, read running a business on a second brain. If you want to build your own from an empty folder, there is a step by step guide.


By Piers Butler, founder of Laurelin Labs. Source: LLM Wiki by Andrej Karpathy.

Frequently asked questions about ai knowledge base governance

Is Lorekeep just Karpathy's LLM wiki with extra steps?

It is the same pattern with the human review made compulsory rather than optional, plus the record-keeping that makes the review meaningful later. The gist is explicit that it describes an idea and not an implementation, and that on the business case humans in the loop are a possibility. Lorekeep is one opinionated instantiation of it, aimed at the case where the knowledge base has commercial consequences.

What actually goes wrong if the model maintains canon unattended?

Three things, in rising order of cost. Contradictions get resolved silently, so the newest source wins whether or not it should. Claims that were true when captured stay in canon after they expire, because nothing distinguishes a fact from a fact with a shelf life. And nobody can answer why a rule is in canon, so it cannot be argued with or removed. The output still reads confidently, which is what makes it expensive.

Why not just use a normal wiki, or a memory feature?

A normal wiki is written for people and dies of maintenance. Assistant memory features write inferences about you into context without asking, which is fine for preferences and wrong for commercial facts. Lorekeep sits between the two: a machine does the maintenance a human would abandon, and a human accepts every promotion an inference-based system would have made on its own.

Is the methodology yours?

No, and the plugin says so. The underlying pattern is Karpathy's LLM wiki, itself in the tradition of Vannevar Bush's Memex. What is mine is the governance layer built on top after running it in anger: the promotion gate, the append-only oplog, ripple as proposal, index-first retrieval and the precedence order. Those are the open core, under Apache 2.0.