aliteq.

Karpathy's LLM Wiki: Build a Markdown Second Brain That Your AI Keeps Up to Date

Andrej Karpathy shared an idea file for a notes folder the AI writes and maintains, so you stop re-explaining your documents every time you ask a question. Here is what it says, how it works, and where it can go wrong.

NeonUpdated 11h ago8 min readWeb story
Hand-drawn editorial illustration of loose paper sheets being stitched by a coral thread into a tidy web of linked pages on a near-black background
Share

I spend my days making things with AI tools, and my notes folder is where good ideas go to die. So when Andrej Karpathy posted a gist about a notes system that the AI maintains for you, I read it start to finish.

This is a summary of what it says, not a review of how it works in practice. I have not built one, and I will not pretend otherwise. I read the gist on 3 October 2026 and quote it exactly where I use quotation marks. Everything marked "our read" is opinion.

What the LLM Wiki is

An LLM Wiki is a folder of markdown files that an AI agent writes and maintains from your source documents. Karpathy describes it as 'a pattern for building personal knowledge bases using LLMs'. You supply the reading material and the questions. The agent does the filing, linking and updating.

The gist is not code. Karpathy calls it 'an idea file' that is 'designed to be copy pasted to your own LLM Agent', and he names OpenAI Codex, Claude Code and OpenCode as examples. You hand it to your agent, and the two of you work out the details together.

How it differs from RAG

RAG means retrieval-augmented generation: the AI searches your files for relevant chunks each time you ask, then answers from them. Karpathy's complaint is that 'the LLM is rediscovering knowledge from scratch on every question. There's no accumulation.' He lists NotebookLM, ChatGPT file uploads and most RAG systems as working this way.

His alternative is that the agent 'incrementally builds and maintains a persistent wiki', a set of interlinked markdown files that sits between you and the raw sources. When you add a source, it reads it, extracts the key points and folds them into existing pages. The gist's phrase is 'compiled once and then kept current, not re-derived on every query'.

Comparison table of typical RAG and the LLM wiki pattern: knowledge built at query time versus at ingest time, raw chunks versus interlinked markdown, no accumulation versus compounding, contradictions found again versus flagged once, nobody writes notes versus the LLM writes them.
Our summary of the contrast the gist draws. Not a table from the gist. · aliteq research

One thing the gist does not say: that RAG is dead. It describes a different trade. The wiki does more work when you add a source, so it can do less when you ask a question.

The three layers

The system has three layers, and the gist is strict about who owns each. Raw sources are yours and are immutable. The wiki belongs to the AI. The schema, a rules file, is shared. Keeping those lines clear is what stops the agent from quietly rewriting your originals.

