An LLM wiki is a folder of Markdown pages that a language model writes and keeps current from your sources. Instead of searching raw documents at every question, as RAG does, the model reads each source once, files what it learned into linked pages, and revises them as new sources arrive. Andrej Karpathy described the pattern in April 2026.
What is an LLM wiki?
An LLM wiki is, in Andrej Karpathy's words, "a pattern for building personal knowledge bases using LLMs." A language model builds and maintains a wiki of interlinked Markdown files that sits between you and your raw sources. You choose the sources and ask the questions; the model does the summarizing, cross-referencing and filing.
Karpathy published it on 4 April 2026 as an idea file: a GitHub gist meant to be pasted into your own agent, such as Codex or Claude Code, which works out the specifics with you. It has three layers:
- Raw sources. Articles, papers, images, data files. The model reads them and never changes them.
- The wiki. Markdown pages the model writes and owns: summaries, entity and concept pages, comparisons, a synthesis.
- The schema. An instructions file, such as
CLAUDE.mdfor Claude Code orAGENTS.mdfor Codex, that sets the structure, the conventions and the workflows.
Three operations act on them. Ingest: the model reads a new source, writes a summary page and updates the related pages, the index and the log; one source may touch 10 to 15 pages. Query: it reads the relevant pages and answers with citations; good answers can be filed back. Lint: it checks for contradictions, stale claims and orphan pages.
index.md lists every page with a one-line summary, and the model reads it first to answer; log.md is an append-only record of what happened. Karpathy keeps the agent on one side and Obsidian on the other: "Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase."
How is an LLM wiki different from RAG?
An LLM wiki differs from RAG in when the work is done. RAG retrieves chunks of your raw documents at every question and pieces the answer together again each time. An LLM wiki processes each source once, at ingest, into readable notes that the model keeps current, so knowledge accumulates instead of being rediscovered at every query.
| RAG | LLM wiki | |
|---|---|---|
| When the knowledge is processed | At every question: relevant chunks are retrieved from the raw documents | Once per source, at ingest, then kept current |
| What you can inspect | Chunks of your documents and their embeddings, with no written synthesis to read or correct | A folder of Markdown pages you can read, correct and keep in git |
| What a question costs | Combining retrieved fragments again, every time | Reading pages whose synthesis is already written |
| What adding a source costs | Mainly computing embeddings | LLM calls to summarize the source, file it and update pages |
| How it grows | More chunks in the index | Existing pages are revised; each filing decision reads a longer index |
At moderate scale an LLM wiki needs no vector database: in Karpathy's version the model reads index.md to find pages, and he suggests a search engine, such as qmd, only as the wiki grows. RAG makes adding a document cheap; an LLM wiki pays for LLM calls up front, so later questions read finished notes.
What goes wrong when an LLM wiki grows?
As an LLM wiki grows, its decisions get more expensive. Many of the model's calls go to deciding, not writing: where a new source belongs, which notes it relates to, which notes answer a question. Each decision reads a list of folders or notes that lengthens as the wiki fills.
Karpathy marks the limit: the index works "surprisingly well at moderate scale," about 100 sources and hundreds of pages, and beyond that he suggests proper search. The CROW paper by Federico Cesarini and Marco Sassarini explains the cost: each ingest call reads the index alongside the new source, so while the index is read in full, building a large wiki costs more than linearly.
In the paper's benchmark of 525 documents (the authors' own measurements, on a private corpus), an LLM taking every decision spent 71.8% of its LLM tokens on decisions, and its LLM tokens per document grew by 1,197 for every 100 notes already in the wiki. It found the right note in 75% of asks on the smallest wiki and 55% on the largest, as the wiki grew from 26 to 525 documents.
That baseline is not Karpathy's agent loop but an LLM making the same decisions in CROW's fixed pipeline. The paper lists the comparison with the agent loop, and with the hybrid search the gist suggests, as work still to do.
How does CROW keep an LLM wiki fast and cheap?
CROW (Classifier-Routed Organization of LLM Wikis) keeps an LLM wiki fast and cheap by separating deciding from writing. A small typed classifier takes the routing decisions: which folder a source goes to, which note it matches, whether to merge, which notes to link. The LLM writes the summaries, merged notes, folder names and answers.
The classifier answers typed questions (pick one of these options; is this statement true?) with probabilities instead of prose. The paper and llm-wiki-v2 use Jev, by TypeSafe AI, but any classifier that returns such probabilities can replace it. When it is unsure or fails, the LLM decides, or a safe default applies (a new note rather than a merge). At the paper's list prices a classifier token cost 7 to 29 times less than an LLM token.
The paper measured CROW on 525 personal documents, against an LLM taking the same decisions in the same pipeline. These are the authors' own measurements on one corpus, mostly in Italian, with one LLM (DeepSeek V4.1 Flash) and one classifier version (Jev 1.13); the corpus is private and is not in the repository's benchmarks/ folder.
- Right note read: 89.2% of asks, against 61.8%; 90% at both the smallest and the largest wiki.
- About 2.1 times faster ingest: 18.4 s per document on average, against 38.6 s.
- 68% fewer LLM tokens: 2.89 million against 9.10 million.
- 0.47 times the cost: $2.62 against $5.62 at list price, the classifier's $0.19 included.
A hit means the right note was read, not that the answer was correct, and the retrieval thresholds were set on questions from some of the same documents (on 9 questions from documents not used to set them, 77.8% against 69.4%, too few to settle it). CROW is a decision layer: it does not compile entity pages or run lint.
Since the paper, llmwiki2 1.0.0 finds a question's candidate notes with the wiki's own search, and the classifier reorders them. Measurements on public corpora, with the scripts to run them again, are in benchmarks/.
How do I build an LLM wiki?
You can build an LLM wiki in three ways. By hand, you paste Karpathy's idea file into a coding agent and grow the wiki together. With a little setup, the llmwiki2 Python engine files documents and answers questions from a web page, a command line or a library. With no code, Crow is a desktop LLM wiki app.
By hand, with an agent and Karpathy's idea file
The original way, with the most control. The gist is written for an agent such as Codex, Claude Code or OpenCode:
- Paste the gist into your agent and set up the wiki together.
- Keep your sources in a raw folder the model reads and never edits.
- Agree on the schema file: page types, conventions, and the ingest, query and lint workflows.
- Ingest one source at a time at first, and read what the model writes.
- Ask questions, file the good answers back, and lint now and then.
Keep Obsidian open to watch the pages appear. Past about a hundred sources, plan for search.
With llmwiki2, the Python engine
llm-wiki-v2 is the open-source engine by Federico Cesarini and Marco Sassarini, on PyPI as llmwiki2 (1.0.0, 10 November 2026). Drop PDF, Word, Excel or text files on its web page: each lands in a folder, merged with what the wiki knows, and answers cite their notes. It runs with OpenRouter, OpenAI, Gemini, Ollama or any OpenAI-compatible server, on Python 3.11 or later.
pip install llmwiki2 llmwiki2
Your browser opens: pick a provider, paste its key, press Test connection, then Save and start. uvx llmwiki2 demo opens an example wiki with no key. More on the llmwiki2 page.
With Crow, the desktop app, no code
Crow is a free desktop app for macOS, Windows and Linux that runs the CROW architecture of llm-wiki-v2. It finds the documents on your computer by itself and works with any model on OpenRouter.
- Download Crow and install it. The builds are not signed yet; how to open them is next to the downloads.
- Pick the folders Crow should read, or single files.
- Press Connect. OpenRouter opens in your browser: sign in (or make an account), press Authorize, and Crow gets a key of its own on your account.
- Choose a model, check the cost, and start. You can chat with the wiki while it grows.
To see a finished wiki first, explore an example brain in your browser.
Can I open an LLM wiki in Obsidian?
Yes, an LLM wiki opens in Obsidian, because it is a folder of plain Markdown files. Karpathy's gist uses Obsidian as the viewer and its graph view to see the wiki's shape. The wikis that Crow and llmwiki2 write have relative links and an index.md in every folder, so Obsidian opens them as a vault, graph view included.
Their format is derived from Google's Open Knowledge Format (OKF) v0.2. Each note has YAML frontmatter (type: Note, a title, a one-line description, its sources); related notes share a See also section; raw/ keeps an untouched copy of every source; log.md records what changed. Crow doesn't need Obsidian.