Guide

LLM wiki: how to build one and keep it accurate

An LLM wiki is a folder of interlinked markdown pages that an AI agent writes and maintains from your raw sources, steered by a schema file like CLAUDE.md or AGENTS.md. Here's how to set one up, and how to keep what the agent writes accurate, with git or in Knowtarium.

By Fadel Kaadan · Updated

What is an LLM wiki?

An LLM wiki is a personal knowledge base that an AI agent writes for you. You collect raw sources (articles, papers, transcripts, notes) in a folder. The agent reads them and maintains a set of interlinked markdown pages on top: one page per concept, person or source, plus an index. When you add a source, the agent updates every page it affects. When you ask a question, it answers from the wiki and can file the answer back as a new page.

The idea comes from Andrej Karpathy. On April 2, 2026 he posted on X about "LLM Knowledge Bases", and two days later he published a longer version as an "idea file" on GitHub, written to be pasted straight into an agent such as Claude Code or Codex. His contrast is with RAG, where a model retrieves chunks of your files on every question and nothing builds up. In an LLM wiki the knowledge is "compiled once and then kept current", so cross-references and contradictions are already worked out before you ask.

Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.

That line from the gist sums up the setup most people copy: the agent open in a terminal on one side, a markdown editor on the other, and a folder of files between them. Nothing about the pattern needs a particular editor, though. Any folder and any agent that can read and write files will do.

What an editor doesn't tell you is which pages the agent changed, and whether anyone has checked them. Knowtarium is an end-to-end encrypted knowledge base built for that setup. Your wiki lives in a workspace as plain markdown pages, your agent reads and writes it over MCP, and every page it changes is signed, shows who made it and can be undone. It's free to start. The rest of this guide covers the setup in plain files, with notes along the way on how Knowtarium handles it.

Three layers, three operations

Karpathy describes the LLM wiki pattern in three layers:

  • Raw sources. Your curated documents. They're immutable: the agent reads them and never changes them. This is your source of truth.
  • The wiki. A directory of markdown pages the agent writes: summaries, entity pages, concept pages, comparisons, an overview. "You read it; the LLM writes it."
  • The schema. A file such as CLAUDE.md for Claude Code or AGENTS.md for Codex that tells the agent how the wiki is organised and which workflows to follow. You and the agent refine it over time.

And three things you ask the agent to do:

OperationWhat the agent does
IngestReads a new source, discusses it with you, writes a summary page, updates the concept and entity pages it touches, the index and the log. One source can touch 10 to 15 pages.
QueryReads the index, opens the relevant pages and answers with citations. Good answers become new pages, so your questions add to the wiki too.
LintA periodic health check: contradictions between pages, claims newer sources have replaced, orphan pages, concepts that deserve their own page, missing links.

Two files keep it navigable. index.md lists every page with a link and a one-line summary, and the agent reads it first on every query. Karpathy notes this works "surprisingly well" at moderate scale (around 100 sources and hundreds of pages) without any embedding search. Past that, the gist suggests giving the agent a local search tool over the markdown files. log.md is a timeline of ingests, queries and lint passes.

In Knowtarium

An LLM wiki is close to an OKF bundle already: a folder of markdown files where index.md and log.md are reserved names. Import the wiki folder into a Knowtarium workspace as it is, including pages with missing fields. Its full-text search covers every page as you type, for the times you want to look something up without asking the agent, and it runs in your browser, because we can't read your pages.

How to set up an LLM wiki, step by step

The gist is deliberately abstract and leaves the details to you and your agent. Here is a concrete version that works with Claude Code, Codex or Cursor. It takes about half an hour, most of it spent on the schema.

1. Create the folders

Keep sources and the wiki apart, so it's always clear which text came from the world and which from the agent.

folder layout
customer-wiki/
CLAUDE.md # the schema (or AGENTS.md for Codex)
raw/ # your sources: the agent reads, never edits
2026-09-12-interview-northwind.md
2026-09-14-support-tickets.md
assets/ # images downloaded next to clipped articles
wiki/ # the agent's pages
index.md # one line per page, read first on every query
log.md # what happened and when
overview.md
concepts/
entities/
sources/ # one summary page per raw source
answers/ # good answers, filed back in

In Knowtarium

Import customer-wiki/ into a Knowtarium workspace and its folders come along. The graph shows what's gone stale (with review on, it can colour pages by trust tier), and links to pages the agent hasn't written yet appear as ghosts: a to-do list for the next ingest.

