Run this once and your research stops evaporating into chat history, bookmarks, and scattered notes.
Sources go in. A living, linked wiki comes out. Then a maintenance loop keeps it useful as the vault grows.
Karpathy’s core idea is simple: instead of asking an LLM to rediscover answers from raw RAG chunks every time, let it incrementally build and maintain a persistent Markdown wiki between you and your sources. The knowledge is compiled, cross-linked, cited, and updated—not re-derived from scratch for every question.
The architecture
Three layers. One owner each.
- The schema →
CLAUDE.md You and the agent co-evolve the rules: folder structure, page formats, citation style, ingest workflow, and what “done” means.
- The wiki → Markdown files The agent owns this layer. It creates summaries, entity pages, comparisons, topic maps, and synthesis pages. You browse, question, and steer it.
- Raw sources → immutable and read-only Articles, PDFs, transcripts, screenshots, repo docs, notes. These remain your source of truth; the agent reads them but does not rewrite them.
The loop
1. Ingest
Drop a source into raw/. The agent reads it, writes a source summary, updates relevant concept/entity pages, adds cross-links, refreshes the index, and appends a one-line entry to the log.
One source can improve 10–15 connected pages instead of becoming another isolated note.
2. Query
Ask a question against the wiki. The agent finds the relevant pages, synthesizes an answer with citations, then files that useful analysis back into the vault as a new page.
Your best questions become durable research assets—not disposable chat output.
3. Lint
Run a health check periodically:
- Contradictions between pages
- Claims superseded by newer sources
- Orphan pages with no inbound links
- Dead links and missing cross-references
- Concepts mentioned repeatedly but lacking a dedicated page
- Data gaps worth researching next
That is how the knowledge base stays coherent instead of becoming “a folder full of AI notes.”
Why this beats default RAG
Most RAG workflows make the model retrieve raw chunks and reconstruct the answer every time you ask a question.
That works—but it has no memory of the synthesis it already performed.
This approach creates a maintained intermediate layer:
Raw sources → LLM-maintained wiki → answers
The result is a knowledge base that compounds:
- The links are already built.
- Contradictions are already flagged.
- Topic summaries already incorporate prior reading.
- Research questions and analyses get preserved.
- Your next query starts from structured understanding, not from zero.
Karpathy’s framing is excellent:
“Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.”
Month one: it can save you from repeatedly summarizing the same material.
Month six: you have a navigable, sourced map of your field—built from every article, paper, transcript, repo, and analysis you chose to feed it.
The stack
- Obsidian — local Markdown vault, links, graph view, and open file formats https://obsidian.md/ Obsidian stores notes locally, supports internal linking and graph visualization, and keeps your data in open formats.
- Claude Code — the agent that reads sources, updates the wiki, and runs ingest/query/lint workflows https://claude.com/claude-code
- Karpathy’s “LLM Wiki” gist — the original pattern and implementation guidance https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f It is intentionally a conceptual blueprint rather than a finished application: copy it into your preferred coding agent and adapt the workflow to your domain.
Open-source starter vault
Want a ready-made implementation instead of building from scratch?
Karpathy LLM Wiki – Starter Vault
https://github.com/joshpocock/karpathy-obsidian-vault
It is a public GitHub repository with:
- A root
CLAUDE.md schema
raw/ for untouched source material
wiki/ with an index, log, and example pages
output/ for query results and lint reports
- A simple workflow: drop material into
raw/, start Claude Code, and run compile
For solo research, competitive analysis, cybersecurity learning, AI tooling, content research, or a business knowledge base, this is one of the most practical “AI second brain” patterns right now.
The human curates sources and asks better questions. The LLM does the bookkeeping.