arielshemesh1999@gmail.com · Israel
← All articles

Karpathy’s LLM Wiki

Andrej Karpathy’s April 4 2026 gist on flipping RAG inside-out: instead of retrieving fragments per query, have the LLM build and maintain a persistent wiki that compounds with every source you feed it.

What it is

On April 4 2026 Andrej Karpathy published a short gist proposing a different shape for personal knowledge work with LLMs. The pitch fits on a postcard: stop asking the model to re-derive knowledge from raw documents at query time, and instead let it incrementally compile that knowledge into a structured, hand-curated wiki that lives on your disk and grows over time.

The key sentence — the one the whole pattern hangs on — is this:

“The tedious part of maintaining a knowledge base is not the reading or the thinking — it’s the bookkeeping.”

Humans abandon wikis because the maintenance burden grows faster than the value: cross-references rot, summaries drift, new sources contradict old ones, and the cost of keeping it tidy eventually exceeds the cost of just re-reading the originals. Karpathy’s observation is that bookkeeping is precisely what LLMs are good at — consistency, cross-linking, summarising, flagging contradictions — while curation, taste, and asking the right questions are precisely what humans are good at. The LLM wiki splits the work along that seam.

Architecture — the three layers

The pattern is three folders plus a config file. That’s the whole architecture.

  1. Raw sources — the immutable inputs. Articles you clipped, papers you downloaded, transcripts, screenshots, your own notes. The LLM reads this folder but never writes to it. Curation is human work.
  2. The wiki — the LLM-maintained markdown layer. Summaries of each source, one page per entity (person, org, product), one page per concept, comparison pages, an index, and a chronological log. The LLM owns it end to end — new pages, edits, cross-references, deletions.
  3. The schema — a single config document (CLAUDE.md for Claude Code or AGENTS.md for Codex, in Karpathy’s wording) that tells the LLM how the vault is structured, what folder lives where, what conventions every page must follow, and what to do during ingest / query / lint cycles. It is co-owned: the human and the LLM refine it together as the workflow matures.

A common fourth folder — outputs/ — holds derivative artifacts the LLM produces on request: Marp slide decks, matplotlib charts, one-off reports. Anything valuable enough gets filed back into the wiki; everything else stays as a one-shot.

How it works — the human/LLM split

The division of labour is the load-bearing idea. Once you internalise it the rest of the pattern falls out:

  • Humans handle: curating sources (deciding what to read), directing analysis (asking specific questions), and interpreting meaning (does this matter? does this change the picture?).
  • LLMs handle: summarising every source, extracting entities and concepts, writing and editing wiki pages, maintaining cross-references, keeping the index current, flagging contradictions between pages, and appending to the log.

This is exactly inverted from chat-RAG. In chat-RAG the human asks a question, the system retrieves chunks, the model generates an answer, and nothing accumulates — the next question starts from zero. In an LLM wiki the human also asks a question, but the model answers it against a pre-synthesised wiki it already wrote and maintains, and the answer itself is filed back as a new page. The wiki is a compounding artifact; the chat is just a UI on top of it.

Install / Setup

Karpathy’s gist is a sketch, not a kit. There is no pip install karpathy-wiki. The setup is: pick a directory, pick an editor, pick an agent, write the schema. Here’s a minimum viable install:

# 1. Create the three-layer folder structure
mkdir -p ~/Documents/LLMWiki/{raw,wiki,outputs}
cd ~/Documents/LLMWiki
touch CLAUDE.md README.md
touch wiki/index.md wiki/log.md

# 2. Open it as an Obsidian vault (recommended editor)
#    Download Obsidian: https://obsidian.md
#    Obsidian -> Open folder as vault -> pick ~/Documents/LLMWiki

# 3. Install the two plugins that make the pattern usable
#    Settings -> Community plugins -> Browse:
#      - Smart Connections   (semantic search + chat over the wiki)
#      - Dataview            (SQL-like queries over frontmatter)

# 4. Install the Web Clipper browser extension
#    https://obsidian.md/clipper
#    Configure it to save clippings into raw/<topic>/

# 5. Point an agent at the folder
#    Claude Code:  cd ~/Documents/LLMWiki && claude
#    Cursor:       open the folder in Cursor
#    The agent reads CLAUDE.md as its operating manual.

The schema file is where the work is. A skeleton:

# CLAUDE.md — LLM Wiki schema

## Three layers
- raw/      — immutable sources, human-curated, LLM reads only
- wiki/     — LLM-maintained markdown, one concept per page
- outputs/  — derivative slides / charts / one-off reports

