The Viable Edge
Knowledge baseCompetitor trackingPricing
Advisory
Custom builds
Second Brain Course
Blog
Knowledge Hub
Community
Newsletter
MembersStart free build
Start free build

Navigate

Knowledge base
What it builds
Competitor tracking
Market watch
Pricing
$49/mo, one plan
Advisory
Work with us
Custom builds
Work with us
Members
Your workspace
Second Brain Course
Flagship course

Resources

Blog

Deep dives

Knowledge Hub

Guides & answers

Community

Join the lab

Newsletter

One idea, weekly

  1. Home
  2. /
  3. Blog
  4. /
  5. LLM Wiki: Karpathy's Pattern, Built for a Paying Client
LLM Wiki: Karpathy's Pattern, Built for a Paying Client
ai-era-strategy12 min read

LLM Wiki: Karpathy's Pattern, Built for a Paying Client

An LLM wiki is a knowledge base an AI maintains for you: raw sources in one folder, compiled markdown pages in another, and a schema file with the rules. Here is how to build one with Claude Code, how it compares with RAG and a second brain, and what changes when the wiki is for a client.

AS

By Adam Sandler

Founder of The Viable Edge. Builds knowledge bases that AI tools read, for his own work and for clients.

Published September 27, 2026 · Updated September 27, 2026

An LLM wiki is Andrej Karpathy's pattern for a knowledge base an AI maintains: raw sources sit in one folder, an LLM agent such as Claude Code compiles them into linked markdown pages, and a schema file sets the rules. Answers come from the compiled pages instead of from re-reading every raw document on every question.

Key takeaways

  • An LLM wiki is Andrej Karpathy's pattern for a knowledge base an AI maintains: raw sources, compiled wiki pages, and a schema file that sets the rules.
  • The three operations are ingest (fold a new source into the wiki), query (answer from the wiki) and lint (find contradictions, stale claims and orphan pages).
  • Claude Code runs the pattern with no extra software: the schema is a CLAUDE.md, and the wiki is plain markdown that Obsidian or any editor can display.
  • Against RAG, an LLM wiki does the synthesis once and keeps it current, which suits a few hundred sources; very large document sets still want search on top.
  • Built for a client, the same pattern needs stricter sourcing, a scheduled retrieval test and a handoff the client can run without the builder.

Can I use LLM wiki with Claude Code?

Yes, and Claude Code is one of the most natural fits. The pattern needs an agent that can read a folder of sources and write markdown pages, and Claude Code does both. Put the sources in raw/, the pages in wiki/, and the rules in a CLAUDE.md at the root, then ask it to ingest, query and lint.

Karpathy published the pattern as an idea file on GitHub in April 2026, written to be pasted into whatever agent you use. It has three layers: raw sources you never edit, the wiki the model writes and owns, and the schema that tells the model how the wiki works. Here is the build in Claude Code.

Step 1: Make the folder

Create a folder with two subfolders, raw and wiki. Drop your first sources into raw/ as they are: articles saved as markdown, PDFs, transcripts, exported docs. The raw layer is the evidence; nothing in it is ever rewritten, so you can always check a wiki page against where it came from.

Step 2: Put it under git

Run git init and commit. One ingest can touch a dozen pages, and git turns that into a diff you can read and undo. This is what makes it safe to let a model own the wiki.

Step 3: Write the schema as CLAUDE.md

Claude Code reads CLAUDE.md at the root of the folder at the start of every session, so that is where the schema goes. (Other agents read AGENTS.md; same content.) A starting version:

# LLM wiki: instructions for Claude Code

raw/ holds the sources. Never edit or delete anything in raw/.
wiki/ is yours to maintain: one topic per page, plain markdown.

## Every wiki page
- Opens with a one-line summary.
- Names the raw/ file behind each claim.
- Links related pages with [[wikilinks]].

## wiki/index.md
Every page, grouped by category, one line each. Update it on every ingest.

## wiki/log.md
One line per ingest, query or lint: date, operation, pages touched.
Append only; never rewrite an old line.

