The LLM Wiki Pattern
A pattern for building persistent, compounding knowledge bases maintained by LLM agents. The pattern and its vocabulary come from Andrej Karpathy's LLM Wiki idea file; this page is our reading of it, and llm-wiki-pattern is what we built from it.
Revised 2026-09-06.
Core idea
Most LLM-document systems work like RAG: upload files, retrieve chunks at query time, generate an answer. Nothing accumulates. The LLM rediscovers the same knowledge from scratch on every question, and never gets smarter about your domain.
The LLM Wiki pattern is different. Instead of retrieving from raw documents at query time, the LLM incrementally builds and maintains a persistent wiki — a structured, interlinked collection of pages that sits between you and the raw sources.
When a new source arrives, the LLM reads it, extracts the key information, and integrates it into the existing wiki — updating entity pages, revising topic summaries, noting where new data contradicts old claims. The wiki keeps compounding: every source filed makes the next one cheaper to place. The cross-references are already there. The contradictions have already been flagged. The synthesis already reflects everything ingested.
Three layers
Raw sources — immutable input documents. PDFs, articles, data files, transcripts. The LLM reads them but never modifies them.
The wiki — LLM-generated markdown pages. Summaries, entity pages, concept pages, comparisons, synthesis. The LLM owns this layer entirely: people read it, and the agent is its author.
The schema — a document (CLAUDE.md, AGENTS.md) that defines wiki conventions, page formats, and workflows. This makes the LLM a disciplined wiki maintainer rather than a generic chatbot.
Operations
Ingest
Drop a source into the collection and tell the LLM to process it. The LLM reads the source, writes a summary page, updates the index, updates relevant entity and concept pages, and appends a log entry. A single source might touch 10–15 wiki pages.
Query
Ask questions against the wiki. The LLM searches for relevant pages, reads them, and synthesises an answer with citations. Good answers can be filed back into the wiki as new pages — explorations compound in the knowledge base just like ingested sources do.
Lint
Periodically ask the LLM to health-check the wiki: find contradictions between pages, stale claims superseded by newer sources, orphan pages, missing cross-references, concepts without their own page.
Navigation files
index.md — content-oriented. A catalogue of every page with a one-line summary, organised by category. The LLM reads it first when answering queries to find relevant pages before drilling in.
log.md — chronological. An append-only record of ingests, queries, and lint passes. Gives a timeline of the wiki's evolution.
Why it works
What wears a knowledge base down is never the reading or the thinking. It is the upkeep: cross-references that drift, summaries that go stale, contradictions nobody records. People give up on a wiki once that upkeep costs more than the pages return. An agent has no such threshold, and it will revise fifteen pages in one pass without complaint.
The human's job is to curate sources, direct the analysis, and ask good questions. The LLM's job is everything else.
The idea relates to Vannevar Bush's Memex (1945) — a personal, curated knowledge store with associative trails. Bush's vision was closer to this than to what the web became: private, actively curated, with connections between documents as valuable as the documents themselves.
Use cases
- Personal: tracking goals, health, psychology, self-improvement from journal entries and articles
- Research: going deep on a topic over weeks, building a wiki with an evolving thesis
- Reading: filing each chapter as you go, building out pages for characters, themes, and connections
- Business: an internal wiki fed by Slack threads, meeting transcripts, project documents
- Competitive analysis, due diligence, course notes — anything where knowledge accumulates over time
The landscape
External research, 2024–2026 — context on where the pattern sits, not WitWiki facts.
WitWiki's reading of the pattern is narrower than the category that has grown up around it: the shared agent-context surface that is not tied to one vendor's client or one repo — one wiki that several people and several agents, in different editors and different repositories, read and write over MCP.
What users increasingly want from these systems: active, self-maintaining knowledge bases that monitor activity and proactively surface context; graph-based retrieval that preserves relationships for multi-hop reasoning; AI-generated cited answers rather than "search for pages"; auto-verification of stale content; and knowledge portability — a markdown-vault approach with humans as first-class authors, no vendor lock-in.
Failure modes
The pattern's strength — committing synthesis at write time — is also its central risk. Reported pain points across agent-memory systems (external research, 2024–2026):
- Maintaining freshness is often harder than the initial build.
- Memory-update failures: extraction not linked to updates, with omission rates reported above 50%.
- Memory hallucinations: fabrication, conflict, and omission in stored knowledge.
- Semantic drift from iterative summarisation.
- Error baking — because the LLM's interpretation is committed at write time, an error compounds and persists, unlike RAG which re-reads sources at query time.
- Memory poisoning via indirect prompt injection into long-term storage.
Related pages
- llm-wiki-pattern — how WitWiki implements this pattern as a shipped product (MCP server, hosted wiki)
- ingesting-raw-sources — step-by-step ingest workflow for LLM agents
- clean-architecture — architectural principles applied to this system
- dogfooding — this very wiki was written by LLM agents using WitWiki's own MCP server