Andrej Karpathy's LLM Wiki pattern

Karpathy Wiki

A focused guide to the idea of an LLM-maintained wiki: a persistent knowledge base that grows as the model ingests sources, rewrites pages, and compounds useful answers.

Persistent artifact

The wiki is compiled once, then revised as new sources arrive.

Human-directed

People source the material and steer the analysis; the model does the maintenance.

Source-first

Raw documents stay untouched while the wiki becomes the working layer.

Karpathy Wiki knowledge map illustration

The key distinction

RAG retrieves. Karpathy Wiki accumulates.

The important shift is not just better retrieval. It is moving the synthesis work into a maintained artifact that the model keeps improving over time.

DimensionClassic RAGKarpathy Wiki pattern
Knowledge stateMostly rediscovered at query time from raw chunks.Persisted as linked markdown pages that keep evolving.
Cross-source synthesisRepeated on every question.Written into the wiki once, then refined over time.
ContradictionsEasy to miss unless the current prompt surfaces them.Tracked directly on the relevant pages and revisited during maintenance.
Answer reuseGood chats often disappear into history.Useful answers can be filed back into the wiki as new pages.
Maintenance burdenHumans still need to organize and reconcile the material manually.The model handles the bookkeeping across many pages in one pass.
Three-layer workflow diagram for an LLM wiki

Operating model

Three layers. Three recurring operations.

Karpathy's pattern stays practical by keeping the stack small: immutable sources, a maintained wiki, and a schema file that teaches the agent how to behave.

Raw sources

Articles, notes, images, papers, transcripts, and other source-of-truth material the model reads but does not edit.

The wiki

Linked markdown pages that the model creates, revises, and cross-references as new material arrives.

The schema

An instruction file that defines structure, workflows, naming rules, and maintenance habits for the agent.

Ingest

Read a new source, summarize it, update the relevant pages, and record the change in the log.

Query

Answer from the wiki first, then file valuable answers back into the knowledge base.

Lint

Look for stale claims, weak links, orphan pages, and open research questions that deserve another pass.

FAQ

Common questions about the pattern

What is Karpathy Wiki in practice?

It is a pattern where an LLM maintains a markdown wiki between you and your raw source files. The human curates sources and asks questions; the model writes summaries, updates links, reconciles claims, and keeps the wiki coherent.

How is this different from a normal RAG workflow?

RAG usually retrieves fragments from the raw corpus each time you ask a question. An LLM wiki keeps a persistent synthesis layer, so the cross-links, summaries, and contradictions already exist before the next question arrives.

Why does Obsidian show up so often in LLM wiki discussions?

Obsidian gives you a live markdown workspace, backlinks, graph view, and plugin ecosystem. That makes it a practical place for humans to browse the wiki while the LLM edits the files.

Do I need complex infrastructure to start?

No. Karpathy's pattern starts with folders of markdown files, a schema document that teaches the agent how to maintain them, and lightweight search or indexing only when scale demands it.

When does this pattern work best?

It works best for domains where you keep accumulating source material over time and want synthesis, cross-references, and reusable answers rather than one-off retrieval.