## Operations
- Ingest: read the new source, update every page it affects, add pages it needs.
- Query: answer from wiki/ first, cite the pages, say "not in the wiki" when it is missing.
- Lint: list contradictions, stale claims, orphan pages and missing links. Fix only what I approve.

The two special files do real work. index.md is how the model finds pages without a search engine: it reads the catalog, then opens what is relevant. log.md is the history, so the model (and you) can see what changed when.

Step 4: Ingest

Open Claude Code in the folder and ask: "Ingest raw/[file]. Update every wiki page it affects, create the pages it needs, update the index and log." The first few ingests create most of the pages. Later ones mostly revise: a new source that contradicts an old one should change the page, not sit next to it.

Step 5: Query, and file good answers back

Ask questions the way you would ask a colleague who has read everything: "What do the sources say about [topic], and where do they disagree?" When an answer is worth keeping, tell Claude Code to save it as a wiki page. That is how the wiki compounds: questions become knowledge instead of disappearing into chat history.

Step 6: Lint on a schedule

Once a week, ask for a lint pass: contradictions between pages, claims a newer source has overtaken, pages nothing links to, and topics mentioned everywhere but missing their own page. Review the list, approve the fixes, commit. Skipping lint is how a wiki drifts back into a pile of notes.

Free download

Start with the Second Brain Starter Kit

The personal version of the same loop, as plain markdown files: a capture inbox for raw material, a note template with a Source line, a source log, the weekly maintenance checklist, a connect-your-AI guide and a retrieval self-test. Enter your email and the download starts.

No spam, ever
Unsubscribe anytime

What is LLM wiki used for?

An LLM wiki is used to keep what you know on a subject compiled and current: research deep dives, reading notes, competitive analysis, course notes, personal goals, and team or business wikis. Karpathy's gist lists all of these. The common thread is a body of sources that grows over time and gets asked the same kinds of questions.

It earns its keep when two things are true: the sources keep arriving, and you keep needing answers that span several of them. A single report does not need a wiki. Forty customer interviews, a year of competitor announcements or every paper on one research question do, because no one rereads all of them before answering a question, and the wiki means no one has to.

It is a poor fit for knowledge that changes by the minute (an order system, a live dashboard) or for material nobody will ever query. Point those at the source system, not at a wiki.

Is LLM wiki better than RAG?

For a few hundred sources, usually yes. RAG retrieves raw chunks at question time and rebuilds the answer from scratch on every query. An LLM wiki does that work once: sources are compiled into linked, summarized pages that stay current, so answers read from finished knowledge. At much larger scale, add search or RAG on top of the wiki.

RAG (retrieval-augmented generation) is the usual way to point a model at documents: split them into chunks, store the chunks in a vector database, and fetch the closest matches for each question. It works, but every answer starts from fragments, and two sources that disagree are both handed to the model with nothing to say which is current. An LLM wiki settles those conflicts at ingest, once, and writes the result down where you can read it. Karpathy notes that at around a hundred sources and a few hundred pages, the index file alone works well without any embedding infrastructure.

A second brain is the third term people compare, and it overlaps with both:

ApproachWhat it storesWho maintains itHow answers are foundBest for
RAGRaw document chunks and their embeddingsA pipeline that re-indexes when documents changeSimilarity search at question time; synthesis repeated every queryLarge, fast-changing document sets
LLM wikiRaw sources plus compiled, linked markdown pagesThe LLM agent, under a schema you writeThe agent reads the index, then the relevant pagesA bounded subject that keeps growing
Second brainYour own notes, in your own wordsYou, with an AI doing more of the filing each yearYou search, or an agent reads your notesYour own thinking and decisions

They are not exclusive. A second brain run with Claude Code already behaves like a small LLM wiki; the Claude Code and Obsidian second brain guide sets one up. And a wiki that outgrows its index can add search over the compiled pages, so each search starts from summarized, linked pages instead of raw fragments.

Does Andrej Karpathy use Obsidian?

By his own account, yes. In his LLM wiki gist, Karpathy keeps the LLM agent open on one side and Obsidian on the other. The agent writes and edits the markdown pages; Obsidian is where he reads them, follows the links and browses the graph view as the wiki grows.

