LLM Wiki Pattern

A pattern for building personal knowledge bases using LLMs. Instead of retrieving from raw documents at query time (RAG), the LLM incrementally compiles sources into a persistent, interlinked wiki that compounds in value with every addition.

“This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.).” — Karpathy

The Core Idea

Most LLM-document systems (NotebookLM, ChatGPT uploads, RAG) re-discover knowledge from scratch on every query. Nothing accumulates.

The LLM Wiki is different: when you add a new source, the LLM reads it, extracts key information, and integrates it into the existing wiki — updating entity pages, revising topic summaries, flagging contradictions. Knowledge is compiled once and kept current.

The wiki is a compounding artifact. Cross-references are already there. Contradictions are already flagged. Synthesis already reflects everything you’ve read.

Three Layers

LayerDescription
Raw sourcesImmutable source documents — articles, papers, images, data. LLM reads but never modifies.
The wikiLLM-generated markdown files — summaries, entity pages, concept pages, comparisons. LLM owns this entirely.
The schemaA document (CLAUDE.md, AGENTS.md, etc.) that tells the LLM how the wiki is structured and what workflows to follow. Co-evolved by you and the LLM.

Core Operations

OperationDescription
IngestDrop a source in. LLM discusses key takeaways with you first, then writes/updates pages (may touch 10–15 files).
QueryAsk a question. LLM reads the index, finds relevant pages, synthesizes an answer with citations. Good answers get filed back into the wiki.
LintPeriodic health check — find contradictions, stale claims, orphan pages, missing cross-references, data gaps.
SynthesizePeriodic consolidation pass — revisit existing pages across a topic, update overviews to reflect accumulated knowledge, resolve contradictions, create comparison pages where multiple sources now tell a coherent story.

Workflow

Karpathy’s setup: LLM agent open on one side, Obsidian open on the other. The LLM edits; he browses in real time.

“Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.”

Recommended: ingest one source at a time, stay involved, guide what gets emphasized.

Use Cases

  • Research — reading papers over weeks, building a wiki with an evolving thesis
  • Book reading — filing each chapter, building out characters, themes, plot threads
  • Personal — goals, health, self-improvement — filing journal entries and articles
  • Business — internal wiki fed by Slack, meeting transcripts, project docs
  • Competitive analysis, due diligence, course notes, hobby deep-dives

Optional Tooling

  • Obsidian Web Clipper — browser extension to clip articles to markdown
  • Obsidian graph view — see the shape of your wiki, find hubs and orphans
  • qmd — local search engine for markdown (BM25 + vector + rerank) for larger wikis
  • Marp — markdown-based slide decks, Obsidian plugin available
  • Dataview — Obsidian plugin for querying YAML frontmatter
  • Git — the wiki is just a repo; version history, rollback, collaboration for free

Why It Works

The tedious part of a knowledge base is bookkeeping — updating cross-references, keeping summaries current, catching contradictions. Humans abandon wikis because maintenance grows faster than value. LLMs don’t get bored and can touch 15 files in one pass.

Related in spirit to Vannevar Bush’s Memex (1945) — a personal, curated knowledge store with associative trails. Bush couldn’t solve who does the maintenance. The LLM handles that.

See Also