# Karpathy's LLM wiki is a second brain for one. Here is what a team adds

> What Andrej Karpathy's LLM wiki is, quoted from his post and gist, how it differs from a second brain, and what a team needs to run one.

Source: https://baalda.com/blog/karpathy-llm-wiki-second-brain
Site: Baalda, https://baalda.com
Published: 2026-10-16

**Short answer.** Andrej Karpathy's second brain is what he calls an LLM wiki: raw sources in one folder, and a wiki of markdown files an AI agent writes and maintains from them, guided by a schema file like CLAUDE.md. For one person, Obsidian, an agent and git are enough. A team also needs live merging, per-folder permissions and undo.

Andrej Karpathy's second brain is a folder of markdown files that an AI agent writes for him. He calls it an LLM wiki: he collects sources, the model turns them into interlinked pages and keeps those pages current, and he reads the result in Obsidian. It is a design for one person, and it says so.

That last part is the line this post is about. The pattern is good, and for a solo researcher it needs nothing added. The moment two people, or two agents, write the same wiki, three things it never had to handle show up: two writers on one page, pages not everyone should see, and a bad pass by the model across fifteen files at once. Baalda, the app this site is for, is the same folder of markdown files with those three things built in, so a team can run Karpathy's pattern without changing it.

## What did Karpathy actually propose?

Two primary sources, two days apart.

