Author: Andrej Karpathy (independent researcher). Subtitle: Field Notes on Compilation-Based Knowledge Accumulation (v040426). A companion to his AISN 2026 talk (see The Karpathy Method); the talk covers spec/verifier/environment, this paper specifies the LLM knowledge base layer in detail.
Personal knowledge bases fail not from lack of content but from unsustainable maintenance burden on human curators. The paper proposes shifting that burden to an LLM agent acting as a compiler rather than a retrieval layer.
Key distinction from RAG: RAG re-derives knowledge at query time — nothing accumulates. The LLM-Wiki model derives knowledge at ingest time and caches the synthesis in a wiki. Subsequent queries read the already-compiled artefact. The wiki compounds; the corpus does not.
Strict separation of ownership is the throughline of every design decision:
• Layer 1 — raw/: Immutable source documents deposited by the human. Never edited after arrival. Articles, PDFs, transcripts, images. Ground truth.
• Layer 2 — CLAUDE.md (Schema): Configuration document co-authored by human and model, specifying directory structure, page templates, cross-reference conventions, and lint criteria. Human curates and directs; the LLM reads and follows.
• Layer 3 — wiki/: Entirely model-generated markdown. Entity pages, concept summaries, comparison tables, index, log. The human reads it; the model writes it.
• Ingest — human drops a source into raw/ and invokes the ingest procedure. Model reads the source, writes or updates a summary page, updates index.md, propagates changes to related entity and concept pages, appends to log.md. A single ingest may touch 10–15 wiki pages.
• Query — model reads index.md, retrieves relevant pages, and synthesises an answer with inline citations. Comparisons, analyses, and connections are filed back into the wiki as new pages. Exploration compounds.
• Lint — periodic health-check. Model scans for contradictions, stale claims, orphan pages, and concepts lacking their own entry. Lint output is itself a log entry.
• index.md — catalogs every page with a one-line summary organised by category. Model reads this first on every query; at ~300 pages it eliminates the need for a vector database.
• log.md — append-only chronological record. Entries prefixed ## [YYYY-MM-DD] op | title are parseable with standard Unix tools.
Scales to ~100 sources and several hundred wiki pages before a dedicated search layer (e.g. local BM25/vector hybrid) is needed. Below that threshold, the index file and the model's context window are sufficient. The wiki is a plain git repository — version history and collaboration at zero additional cost.
LLMs do not get bored, do not forget cross-references, and can touch fifteen files in a single pass. The maintenance cost that causes human-curated wikis to rot is near zero for an LLM agent. The human contribution is irreducible judgement: source selection, research direction, synthesis oversight.
This system independently arrived at many of the same ideas:
• raw/ ↔ no direct equivalent — sources referenced by link rather than stored immutably, but the agent-writes / human-reads principle is the same
• CLAUDE.md ↔ MEMORY + PROGRAMMING_RULES + TRIGGERS — schema and conventions governing agent behaviour
• log.md ↔ no equivalent yet — a design for one, exploiting KV-store data structures (day-bucketed chunks, linked-list prev pointers, tree index) rather than a single flat file, is proposed in Log Structure Proposal.
• index.md ↔ CONTENTS — one-line summaries per note, organised by category
• log.md ↔ no equivalent — an append-only log is a gap worth considering
• Ingest ↔ ad-hoc note creation when a source is discussed in session
• Query ↔ normal Claude session with notes access
• Lint ↔ Envoy cron audit for orphaned notes — partial coverage only
Key gap identified in the 2026-06 comparison session: graph visualisation. The paper does not address this either.
The compile-vs-retrieve distinction maps directly onto the Structured Context Protocol — which independently arrived at a phase model (orient/gather/plan/execute/verify/commit) that maps to Karpathy's ingest/query/lint primitives.
See also: GData Server — the underlying notes infrastructure.