Chapter 15

LLM Wiki Setup Guide (Karpathy Pattern)

Karpathy's LLM Wiki: Set Up Your AI-Powered Second Brain in 5 Minutes Andrej Karpathy dropped a pattern called the LLM Wiki that replaces traditional RAG with a persistent, compounding knowledge base. Instead of re-deriving answers from raw documents every time, an LLM builds and maintains a structured wiki that gets smarter with every source you add. I set this up with Claude Code. Here's the exact process so you can do it in under 5 minutes.

Step 1: Create your Obsidian vault

Open Obsidian and create a new vault (or use an existing one). Name it whatever fits your use case: "Research", "Business Intel", "Learning", etc.

Step 2: Open Claude Code in your vault

Open your terminal and run:

cd /path/to/your/obsidian/vault
claude

Claude Code reads your vault directory and can create and edit files directly.

Step 3: Paste this one prompt

Copy and paste this entire prompt into Claude Code. It sets up the full wiki structure, the CLAUDE.md schema, the index, and the log in one shot:

Set up an LLM Wiki in this Obsidian vault using Karpathy's pattern. Create the following:
1. Create these folders:
	- wiki/ (LLM-generated knowledge pages)
	- wiki/entities/ (people, companies, tools)
	- wiki/concepts/ (ideas, frameworks, mental models)
	- wiki/topics/ (deep dives on subjects)
	- wiki/sources/ (summaries of ingested sources)
	- wiki/synthesis/ (cross-cutting analysis)
	- raw/ (for source documents, immutable)
	- raw/assets/ (for downloaded images)
2. Create CLAUDE.md in the vault root with this schema:
	- Define three layers: raw sources (read-only), wiki (Claude owns), schema (CLAUDE.md)
	- Raw sources go in raw/ and any existing notes in the root
	- Wiki pages use YAML frontmatter: title, type, tags, sources, created, updated
	- Page types: entity, concept, topic, source, synthesis
	- Use Internal Links for cross-references
	- Three operations: Ingest (process new source, create/update wiki pages, update index + log), Query (search wiki, synthesize answer, optionally file as new page), Lint (check for contradictions, orphans, stale claims)
	- File naming: lowercase with hyphens
	- One idea per page, link generously
	- Update index.md on every ingest
3. Create wiki/index.md with empty sections: Entities, Concepts, Topics, Sources, Synthesis
4. Create wiki/log.md with today's date as the first entry: "Wiki initialized"
After setup, confirm what was created and tell me how to start ingesting sources.

Step 4: Start ingesting

Drop any article, PDF, or note into your raw/ folder. Or use the Obsidian Web Clipper browser extension to clip articles directly. Then tell Claude: "Ingest raw/article-name.md" Claude reads it, creates wiki pages, updates the index, and logs the action. One source typically touches 5-15 wiki pages.

Step 5: Query your wiki

Ask Claude any question about your collected knowledge:

  • "What do I know about [topic]?"
  • "Compare [concept A] vs [concept B] across my sources"
  • "What are the key themes across everything I've ingested?" If the answer is valuable, Claude can file it as a new synthesis page in your wiki.

Step 6: Maintain with lint

Periodically tell Claude: "Lint the wiki" It checks for contradictions, orphan pages, missing cross-references, and stale claims. Keeps your wiki healthy as it grows.

  • Web Clipper (browser extension) for clipping articles to raw/
  • Dataview for querying frontmatter across wiki pages
  • Graph View (built-in) to visualize connections between pages After 10-20 sources your wiki starts getting useful. After 50 it becomes a research superpower. The knowledge compounds because every new source strengthens the connections between everything you already know.

Want this set up for your business?

We turn these workflows into working marketing and sales systems.

Book a call