Knowtarium's graph coloured by freshness: two stale notes, two going stale soon, five fresh, and ghost links to Competitors and Incident log, notes nobody has written yet (opens full size in a new tab)Knowtarium's graph coloured by freshness: two stale notes, two going stale soon, five fresh, and ghost links to Competitors and Incident log, notes nobody has written yet (opens full size in a new tab)
The graph of a demo workspace coloured by freshness, with two ghost links. Select it to open it full size.

2. Put it under git

Run before the first ingest. Karpathy points out the wiki "is just a git repo of markdown files", and git is also the cheapest way to see what the agent changed. More on that below.

3. Write the schema file

This is the most important file in the setup. Start short and add a rule each time the agent does something you didn't want. Anthropic's guidance for CLAUDE.md applies here: keep it under about 200 lines and make each instruction concrete enough to check. If you use several agents, write it once as AGENTS.md and add a CLAUDE.md that contains @AGENTS.md, so Claude Code loads the same rules.

CLAUDE.md
# Wiki schema
You maintain the wiki in wiki/. The sources in raw/ are read-only.
## Pages
- One concept, entity or source per file. Filenames in kebab-case.
- Every page starts with frontmatter: type, title, description, sources.
- Link related pages with standard markdown links.
- Every claim cites its source with a footnote keyed by source id.
- If you can't cite it, don't write it. Mark open questions as such.
## Ingest (when I add a file to raw/)
1. Read the source. Tell me the 3 to 5 key points before writing.
2. Write wiki/sources/<name>.md with a summary and its source id.
3. Update the concept and entity pages it touches. Flag contradictions
with existing pages instead of silently overwriting them.
4. Update wiki/index.md and add an entry to wiki/log.md.
5. List every file you changed.
## Query
- Read wiki/index.md first, then open only the pages you need.
- Answer with citations. Offer to file good answers in wiki/answers/.
## Lint (when I ask)
- Report contradictions, stale claims, orphan pages, missing pages
and claims without a source. Propose fixes; don't apply them yet.

Two rules in there matter more than they look: "every claim cites its source" and "list every file you changed". They cost nothing now and they make the review step possible later.

In Knowtarium

Connect your agent with and it works on the wiki through MCP tools, with Knowtarium's conventions included: read the workspace's own index.md first, where it has one, read titles and descriptions before whole pages, and never mark anything as checked by a person. Your schema keeps the wiki's own rules. Every change the agent makes is signed with its own key, so you don't have to ask it to sign.

4. Add one source and ingest it

Save an article as markdown in raw/ and ask the agent to ingest it. Karpathy prefers to ingest one source at a time and stay involved: read the summary, check the updates, tell the agent what to emphasise. Do that for the first ten sources at least. It is how you find out what your schema is missing.

In Knowtarium

Every page the ingest writes or changes is marked in the sidebar until you open it, with a line under its title saying which agent edited it and when, a link to the changes and an Undo. Read the summary and the updates there, and undo anything you don't want. If you'd rather approve first, turn on review ("Ask me first") for the wiki/ folder, and each change waits for you as a diff.

A Pricing note in Knowtarium: under the title, Edited by Claude Code on my laptop with See changes and Undo, then its frontmatter as properties: description, tags, status, owner, stale_after and type (opens full size in a new tab)A Pricing note in Knowtarium: under the title, Edited by Claude Code on my laptop with See changes and Undo, then its frontmatter as properties: description, tags, status, owner, stale_after and type (opens full size in a new tab)
A page an agent just edited, in a demo workspace: the line under the title, then the page's properties. Select it to open it full size.

5. Ask questions and keep the good answers

Ask across sources, not just about one. When an answer is worth keeping, have the agent file it in wiki/answers/ and link it from the pages it draws on.

prompts
# ingest one source
> Ingest raw/2026-09-14-support-tickets.md. Show me the key points first.
# ask, then keep the answer
> Using the wiki only, where do new customers get stuck? Cite pages.
> File that as wiki/answers/onboarding-blockers.md and link it.
# health check
> Lint the wiki. Don't change anything yet, give me a list.

6. Lint on a schedule

Once a week, or after every ten ingests, ask for a lint pass. Ask for a report first and approve fixes separately, so a health check can't quietly rewrite half the wiki. A consistent prefix in the log makes it easy to see what happened recently:

wiki/log.md
## [2026-09-14] ingest | Support tickets, August
## [2026-09-15] query | Where do new customers get stuck?
## [2026-09-20] lint | 2 contradictions, 4 orphan pages
terminal

In Knowtarium

Fixes from a lint pass are changes like any other: signed, listed under Edited by agents on the workspace page, and undoable one by one, or waiting for your approval in a folder with review on. The Stale and expiring page lists pages past their stale_after date, which leaves the lint pass free to look for contradictions and missing pages.

The gap: nobody checks what the agent wrote