## Workflows

### Ingest (human drops a new file in raw/)
1. Read the source.
2. Summarise key takeaways back to the human, confirm direction.
3. Create wiki/<topic>/sources/<slug>.md with summary + key claims.
4. Create or update entity / concept pages for new things mentioned.
5. Add cross-references both ways.
6. Update wiki/index.md.
7. Append to wiki/log.md.

### Query (human asks a question)
1. Read wiki/index.md to find candidate pages.
2. Follow wikilinks for context.
3. Synthesize an answer with citations to wiki pages.
4. If the answer is non-trivial, file it back as a new wiki page.

### Lint (every ~10 ingests, or on request)
- Flag contradictions between pages.
- Find orphan pages with no inbound links.
- Find concepts mentioned in many pages but missing a dedicated page.
- Make sure the index reflects current reality.

Usage examples

Example 1 — ingesting a paper. You drop raw/llm-agents/voyager.pdf into the vault and tell the agent:

You: ingest the new paper in raw/llm-agents/

Agent:
  read raw/llm-agents/voyager.pdf (28 pages)
  created wiki/llm-agents/sources/voyager.md      (summary + 6 key claims)
  created wiki/concepts/skill-library.md          (new concept)
  updated wiki/entities/jim-fan.md                (added paper to publications)
  updated wiki/comparisons/agent-memory-designs.md (added Voyager column)
  updated wiki/index.md
  appended wiki/log.md
  touched: 5 pages

Example 2 — querying the wiki. A week later you ask a question that touches three sources you ingested separately:

You: how do Voyager, ReAct and Reflexion differ on long-horizon memory?

Agent:
  read wiki/index.md, wiki/comparisons/agent-memory-designs.md
  followed wikilinks to 3 source summaries
  synthesized answer (see chat)
  filed back as wiki/comparisons/voyager-react-reflexion-memory.md
  appended wiki/log.md

Example 3 — the lint pass. Periodically you ask the agent to check the wiki’s health:

You: lint the wiki

Agent:
  contradictions: 1   (wiki/concepts/embedding-drift contradicts the newer
                       source wiki/sources/openai-embeddings-v3 on
                       expected MTEB drop — flagged for human review)
  orphans: 2          (wiki/entities/some-author, wiki/concepts/foo)
  concept gaps: 3     (terms appearing in ≥3 pages without a dedicated page:
                       “chunk anchoring”, “retrieval glue”, “skill library”)
  proposed actions written to wiki/log.md

What’s new / latest version

The gist itself is short and stable — Karpathy published it on April 4 2026 and has lightly revised it since. There is no canonical implementation; he explicitly framed it as a pattern, not a product. What has appeared in the months since is a small ecosystem of community implementations built on top of Obsidian or plain folders, each with their own schema file. The pieces of the toolchain Karpathy names directly:

  • Obsidian — the editor he uses; the graph view doubles as a visualisation of the wiki’s link structure.
  • Obsidian Web Clipper — browser extension that turns any article into clean markdown straight into raw/.
  • Dataview — queries over page frontmatter, useful for building dynamic index pages.
  • Marp — markdown-based slide decks, slotting cleanly into outputs/slides/.

Karpathy does not specify a retrieval plugin in the gist itself, but the comments converge on Smart Connections as the de facto choice for semantic search and chat over the wiki layer in Obsidian-based implementations.

Why it matters / where I use it

The reason this pattern is interesting and not just another note-taking opinion is that it inverts the cost curve. Traditional wikis fail because every new source raises the maintenance burden — you have to re-read old pages, find what needs updating, fix cross-references. With an LLM doing the bookkeeping that cost asymptotes to nearly zero: ingesting source 500 is no harder than ingesting source 5. Meanwhile every source you add makes every future query a little sharper, because the synthesis is already done and the cross-references are already there.

I run this pattern at ~/Documents/ObsidianVault/. The schema lives in CLAUDE.md, the raw clippings sit in raw/<topic>/, every page in wiki/ follows a fixed frontmatter, and Smart Connections sits on top with the similarity threshold set to 0.80 so noisy matches get culled. The vault doubles as a project router: each active project gets a page under wiki/projects/ with a file:// link to its folder in ~/Desktop/Workspace/, so opening the vault is the only entry point I need.

Two months in, the load-bearing claim of the gist has held up for me: the wiki really does compound. Re-ingesting a topic I worked on a month ago feels like picking up a conversation, not starting one.

Source

Andrej Karpathy — LLM Wiki, April 4 2026. gist.github.com/karpathy/442a6bf555914893e9891c11519de94f