LLM Wiki Pattern

Source: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f Author: Andrej Karpathy Date: 2025

Summary

Karpathy proposes a three-layer architecture for LLM-maintained personal knowledge bases: Raw Sources (immutable), The Wiki (LLM-maintained), and The Schema (instructions). Core insight: instead of RAG (retrieve-at-query-time), have LLMs incrementally build a persistent wiki that compounds over time. This is the pattern this wiki is based on.

Key Claims

  • Traditional RAG is stateless; the wiki is a persistent, compounding artifact
  • Cross-references are pre-built; contradictions are pre-flagged — query-time is fast
  • Three workflows: Ingest (process new sources), Query (search wiki, file results), Lint (audit contradictions)
  • Humans curate sources and ask questions; LLMs handle all bookkeeping
  • Applies to personal research, business teams, competitive analysis, hobby deep-dives
  • The schema is configuration — different schemas for different use cases

Why It Differs from RAG

  • RAG rebuilds context at query time → expensive, no compounding
  • Wiki approach pre-processes and cross-references → answers are already partly synthesized
  • Wiki surfaces contradictions proactively vs. RAG giving inconsistent answers from conflicting sources

Entities

Concepts