The problem Karpathy set out to solve
Every time you work with your AI, you explain things, you explore ideas together, you reach conclusions… and all of it evaporates the moment you close the chat. Next time, the AI remembers nothing and you explain the same thing all over again. Karpathy frames it like this: the knowledge doesn't accumulate — every conversation starts from scratch.
His idea for breaking that is brilliant in its simplicity: have the AI write and maintain its own wiki — a knowledge base that grows with every conversation, instead of evaporating.
The idea: a wiki your AI builds on its own
The AI incrementally builds a wiki: a collection of markdown files linked to one another, living between you and your sources (your documents, notes, repos). You read it; the AI writes it and maintains it. Everything you learn together gets recorded and connected — so, over time, that wiki becomes more valuable than scattered notes.
Why does it work, when we humans always abandon our wikis? Karpathy gives the exact answer: "the tedious part of maintaining a knowledge base isn't the reading or the thinking — it's the office work (the bookkeeping)... Humans abandon wikis because maintenance grows faster than value. LLMs don't get bored, they don't forget to update a cross-reference, and they can touch 15 files in a single pass."
The 3 layers of the method
Karpathy organizes the system into three layers. Understanding them means understanding the whole method:
- 1. The raw sources: your documents, articles, original repos. They're immutable — the AI reads them but NEVER modifies them. Your source of truth.
- 2. The wiki: a folder of markdown files the AI generates. The AI owns this entire layer: you read it, the AI writes it.
- 3. The schema: a document (your CLAUDE.md or AGENTS.md) that tells the AI how the wiki is organized. It's what turns it into a "disciplined librarian" instead of a generic chatbot.
The 3 operations (what the AI does with the wiki)
The method has three actions, with the names Karpathy gave them:
Ingest. You hand it a new source (an article, a repo). The AI reads it, talks the key points over with you, writes a summary page into the wiki, and updates the index. A single source can touch 10-15 wiki pages, connecting them together.
Query. You ask it something. And here's the good part: good answers get filed back into the wiki as new pages. That way your own explorations accumulate in the knowledge base, just like the sources you ingest.
Lint. You ask the AI to run a health check on the wiki: it looks for contradictions between pages, outdated claims, orphan pages (with no links reaching them). It keeps the wiki healthy on its own.
index.md (the catalog of the whole wiki, organized by content) and a log.md (a chronological, append-only record). His tip: if each log entry starts with a consistent prefix like ## [2026-04-02] ingest | Title, you can search it with simple tools.The prompt to set up your LLM Wiki
Paste this into your agent (Claude Code, Codex, etc.) to kick off your own wiki following Karpathy's pattern. It's designed so the AI asks you the questions and builds the structure with you.
Let's set up an "LLM Wiki" following Andrej Karpathy's pattern: a markdown knowledge base that you (the AI) build and maintain, and that I can read. STRUCTURE (3 layers): 1. raw/ — my raw sources (articles, repos, notes). You READ them but NEVER modify them. 2. wiki/ — markdown pages that YOU generate and maintain, linked to one another. You own this layer. 3. The schema — update my CLAUDE.md (or AGENTS.md) explaining how the wiki is organized, so you maintain it with discipline. Special files: create an index.md (catalog by topic) and a log.md (chronological, append-only; each entry starts with "## [DATE] operation | Title"). OPERATIONS you'll know how to do: - INGEST: when I hand you a source, read it, tell me the key points, write a summary page into wiki/, link it, and update index.md and log.md. - QUERY: when I ask you something, answer AND if the answer is valuable, file it as a new page in the wiki. - LINT: when I ask you to, review the wiki: contradictions, stale data, orphan pages, and propose fixes. Start by asking me the questions you need about what my wiki will be about, then create the initial structure (folders, index.md, log.md, and the schema section in my CLAUDE.md).
Who is this method for?
- You work with your AI on a project or topic and you're tired of repeating the same things every time.
- You want the knowledge to accumulate and improve over time, not evaporate when you close the chat.
- You like to read and control what your AI "knows" (they're text files, not a black box).
- You already use a
CLAUDE.mdand want to take it to the next level.
In NeuralOS: the living wiki, no folders to set up
The original source (read it in full)
All of this comes from the document Karpathy published himself. I recommend reading the whole thing — it's short and worth its weight in gold.
Andrej Karpathy · "LLM Wiki" (original gist)The original document where Karpathy describes the full pattern (April 4, 2026).