Obsidian fits because it does not own the files. It opens an ordinary folder of markdown, shows [[wikilinks]] as links and backlinks, and redraws its graph as the agent writes. Nothing about the pattern depends on it, though: VS Code, any markdown editor, or GitHub's own file view will display the same pages. Keep the wiki in plain markdown and the choice of viewer stays yours.

One habit to borrow from the gist: let the model do the writing and you do the reading. Editing wiki pages by hand works, but then the schema is no longer the only source of the rules, and lint starts flagging your edits as drift.

What does LLM mean in AI?

LLM stands for large language model: an AI model trained on a very large amount of text to predict and generate language. Claude, GPT and Gemini are LLMs. In an LLM wiki, the LLM is the maintainer: it reads your sources, writes the pages, keeps the links current and answers questions from the result.

The pattern is not tied to one model. What it needs is an LLM running as an agent, meaning it can open files, write files and follow instructions across many steps. Claude Code is that for Claude; other coding agents do the same for other models, which is why the schema file is plain text and the wiki is plain markdown. Swap the model next year and the wiki comes with you.

How to build a company brain?

Build it as an LLM wiki with stricter rules. Collect the company's real documents into raw sources, write a schema that requires a source on every claim, have the agent compile the wiki, then test retrieval with questions the team actually asks before anyone relies on it. Hand it over with the schema, a lint routine and an owner.

This is where the pattern turns into client work, and where most published builds stop. A wiki you keep for yourself can tolerate gaps: you are the only reader, and when an answer is wrong you notice. A wiki a business depends on cannot. Four things change when the wiki is for a paying client:

  • The sources are theirs, and some are wrong. Old pricing decks, a policy nobody follows, two versions of the same process. The schema needs a rule for which source wins and a way to mark a claim as unconfirmed, or the wiki confidently repeats the outdated one.
  • The schema becomes the contract. What counts as a source, who may edit the wiki, what the agent must refuse to answer. You write it with the client, because they will live with it after you leave.
  • Lint becomes a test. Before handover, run a set of real questions from the team and score the answers. The second brain retrieval test is a scorecard for exactly this. A wiki that has never been tested is a guess.
  • The handoff is the product. The client needs a named owner, a weekly ingest and lint routine, and a short note on where the wiki is weakest. If it only works while you are running the agent, you have delivered a demo.

That shape, scoping the sources, building the wiki, testing retrieval and handing it over, is a bounded engagement a consultant or service provider can quote, deliver and finish. The tools are the same plain folders and the same Claude Code session you would use for your own.

For consultants and service providers

Build knowledge bases for clients

Build and Deliver Professional Second Brains is a self-paced course on doing this for other people: scoping the engagement, building a knowledge base from a client's real material, testing retrieval, and handing it over, with a full simulated client engagement to practice on. Same plain files, no coding, no vector database.

Explore the course→
Free download

Build your own first

Get the Second Brain Starter Kit: seven plain markdown files to start a wiki Claude Code can maintain, including the weekly checklist and the retrieval self-test.

No spam, ever
Unsubscribe anytime

Related Articles

Claude Code + Obsidian Second Brain: The Setup Guide

Claude Code in your Obsidian folder, one CLAUDE.md, MCP optional.

Knowledge Base vs Second Brain: What Is the Difference?

Second brain names the outcome. Knowledge base names the system underneath it.

How to Build an AI Second Brain: The Practical 2026 Guide

One folder of plain-text notes, a capture habit, and an AI that reads it.

Second Brain for Business: How I Build an AI Second Brain, and How People Sell It

The setup, the flywheel behind it, and whether it is a real business.

Want a knowledge base like this built and kept current for your own brand, without running it by hand? Brand Architect does that.
The Viable Edge

Your brand’s knowledge base for the AI era.

Explore

Live demoSnapshot auditSecond Brain CourseAdvisoryCustom buildsCommunity

Resources

BlogKnowledge HubDevelopers

Company

AboutContactFAQ

© 2026 The Viable Edge. All rights reserved.

PrivacyTerms