The LLM wiki pattern makes maintenance nearly free. That's the point, and it's also the risk. The agent can touch 15 pages in one pass, and in most setups nobody reads those 15 changes. Karpathy himself stays involved when he ingests, and for team wikis he mentions "possibly with humans in the loop reviewing updates". Most tutorials skip that part. Here is what piles up when you skip it:

  • Drift from the source. A summary of a summary loses a qualifier. "In some benchmarks" becomes "consistently", and three pages later it's a fact.
  • Unsourced synthesis. The agent connects two ideas in a sentence that reads well and cites nothing. You can't tell it apart from a sourced claim.
  • Silent resolution of contradictions. A new source disagrees with an old page, and the agent picks a winner instead of flagging it.
  • Stale pages that look fresh. A page written in May reads the same in December. Nothing says it's due for a check.
  • Your own edits go out of sync. You fix a number on one page. The five pages that repeat it still have the old one.
  • The linter grades its own homework. Lint is the same kind of model reading the same pages. It catches contradictions between pages, not errors that every page agrees on.

None of this makes the pattern a bad idea. It means an LLM wiki needs the same thing any codebase written by one author needs: a second pair of eyes, and a record of who wrote what.

In Knowtarium

Knowtarium is built around this gap. Every change is signed by whoever made it, so you always know which text came from the agent, and any change goes back in one click. Where you want a second pair of eyes before anything changes, turn on review for a folder: the agent's changes wait for your approval, and your own edits wait for an agent to compare them with everything connected.

How to keep an LLM wiki accurate

Four habits close most of the gap. You can adopt them one at a time, in plain files, with no new tools.

1. Record provenance in the frontmatter

Every page should say who wrote it, when, and from which sources, and every claim should point at one of those sources. Footnotes keyed by a source id ([^northwind-call]) survive the agent reordering the list, which numbered footnotes don't. Here's a page using the field names of the Open Knowledge Format, so other tools can read them too:

wiki/concepts/import-drop-off.md
---
type: Concept
title: Import step drop-off
description: Why new customers stall when importing their data.
generated: { by: claude-code/2.1, at: 2026-09-20T09:12:00Z }
verified:
- { by: human:sam, at: 2026-09-20T18:40:00Z }
stale_after: 2027-03-20T00:00:00Z
sources:
- id: northwind-call
resource: /raw/2026-09-12-interview-northwind.md
title: Customer interview, Northwind Traders
---
Northwind stalled for a week on the CSV import.[^northwind-call]

generated is who wrote the current text. verified is who checked it, and the human: prefix marks a person. Add a line to your schema: "sign every page you change in generated, never add yourself to verified". Our guide to making agents cite their sources goes further.

In Knowtarium

Knowtarium shows the frontmatter as properties at the top of the page instead of raw YAML: who wrote the page (and, in folders with review on, who checked it), when it expires and where it came from. Agents can't mark anything as checked by a person, so a page can't claim a review it never had. Custom keys you add stay as you wrote them.

2. Review every agent change before you rely on it

Treat an ingest like a pull request. Commit before you start, let the agent work, then read the diff and accept or reject it. Git does this well:

terminal

Don't read every page. Read the lines that changed, and check each new claim against the footnote it cites. When you approve a page, add yourself to verified with the date. The full routine is in how to review agent edits.

In Knowtarium

Knowtarium doesn't need a commit as a starting point: every version is kept (for as long as you choose, up to a year) with the signed change that made it, so the page's history lists each change with who made it, See changes shows an agent's edit as a diff, and you can restore an earlier version. In a folder with review on, the change waits as a diff until you approve it, and the agent can't skip that step.

3. Have the agent check your edits

The review should run both ways. When you change a page by hand, ask the agent to find every page that links to it, cites the same source or repeats the old value, and to propose fixes for those pages. You then review the fixes like any other agent change. This is how your correction reaches the other five pages.

In Knowtarium

You can edit any page in Knowtarium, and the edit is signed as yours. In a folder with review on, it waits until you ask your agent to check it, for example "check today's edits": the agent follows links, shared sources and mentions of the old value, records its check or flags a conflict, and its fixes to other pages are signed and undoable like any change. The app itself never calls an AI.

4. Give pages an expiry date

Add stale_after with an absolute date: short for prices, versions and people's roles, long for definitions. A lint pass can then list pages past their date instead of guessing. Staleness becomes a date comparison, not a judgement call.

Add to your schema

Sign what you write in generated. Never add yourself to verified. Cite every claim with a footnote keyed by source id. Set stale_after on new pages. After I edit a page, check the pages linked to it and propose fixes; don't apply them.

Where OKF fits