The three layers (Karpathy's gist, read 3 Oct 2026)

Raw sources

What it is
Articles, papers, images, data files. The source of truth.
Who changes it
You. The LLM reads but never modifies them.

The wiki

What it is
Summaries, entity pages, concept pages, comparisons, an overview, a synthesis, all markdown.
Who changes it
The LLM, entirely. You read it.

The schema

What it is
A document such as CLAUDE.md for Claude Code or AGENTS.md for Codex. Sets structure, conventions and workflows.
Who changes it
You and the LLM, evolving it over time.

The gist calls the schema 'the key configuration file'. It is what turns the agent into 'a disciplined wiki maintainer rather than a generic chatbot'.

The three jobs: ingest, query, lint

The agent does three kinds of work. It ingests new sources, answers questions against the wiki, and periodically checks the wiki's health. Each one writes back to the wiki, which is why the folder gets richer over time instead of staying a pile.

Three statistics from Karpathy's LLM Wiki gist: three layers (raw sources, wiki, schema), three jobs (ingest, query, lint), and one source may touch 10 to 15 wiki pages. Below, the three jobs: ingest adds a source, query asks the wiki, lint health-checks it.
Counts read from the gist text. Step wording is our summary. · aliteq research

Ingest. You drop a source in and tell the agent to process it. Karpathy's example flow: it reads the source, discusses the takeaways with you, writes a summary page, updates the index, updates related pages and logs the work. He writes that 'a single source might touch 10-15 wiki pages'. He prefers to ingest one at a time and stay involved, reading the summaries and checking the updates. Batch ingest with less supervision is possible.

Query. You ask the wiki a question. The agent finds the relevant pages and answers with citations. The part I like: 'good answers can be filed back into the wiki as new pages.' A comparison you asked for becomes a page, so it does not vanish into chat history.

Lint. Now and then you ask the agent to health-check the wiki. The gist lists contradictions between pages, stale claims that newer sources have replaced, orphan pages with no inbound links, important concepts with no page of their own, missing cross-references and gaps that a web search could fill.

Two files that keep it navigable

Two special files help the agent find its way: index.md and log.md. The index is a catalog with a link and a one-line summary for every page, organized by category. The log is an append-only timeline of ingests, queries and lint passes. Both are plain markdown the agent updates for you.

The gist says the index approach works 'surprisingly well at moderate scale (~100 sources, ~hundreds of pages)' and 'avoids the need for embedding-based RAG infrastructure'. The agent reads the index first, then opens the pages it points to.

For the log, Karpathy suggests a consistent prefix on each entry, such as ## [2026-04-02] ingest | Article Title, so simple unix tools can read it. His example: grep "^## \[" log.md | tail -5 returns the last five entries.

When the wiki outgrows an index, the gist points to qmd, a local search engine for markdown files. It describes qmd as having 'hybrid BM25/vector search and LLM re-ranking, all on-device', with a command line and an MCP server. The qmd repository exists on GitHub. I did not run it.

What the setup looks like

Karpathy says he runs 'the LLM agent open on one side and Obsidian open on the other'. The agent edits files while he browses the results, following links and checking the graph view. His line: 'Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.'

Obsidian is optional. The gist's own closing tip is that 'the wiki is just a git repo of markdown files', so you get version history for free. Other tips it lists are the Obsidian Web Clipper for turning web articles into markdown, Marp for slide decks and Dataview for tables over page metadata.

Here is a tiny schema in the spirit of the gist. It is our sketch, not text from the gist, and I have not tested it.

# CLAUDE.md (illustrative sketch, not from Karpathy's gist)
raw/      sources. Read only. Never edit.
wiki/     pages you write. One concept per page. Link with [[page]].
index.md  one line per wiki page. Update on every ingest.
log.md    append only. Start each entry: ## [YYYY-MM-DD] ingest | title

On ingest: summarize, update related pages, update index.md, append to log.md.
On conflict: keep both claims, cite both sources, flag it on the page.
Table of who changes each file in an LLM wiki: raw sources are added by you and only read by the LLM; wiki pages are read by you and written by the LLM; index.md and log.md are maintained by the LLM; the schema file is co-evolved by both.
Our summary of the gist's Architecture and Indexing sections. · aliteq research

Where it could go wrong (our read)

The gist is an idea, and it is candid about being one. These risks are my own reading, not Karpathy's claims. The gist does not discuss them, and I have no measurements.

  • Errors can stick. If the agent misreads a source, the wrong claim lives on a page and may get copied into other pages. The lint job and the immutable raw layer are the defenses, but only if a person checks.
  • It costs reading time and tokens. An ingest that touches 10 to 15 pages means the agent reads and rewrites a lot. Karpathy's habit of staying involved suggests the review is part of the cost.
  • A wiki is only as good as its sources. Compiling a weak article into a neat page does not make it true. Keep the original linked on every page.
  • Scale is unproven here. The gist's own comfort zone for the index is about 100 sources. Beyond that, you need search, which is why it mentions qmd.

Should you try it?

It is worth trying if you read a lot on one subject and keep losing what you learned. Start small: one topic, five sources, one schema file, and read every page the agent writes. If you only need answers from a handful of documents, a plain upload to a chat tool may be enough.

Related reading on this site: Karpathy's own take on working with coding agents is in Karpathy on agentic engineering, and the rules-file idea behind a schema connects to context engineering for vibe coders.

LLM Wiki: quick answers

What is Karpathy's LLM Wiki?
It is a GitHub gist, created 4 April 2026, that describes a pattern: an AI agent builds and maintains a folder of interlinked markdown pages from your source documents. The gist calls itself 'an idea file' to paste into your own agent.
How is an LLM Wiki different from RAG?
RAG retrieves chunks of your files at question time. The LLM Wiki has the agent write structured pages when you add a source, so the synthesis already exists. The gist calls this 'a persistent, compounding artifact'.
Do I need Obsidian?
No. Karpathy uses Obsidian to browse the wiki, but the gist says the wiki is just markdown files in a git repo. Any editor works.
Can I use Claude Code for this?
The gist names Claude Code as one agent you can paste it into, and uses CLAUDE.md as its example schema file. For Codex it names AGENTS.md. We have not tested it ourselves.
What are index.md and log.md?
The index is a catalog of every wiki page with a one-line summary, which the agent reads first when answering. The log is an append-only timeline of ingests, queries and lint passes.
Does it replace a vector database?
Not at any size. The gist says the index file works well at about 100 sources and hundreds of pages. For larger wikis it suggests adding a search tool such as qmd.

Found this useful? Share it

Share
Neon

AI Money Editor

Neon

I make ads, shorts and product visuals with AI tools all day and treat the model list like a toolbox — the right one for the job, not the hyped one. I write about what actually ships: real prompts, real output, and the honest catch on each tool.

Work out the hardware

The Aliteq brief

The tech worth knowing — hardware, AI, gaming, deals. No spam, unsubscribe anytime.

Keep reading