Point an LLM at a folder of documents and the default answer is RAG: chunk, embed, retrieve at query time, generate. It works. But notice what it is doing on the tenth question that it also did on the first — finding the relevant fragments, noticing how they relate, reconciling them into an answer. That reasoning is real work. And when the chat closes, all of it evaporates.
The LLM Wiki pattern moves that work to a different moment. When a source arrives, the LLM reads it and integrates it — writes a summary page, updates the entity pages it touches, revises the topic synthesis, notes where it contradicts something already on file, strengthens the links. One source might touch ten to fifteen pages. Then queries are answered against the wiki, not against the raw documents.
Stated as an update rule, the contrast is sharp. RAG's state never changes; the wiki's state is the whole point.
A RAG index and a wiki both sit between you and your documents, and it is tempting to call them the same kind of object. They are not. An index is derived and disposable — delete it, rebuild it, nothing is lost, because it makes documents findable without knowing anything about them. A wiki is authored and durable: it contains claims, judgements, reconciliations. Losing it loses something.
RAG's index is derived and disposable; a wiki is authored and durable — which is why one can be regenerated for free and the other cannot.
The obvious reading of §01 is that the wiki saves you the cost of re-reading. That is true and it is the least interesting benefit. Shrink the corpus until cost vanishes — fifteen documents, the whole thing fits in context, free, every time — and ask what is still lost.
What is lost is the discovery. Somewhere in there, document 12 quietly contradicts document 3. An agent reading all fifteen may notice. Tomorrow, on a related question, it must notice again — and nothing guarantees that it will. So the un-ingested setup isn't merely wasteful. It is non-reproducible: the same corpus and a similar question can yield a differently-reasoned answer each time, with no way to tell which pass was the careful one.
This is why the pages are almost incidental. A page is a summary; you could regenerate it from its source without much loss. But the links — this supersedes that, these two conflict, this entity appears in both — encode reasoning that was expensive to produce and that no single source contains. Delete the edges and the sources cannot cheaply give them back.
This also explains a structural choice that otherwise looks like laziness: the pattern has no taxonomy, no enforced folder hierarchy, no category tree that must be designed up front. Categories are allowed to emerge as clusters of cross-links. If the links carry the knowledge, then the graph is the structure, and imposing a hierarchy on top of it would only constrain what the graph is free to discover.
Pages are regenerable; edges are not — the wiki's value is the reasoning stored in its links, which is why the graph is the structure and no taxonomy is needed.
The pattern has three layers, and its entire discipline comes from one rule: evidence and inference never share a writer. You own raw/; the LLM owns the wiki. The schema is the one layer you build together — it is not evidence, so joint authorship costs nothing there.
Now relax the top rule in a way that sounds actively helpful. While ingesting a German letter, the agent appends its English translation and a clarifying note directly into the source file. Nothing is deleted. The information is strictly greater. It sits right next to the thing it explains.
Three months later the agent opens that file and cannot tell which sentences came from the Ausländerbehörde and which it wrote itself in March. It treats its own prior inference as ground truth and reasons from it. The failure is worse than an ordinary hallucination, because an error does not merely persist — it gets laundered into evidence and then compounds. The wiki now has a self-confirming loop, and no signal that anything is wrong.
And you have lost something you may not have known you had. With raw/ clean, the wiki is a pure function of sources and schema — so you can delete the whole thing and rebuild it.
For a corpus of legal or medical documents this is not abstract. Contaminate raw/ and you permanently lose the ability to answer the only question that ultimately matters: what did the letter actually say?
Keep raw/ immutable not for tidiness but for reversibility — it is what makes the wiki a pure function of its sources, and therefore always safe to delete and rebuild.
The schema is the layer people skip, and the one that decides whether the wiki survives past session three. It is an ordinary markdown file — CLAUDE.md, AGENTS.md — stating how pages are named, what a page must contain, how an ingest proceeds, what gets logged, what must never happen. In Karpathy's phrasing it is what makes the LLM a disciplined wiki maintainer rather than a generic chatbot.
Suppose you skip it. All three layers are otherwise correct: immutable sources, a real linked wiki. You simply explain what you want at the start of each session, in chat, and the agent complies well. Every individual session looks fine. Nothing errors, ever.
What happens over six months is drift. March files residence material under visa.md; September, having been briefed slightly differently, creates residence-permit.md. Page formats diverge, link conventions diverge, granularity diverges. The wiki stratifies into geological layers by session, and the duplicate pages do not know about each other.
And this is the trap: you never get an error. You get a confident, well-cited, incomplete answer. The agent looks where the current convention says to look, finds three relevant pages, misses the four filed under March's convention, and synthesises fluently from what it found. Silent incompleteness is the worst failure a knowledge base can have, precisely because it is indistinguishable from success.
Two consequences worth holding. First, this is what lint exists to catch — orphans and near-duplicates are exactly its quarry (§05). Second, the schema is what makes the rebuild guarantee of §03 actually worth something: immutable sources mean you can rebuild, but only an explicit S means you would rebuild the same wiki. Without it, Compile returns a different artifact every time you run it.
Un-written conventions fail silently — not by breaking queries, but by answering them confidently from half the wiki.
The schema encodes three operations. Two are obvious; the third is the one humans never perform, and the interesting detail lives in an arrow between the first two.
Ingest is a conversation, not a batch job. Karpathy's own preference is one source at a time, staying involved: read the summary, check the updates, steer what gets emphasised. You can batch-ingest with less supervision, but the wiki's quality is set at ingest time, so that is exactly where supervision buys the most.
Query is where the ★ arrow matters. A comparison table you asked for, a connection you spotted, an analysis that took real work — by default these die in chat history. Filing them back as pages means your explorations compound the same way your sources do. Without that arrow the wiki only ever grows by what you feed it, never by what you figure out.
Lint is the operation that explains why human wikis rot and LLM wikis need not. Nobody re-reads page 40 to check whether it still agrees with page 12. An LLM will, on request, for free, across the whole corpus. This is the pattern's real economic claim: the tedious part of a knowledge base was never the reading or the thinking, it was the bookkeeping — and humans abandon wikis because bookkeeping grows faster than value. Drive that cost to near zero and the artifact becomes sustainable.
Two files carry the wiki's navigation, and they are easy to conflate because they answer different questions along different axes.
| index.md | log.md | |
|---|---|---|
| axis | content — what exists | time — what happened |
| shape | catalog: page · one-line summary | append-only, chronological |
| organised by | category (entities, concepts, sources) | strictly by date |
| edited | rewritten on every ingest | never — only appended |
| read when | first step of every query | to see recent activity |
The index is the quietly radical part. At moderate scale — on the order of a hundred sources and a few hundred pages — an LLM reading a catalog file and then opening whole pages works well enough to make embedding-based retrieval unnecessary — no vector store, no chunking, no infrastructure. Chunking exists to fit things into a small context; whole-page reading preserves the structure that the wiki spent ingest time building. Proper search only earns its place once the index stops fitting comfortably in context.
The log's trick is a consistent prefix. Write entries as ## [2026-04-02] ingest | Mietvertrag and the timeline becomes greppable with no tooling at all — grep "^## \[" log.md | tail -5.
Ingest and query are the obvious half; the loop only compounds when good answers are filed back, and only stays healthy when something periodically hunts for rot.
The pattern is deliberately abstract, so it is worth grounding. Take a family document archive in Germany, kept by a non-German speaker: letters from the Ausländerbehörde, tax correspondence, Kita paperwork, insurance, medical results — scanned, in German, concerning several people, arriving over years.
This case stresses the pattern harder than a folder of articles does, because the wiki is a genuine compilation target: the sources are not merely unsummarised, they are unreadable to their owner. Translation is part of what ingest produces.
Four notes, each an instance of something above:
The document page is the bridge. Each scan gets a page in documents/: what it is, whom it concerns, the German terms alongside their English meaning, what it obliges, what it references. The scan is unsearchable; the page is searchable and linked. That is Integrate from §01 made concrete — and note that the German original stays in raw/ untouched, so a translation you later doubt can always be checked against what the office actually wrote (§03).
Images need a two-pass read. An LLM cannot reliably read markdown with inline images in one pass; the working method is to read text first, then view referenced images separately. For scanned letters that means ingest is view the scan → transcribe and translate → write the page. Afterwards, queries never reopen the scan. The compounding is unusually visible here: the expensive step happens exactly once per document.
Deadlines are a fourth operation. Calendar invites are neither ingest, query, nor lint — they are extraction: derived, actionable output. Keep derivation separate from generation. Ingest writes dates into the relevant processes/ page and into deadlines.md; a separate command emits .ics files from deadlines.md. Collapse the two and the calendar becomes a second source of truth, which drifts.
Privacy belongs in the schema. This corpus holds ID numbers, tax IDs, medical results. "Never send raw/ contents to web search", "keep the repository local and private" — these must be written into CLAUDE.md, because a future session will not infer them, and §04 is precisely the argument that anything unwritten silently stops being true.
When the sources are in a language you don't read, the wiki stops being a convenience and becomes the only readable surface — which makes every layer rule load-bearing rather than merely tidy.
RAG and an LLM wiki both sit between you and your documents, but they differ in when the thinking happens and whether it survives: RAG's index is derived, disposable and semantically empty, so all real reasoning occurs at query time and evaporates with the chat, leaving the same synthesis to be re-derived — possibly differently — on every ask; the wiki moves that reasoning to ingest time and writes it down, so the pages are almost incidental and the value lives in the edges, in this contradicts that and this supersedes that, judgements that were expensive to produce and that no single source contains, which is also why the graph is allowed to be the structure and no taxonomy is imposed. That single relocation explains every other rule: raw sources stay immutable so inference can never be laundered into evidence and the wiki remains a pure function of sources and schema, hence always safe to delete and rebuild; the schema is written down rather than re-explained each session, because unwritten conventions do not fail loudly but drift into parallel wikis that answer queries confidently from half the corpus; ingest is a supervised conversation because quality is set there; good answers are filed back so exploration compounds alongside input; and lint exists because a compounding artifact accumulates rot as well as knowledge, and an LLM is the first maintainer that will re-read page 40 to check it against page 12. RAG scales retrieval; a wiki accumulates understanding — the extra steps are the product.