This is the build, in the order I would do it again. It assumes you want a knowledge base an AI agent maintains and you govern, rather than a notes app you will abandon in March. The pattern underneath is Karpathy’s LLM wiki; the governance on top is what four months of running one in a business taught me, written up in why I built Lorekeep.
You need three things: a folder, an agent that can read and write files on your machine, and the willingness to feed it. Nothing here requires you to write code.
Before you start
Decide one thing first, because it determines everything else: what is this vault for. A research vault, a business operating layer and a personal system are built the same way and filled completely differently. Write the answer in one sentence. You will paste it into the constitution file in step two.
Then pick where it lives. Local disk, always. If you want it on more than one machine, a private git remote or an encrypted drive, chosen deliberately rather than by drift. A vault holding client work is not a thing to sync casually.
Step 1: the folder
Three tiers, and the discipline is that they never blur into each other.
raw/holds sources exactly as captured. Transcripts, clipped articles, exports, notes you dictated. Nothing in here is ever edited. This is the tier every answer eventually cites.wiki/holds the pages the agent writes and maintains. Subfolders by kind, not by project:projects/,clients/,people/,decisions/,concepts/,tools/. Kind-based folders stay stable while projects come and go.CLAUDE.mdat the root is the constitution: the file the agent reads on every single task. Some agents call thisAGENTS.md. Same job.
Add a fourth if you intend to govern properly: quarantine/, where drafted pages and flagged contradictions wait for you to accept or reject them.
Then run three commands in the folder so you never lose it and can always see what changed:git init, git add -A, git commit -m "vault". This is the whole technical requirement of the project. My vault outlived the laptop it was created on because of those three commands.
Step 2: the constitution
This file is loaded as context on every task, so every word in it is paid for repeatedly. Keep it short and make it settled. Five sections is enough.
- Who and what. You, the business, what it does, in a paragraph.
- The structure. What each tier means and what belongs in it.
- The rules. The six in step four, stated plainly.
- Standing style. How you write, what you never write, brand terms and their spellings.
- Settled decisions. Only the ones that are actually settled, each with a date.
What must not go in: anything speculative, anything with an expiry date you have not set, and anything you are still arguing about. Canon outranks the agent’s own judgement on every task, so a stale line in here degrades every answer you get for as long as it sits there.
Step 3: the index and the log
Two files do the navigation work, and they are different jobs.
wiki/index.md is content-oriented: every page listed with a link and a one-line summary, grouped by kind. The agent updates it on every ingest and reads it first when answering. At a few hundred pages this genuinely removes the need for embedding-based retrieval infrastructure, which is a much bigger deal than it sounds.
wiki/oplog.md is chronological and append-only: what changed, which direction it moved, from what source, why, and what it reverses against. Start each entry with a consistent prefix and the file stays greppable forever. This is the file that lets you answer why is this in canon, and it is the one people skip.
Step 4: the six rules
These are the difference between a wiki that ages well and one that quietly starts lying. Put them in the constitution verbatim.
- Capture verbatim. Raw is immutable. Summarise into the wiki, never over the source.
- Promote by rewrite. Nothing reaches canon as a copy. A machine drafts, a human accepts.
- Log every promotion. No entry, no canon. A page in canon with no ledger entry is a finding, not a fact.
- Cite raw, not derived. An answer that cites a summary of a summary is a knowledge base agreeing with itself.
- Contradictions become proposals. When a new source disagrees with canon, surface the diff. Never let it rewrite the pages around it unattended.
- Dates on anything perishable. Versions, rates, roles, prices. If it can expire, it carries a captured date and a review cadence.
Step 5: the loop that keeps it alive
Four operations, and you will do the first two daily and the others on a rhythm.
- Ingest. Drop a source into
raw/and tell the agent to process it. It reads, discusses the takeaways with you, drafts a summary page, updates the index, and touches every related page. One source often touches ten to fifteen pages, which is exactly the work you were never going to do by hand. - Query. Ask questions of the vault rather than of the model. The important habit: when an answer is good, file it back as a page. Otherwise your best thinking evaporates into chat history.
- Promote. Review what is sitting in quarantine and accept or reject. Ten seconds each. This is the gate.
- Verify. Weekly or monthly, sweep for broken links, orphan pages, contradictions, stale claims and promotions with no log entry. Treat the findings as proposals, not fixes.
Step 6: tools worth adding
In rough order of return. None are required on day one.
- Obsidian, for the graph view more than the editing. Seeing which pages are hubs and which are orphans tells you where the knowledge actually is. The video on the Lorekeep page is that graph growing over a few months.
- A web clipper that converts articles to Markdown, so capturing a source is one keystroke rather than a chore you skip.
- Local search, once the index alone stops being enough. Hybrid keyword and vector search over Markdown, on-device, exposed so the agent can call it.
- Frontmatter and queries. If the agent stamps pages with YAML frontmatter, dynamic tables over that metadata come almost free.
- Scheduled sweeps. Anything that runs the verify pass on a cadence without you remembering, because you will not remember.
If you would rather not assemble the governance yourself, that is what Lorekeep packages: the interview, the gate, the oplog, the sweep and the precedence order, as nine skills you install. It is Apache 2.0 and it captures nothing.
The first month, realistically
Week one is structure and it feels like admin, because it is. Weeks two and three you will wonder whether it is worth it, and the honest answer at that stage is not yet. Somewhere around thirty to fifty ingested sources it turns: the vault starts answering things you would have gone looking for, and you stop having to remind yourself to use it.
Measure sources ingested and pages promoted, not hours spent. One real source a day beats a weekend of restructuring.
How it fails
Two ways, and I have done both.
The empty cathedral. An elaborate structure, beautifully organised, containing almost nothing. Structure is cheap and feels productive. Feeding is the work.
The ungoverned vault. Letting the agent write straight into canon because the gate is slower. It works beautifully for about six weeks. Then a rule appears that nobody can date, contradicting something you know you decided, and you have no way to tell which one is real. The gate feels like friction in week one and is the entire value in month six.
By Piers Butler, founder of Laurelin Labs. Pattern source: LLM Wiki by Andrej Karpathy. For what this looks like across a business, read running a business on a second brain.