The first is a post on X titled [LLM Knowledge Bases](https://x.com/karpathy/status/2039805659525644595), published on 2 April 2026 (20:42 UTC, already 3 April in Asia, which is why some write-ups give that date). He wrote that "a large fraction of my recent token throughput is going less into manipulating code, and more into manipulating knowledge (stored as markdown and images)." Sources go into a `raw/` directory, and an LLM incrementally "compiles" a wiki, "which is just a collection of .md files in a directory structure." His research wiki had reached "~100 articles and ~400K words", and he noted: "I thought I had to reach for fancy RAG, but the LLM has been pretty good about auto-maintaining index files and brief summaries of all the documents." He closed with: "I think there is room here for an incredible new product instead of a hacky collection of scripts."

The second is an idea file, the [llm-wiki gist](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f), created on 4 April 2026 and written to be pasted into your own agent. It names three layers:

| Layer | What it is | Who writes it |
|---|---|---|
| Raw sources | Articles, papers, images, data files | You. "The LLM reads from them but never modifies them" |
| The wiki | "a directory of LLM-generated markdown files" | The LLM. "You read it; the LLM writes it" |
| The schema | A file such as `CLAUDE.md` or `AGENTS.md` describing structure and workflows | You and the LLM, over time |

On top of the layers sit three operations. **Ingest** files one new source, and "a single source might touch 10-15 wiki pages." **Query** answers questions from the wiki, and good answers are filed back in as new pages. **Lint** is a periodic health check for contradictions, stale claims and orphan pages. Two special files keep it navigable: `index.md`, a catalog the model reads first, and `log.md`, an append-only record of what happened. His summary of the roles: "Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase."

## Is an LLM wiki the same thing as a second brain?

It is the same artifact with a different writer. A second brain in Tiago Forte's sense is notes you capture and distill yourself, so the value comes from your own judgement about what resonates ([how to build a second brain](/blog/how-to-build-a-second-brain) covers the method). An LLM wiki keeps the folder of linked notes and hands the writing to the model. In the gist's words, "You never (or rarely) write the wiki yourself."

So "second brain vs LLM wiki" is really a question about who maintains the pages. Karpathy's bet is that people abandon wikis because upkeep grows faster than value, and a model that "can touch 15 files in one pass" removes the upkeep. Of the three things people mean by an [AI second brain](/blog/ai-second-brain), this is the files-first kind: the knowledge is in plain markdown, and the model is a tool that works on it, not the place it lives.

## Why does Karpathy's setup stop at one person?

Because every layer assumes one human and one agent. One person curates `raw/`. One agent writes the wiki. One person reads it in one copy of Obsidian. The gist's answer to everything beyond that is a sentence in its tips: "The wiki is just a git repo of markdown files. You get version history, branching, and collaboration for free."

Git does give you history, and for one writer that is all the collaboration you need. It stops fitting when the writers overlap in time. Git merges at commit time, by lines, after the fact. An ingest that rewrites twelve pages while a colleague is fixing one of them by hand becomes a merge conflict somebody resolves later, or a force-push nobody notices.

The gist does name the team case. Its list of uses includes "**Business/team**: an internal wiki maintained by LLMs, fed by Slack threads, meeting transcripts, project documents, customer calls. Possibly with humans in the loop reviewing updates." That is a very different system from the solo one. Several people add sources. Several agents, each running for a different person, ingest and lint. Customer calls and some meeting notes are not for everyone, and an agent working for an intern should not be able to read the board notes it was never shown.

## What does an LLM wiki need when a team writes it?

Three things, each of which Baalda handles at the file layer, so the wiki stays a folder of `.md` files the whole time.

### Two writers on one page

In Baalda every note is a CRDT document (Yjs) kept in step with the plain markdown file on disk. When something outside the app rewrites the file, such as Claude Code or Codex running in the vault folder on your laptop, the desktop app does not take the new file as a blind overwrite. It diffs the file against the note's current text and replays the difference as insert and delete operations, so a teammate's edit that arrived in the meantime survives alongside the agent's.

An agent that is not on your laptop, such as Claude on the web, connects over MCP instead. Its writes go through the same CRDT path a human keystroke takes: if anyone has the note open, the change appears live in their editor and is written to disk on their machine. The MCP tools also take an `expectedRevision` from `read_note`, so an ingest that passes it and writes a page back ten minutes after reading it is refused, not merged blind, if the page changed in between. `edit_note` lets the agent change one paragraph by anchor instead of resending the whole page, which is what you want when "a single source might touch 10-15 wiki pages" and most of each page should stay as it is.

### Pages the agent should not see

Karpathy's rule that the LLM "never modifies" `raw/` is enforced by the schema, which is to say by asking the model nicely. In Baalda it can be enforced by access. Every vault, folder and file can be set to Can edit, Can view or No access, for everyone or for named people, and every MCP call is gated by the same rules the app uses: reads need view, writes need edit, and a token can only reach what the person it belongs to can reach. Two people's agents can query the same wiki and get different answers, because they can see different pages.

This holds for a local agent too. When a note is read-only for you and an agent on your machine rewrites its file anyway, Baalda keeps the changed file as a recovery copy and writes the shared text back over it. It does not push the change to the team.

A sensible layout for a team wiki:

```text
team-wiki/
  AGENTS.md          the schema: page types, naming, how to ingest and lint
  index.md           the catalog the agent reads first
  log.md             append-only: ## [2026-10-16] ingest | Q3 customer calls
  raw/               sources; Can view for everyone except the people who add them
  raw/customers/     No access except the people who run accounts
  wiki/              the pages the agents write
  wiki/decisions/    Can view for agents, edited by people
```

One limit to know before you rely on that `raw/` line: the token is a person. If your own account can edit `raw/`, so can an agent using your token. To give an agent narrower rights than yours, it needs its own member account in the vault, which on the Team plan is a seat.

### Undoing a bad lint pass

A lint pass is the model rewriting many pages on its own judgement, and sooner or later one goes wrong. Git can undo it if somebody committed before it ran. Baalda keeps history without anyone remembering to commit:

- **Versions per sitting.** A version is captured at the end of each editing session (after 10 minutes idle), up to 50 per note, and every change records who made it, and the server tags agent writes as MCP edits.
- **A version before a large deletion.** Any single update that leaves 20% or less of a note of 200 or more characters keeps a "Before large deletion" version first.
- **A brake on bursts.** If one person's edits empty 10 or more notes in the same vault within 60 seconds, the server stops taking that person's writes in that vault for 30 minutes (the defaults, which a self-hosted server can change), and each emptied note can be restored from version history.

Git still works alongside all of this. Baalda ignores the `.git` folder, so the vault can stay a repository and Karpathy's "version history, branching" tip still applies for anyone who wants commits as well.

## How do you set up an LLM wiki in Baalda?

The pattern does not change, which is the point. Make a vault, create the folders above, and put Karpathy's gist into `AGENTS.md` or `CLAUDE.md` as the starting schema, adjusted for your team. Sources clipped into `raw/` with Obsidian Web Clipper are ordinary markdown files in the folder, so they appear as notes.

For a local agent, run it in the vault folder, exactly as you would with Obsidian ([Claude Code as a second brain](/blog/claude-code-second-brain) covers that setup). For an agent that needs the shared copy, or that runs somewhere other than your laptop, create an MCP token in the app and register the endpoint:

```bash
claude mcp add --transport http baalda https://api.baalda.com/api/mcp \
  --header "Authorization: Bearer mcp_your_token_here"
```

When self-hosting, the URL is your own server plus `/api/mcp`. Through that connection the agent gets `search_notes`, a combined semantic and keyword search over everything the token's owner can see, which covers the small search engine the gist suggests building once `index.md` stops being enough. It does not settle the wider retrieval question, and at the scale Karpathy describes the index file is still the first thing the agent should read.

## When is Karpathy's original setup all you need?

If you are the only person adding sources and the only person reading the wiki, use what he uses. Obsidian is free, its plugins cover things Baalda does not have, such as Marp slides and Dataview queries the gist mentions, and a git repo gives you history. Nothing in this post is a reason to move. [Building the vault so it is readable outside Obsidian](/blog/obsidian-second-brain) is worth doing anyway, and it is also what makes a later move a copy.

Baalda also does not do everything the team version of the gist describes. "Possibly with humans in the loop reviewing updates" implies a review step before an agent's change lands. Baalda has none: agent writes apply immediately, and review happens after the fact, through version history and the record of who changed what. Permissions decide where an agent can write, not whether what it writes is right, so a model that files a wrong claim into a page it is allowed to edit has still filed a wrong claim. There is no phone app. And Karpathy's last idea, finetuning so the model knows the wiki "in its weights instead of just context windows", is outside what any notes app does.

What Baalda adds is narrow and specific: the same folder of files, with several people and several agents writing it at once, each one limited to the pages it should touch, and a way back when a pass goes wrong.

## FAQ

### What is Andrej Karpathy's second brain?

A personal knowledge base he described on X on 2 April 2026 and in an llm-wiki gist on 4 April 2026. Sources go into a raw/ folder, an LLM agent compiles them into interlinked markdown pages, keeps an index.md and a log.md, and periodically lints the wiki. He reads it in Obsidian and rarely edits it himself.

### What is the difference between a second brain and an LLM wiki?

The writer. A second brain in Tiago Forte's sense is notes you capture and distill yourself. An LLM wiki keeps the same folder of linked markdown but hands the writing and upkeep to a model, while you choose the sources and ask the questions.

### Does an LLM wiki replace RAG?

At small scale it can. Karpathy wrote that he expected to need RAG, but the model kept index files and summaries well enough at about 100 articles. The gist suggests adding a local search tool once the index stops being enough, so it narrows the need for retrieval rather than removing it.

### Can a team share one LLM wiki?

The gist lists a business or team wiki as a use, fed by Slack threads, meeting transcripts and customer calls. Doing it safely needs edits from several people and agents to merge rather than overwrite, access limits per folder that also bind each agent, and a way to undo a bad pass across many pages.

### Do I need Baalda to build an LLM wiki?

No. For one person, Obsidian, an agent such as Claude Code or Codex, and a git repo are the whole setup Karpathy describes. Baalda is for when several people and their agents write the same wiki, and it opens the same folder of markdown files, so moving later is a copy.