The Open Knowledge Format is an open specification published by Google Cloud for knowledge that agents write. Version 0.2 added trust signals for exactly the case above: corpora written continuously by agents and read by other agents. An OKF bundle has the same shape as an LLM wiki (a folder of markdown files with YAML frontmatter), and it reserves the same two filenames, index.md and log.md.

LLM wiki habitOKF field or rule
Who wrote this pagegenerated: { by, at }
Who checked itverified, a list of { by, at } entries
Which sources it came fromsources with an id per source, cited as [^id] footnotes
When to recheck itstale_after, an absolute date
Pages that don't exist yetBroken links are allowed: they may be knowledge nobody has written yet

Readers derive a trust tier from verified: no entries means unverified, only agents or processes means machine-confirmed, and at least one person means human-reviewed. A page never gets to declare itself trustworthy. Two small differences from the gist: the gist doesn't fix a link syntax, while OKF uses standard markdown links; and OKF's log.md lists the newest entries first, under plain YYYY-MM-DD date headings. Every field is optional, so you can start an LLM wiki in OKF and add the trust fields as you go.

In Knowtarium

Knowtarium reads these fields and lists a page on its Stale and expiring page once it's past its date. In folders with review on, it can colour the graph by trust tier and adds one state on top: fully verified, once a person and an agent have both checked the page after its last change. Your agents and the app fill in the fields, so you don't write the YAML by hand.

Run your LLM wiki in Knowtarium

Git is the baseline: it shows you what changed, if you commit before each session and read the diff after. Knowtarium is the setup we recommend once the wiki grows, because it keeps the history, the undo and the trust state next to the pages instead of in your terminal. Here is how the two compare.

Git aloneKnowtarium
See what the agent changedgit diff, if you commit before each sessionEach change an agent saves signed and marked on the page, with See changes for the diff
Undo a bad changegit restore, if you committed firstOne click, per change
Who wrote and checked a pageBy reading the frontmatter yourselfWho wrote it at the top of every page; with review on, who checked it and the graph coloured by trust tier
Your edits checked by an agentIf you remember to askIn folders with review on, waits until your agent checks it
Pages past their dateA lint pass, if you run oneListed on the Stale and expiring page
Where the wiki livesPlain files on your computerAn end-to-end encrypted workspace, exported as plain markdown whenever you like
PriceFreeFree with 500 MB and one workspace; Starter $5.99 a month for 2 GB, Pro $11.99 a month for 10 GB; two months free billed yearly

If you ingest a few sources a week and read every diff, git alone can be enough. Knowtarium is a web app: your pages are encrypted on your device before they reach us, so we can't read them, and it doesn't call an AI itself. The agent you connect sees what it reads. If your wiki already lives in an Obsidian vault, import it into a workspace and it's converted to OKF without touching your writing; the migration guide walks through it, and the comparison page covers how the two apps differ.

Questions

What is an LLM wiki?

A folder of interlinked markdown pages that an AI agent writes and maintains from your raw sources, following rules in a schema file such as CLAUDE.md or AGENTS.md. Andrej Karpathy described the pattern in April 2026.

How is an LLM wiki different from RAG?

RAG retrieves chunks of your raw files at question time and builds nothing up. An LLM wiki compiles the sources into pages once, keeps them updated as new sources arrive, and answers from those pages, so cross-references and contradictions are already worked out.

Do I need Obsidian for an LLM wiki?

No. The wiki is plain markdown in a folder, so any editor can open it, and the agent only needs file access. Knowtarium, an end-to-end encrypted web app, can hold the same wiki: import the folder into a workspace and connect your agent over MCP, and every page shows who wrote it and what changed (and, in folders with review on, who checked it).

Which agent should maintain the wiki?

Any agent that can read and write files in a folder: Claude Code, Codex, Cursor and others. Codex and Cursor read AGENTS.md, Claude Code reads CLAUDE.md (or AGENTS.md when there is no CLAUDE.md), and one file can import the other so every agent follows the same schema.

How big can an LLM wiki get?

Karpathy reports that an index file works well at around 100 sources and hundreds of pages. Past that, give the agent a local search tool over the markdown files so it doesn't have to read the whole index.

How do I stop the agent from adding errors to the wiki?

Require a cited source for every claim, record who wrote and who checked each page in the frontmatter, review each ingest as a diff before you rely on it, have the agent check your own edits against linked pages, and give pages an expiry date.

Can I run an LLM wiki in Knowtarium?

Yes. Import the wiki folder into a workspace, connect your agent with npx knowtarium connect, and it keeps ingesting over MCP. Every page it changes is signed, shows who made it and can be undone in one click; turn on review for a folder if you'd rather approve changes first. The pages are end-to-end encrypted, and you can export them as plain markdown whenever you like.