Build Yourself a Second Brain: An LLM-Maintained Wiki
You want to organise your knowledge into a second brain - somewhere the things you read actually compound instead of rotting in a folder you never reopen. Andrej Karpathy floated a neat pattern for exactly that: instead of dumping everything into a vector database and pulling out chunks at query time, have the LLM build and maintain a wiki - a structured, interlinked set of markdown files that sits between you and your sources. You feed it things; it reads them, writes summaries, cross-links everything, and keeps it tidy. The knowledge compounds instead of evaporating. And because it's just markdown, you can read it, edit it, and version it yourself.
A Few Brains Worth Building
The pattern fits anything you accumulate over time. Karpathy sketches out a handful of contexts in the gist:
- Personal - tracking your goals, health, psychology and self-improvement. File journal entries, articles and podcast notes, and build a structured picture of yourself over time.
- Research - going deep on a topic over weeks or months. Read papers, articles and reports, and incrementally build a comprehensive wiki with an evolving thesis.
- Reading a book - file each chapter as you go and build pages for characters, themes and plot threads, and how they connect. By the end you've got a rich companion wiki - think fan wikis like Tolkien Gateway, except personal, with the LLM doing all the cross-referencing.
- Business or team - an internal wiki fed by Slack threads, meeting transcripts, project docs and customer calls, with humans reviewing the updates. It stays current because the LLM does the maintenance nobody on the team wants to do.
- Anything that accumulates - competitive analysis, due diligence, trip planning, course notes, hobby deep-dives.
Here's what I point mine at:
- Fishing spots - after every trip, log where you went, the conditions and what was biting. The wiki builds a page per spot, per species and per technique, and cross-links them - so "what's worked at the river mouth on a run-out tide in winter" becomes a question you can actually answer.
- Running - file each run alongside the training articles you read. It tracks your paces and mileage, builds pages for workouts, injuries and races, and turns a year of scattered logs into a clear picture of what actually moves your times.
- Dev knowledge - probably where it earns its keep most for me. I feed it blog posts and docs across PHP, Laravel, Vue and Docker; it builds entities and concepts, links them together, and answers questions with citations back to the source.
If you'll come back to the knowledge, it's worth building a brain for it.
Setting It Up
The best part is you barely set anything up. You paste Karpathy's gist into an AI coding tool, tell it what your brain is for, and it scaffolds the whole thing. You can use any agentic tool with file access - I use Claude Code in VS Code because it reads a project's CLAUDE.md automatically, which is exactly where the wiki's rules live.
-
Install Obsidian and create a vault. Obsidian is just a markdown editor, but its
[[wikilink]]graph is the whole point - you get a clickable, navigable knowledge graph for free. Hit "Create new vault", point it at an empty folder, and you're done. That folder is your brain. -
Open the same folder in VS Code. File → Open Folder, pick the vault. Now you can browse the graph in Obsidian and drive it with an AI agent side by side, both pointed at the same files.
-
Install the Claude Code extension and connect it. Grab it from the VS Code marketplace and sign in with OAuth - just authorise it against your Claude account, no API key to manage. Prefer a different agent? Anything with filesystem access works - the rest of the steps are identical.
-
Paste Karpathy's gist with a one-line prompt. Open the gist, copy the whole thing, and drop it into the chat with an instruction that says what your brain is for:
Read Andrej Karpathy's LLM wiki pattern below and set up this folder for it: create the raw/ and wiki/ structure and a CLAUDE.md schema that follows his approach. This brain is for tracking everything I'm learning about [your topic]. [paste the full gist here]Swap that last sentence for your context - a personal brain, a book companion, a research thesis, a team wiki. That one line shapes every categorisation decision the model makes afterwards, so it's worth getting right.
-
Let it scaffold. It reads the pattern and lays down the folder structure plus a
CLAUDE.md- the schema both you and the model follow every session. That's the whole setup. Here's what it just built.
The Three Layers
Once it's scaffolded, this is your entire brain:
my-brain/
├── CLAUDE.md ← the schema; the model reads this first, every session
├── raw/ ← your sources, dropped in and never edited
└── wiki/
├── index.md ← master catalogue
├── log.md ← append-only history of every change
├── overview.md ← the evolving big picture
├── sources/ ← one page per thing you fed it
├── entities/ ← people, tools, places, products
└── concepts/ ← ideas, themes, patterns
Three layers, three owners. You curate raw/ and never touch a file once it's in - that's your ground truth. The model owns everything under wiki/ - the source, entity and concept pages, plus the index and the log, all cross-linked. And you both follow CLAUDE.md, the schema that defines how pages are formatted and what each operation does. The model handles the bookkeeping - the cross-linking, keeping the index current, the tidy-up - which is the part that kills every wiki I've ever tried to keep by hand.
The Commands
Now you just feed it. Drop a source into raw/ - an article, a PDF, a transcript, a chapter - and say "ingest this". The model reads it, tells you what it found, you steer, then it writes and cross-links the pages. That's the whole loop, and you drive all of it in plain language. Three operations cover almost everything:
| Command | What it's for |
|---|---|
| Ingest | Read a new source, talk through the takeaways, then write and cross-link the relevant pages. |
| Query | Answer a question from the wiki, with citations back to the source pages, and flag any gaps. |
| Lint | Audit the wiki for contradictions, orphan and stub pages, missing pages and stale claims. |
One rule worth keeping in your CLAUDE.md: discuss before writing. Tell the model to talk through what it found before it touches any files. Without it, an ingest races off and writes ten pages you didn't want. With it, every ingest is a quick conversation first, then the bookkeeping.
To maintain it, commit after each session - git diff on your wiki is genuinely interesting to scroll, you watch your own understanding take shape - and run a lint now and then. Rot is real, but unlike a folder of notes, your brain can find its own rot when you ask it to.
Final Thoughts
You've now got the whole picture: a second brain that's just a folder of markdown, stood up by the model from Karpathy's gist in a few minutes and maintained by it from there. Three layers, three commands, no vector database, nothing to babysit. You bring the sources and the questions - it does the bookkeeping that quietly kills every other knowledge base.
So go build one. Pick a subject you'll keep circling back to - a stack you're learning, a field you're researching, a hobby you're deep in - and feed it the first thing you read today. Stick with it and you'll end up with something a folder of notes never becomes: a brain that's genuinely yours and gets sharper every time you come back to it.