Karpathy LLM Wiki Source
karpathy-llm-wiki-source (commonly referred to as the LLM Wiki pattern) is a conceptual methodology for personal knowledge management (PKM) introduced by Andrej Karpathy in April 2026. Rather than relying on traditional Retrieval-Augmented Generation (RAG), which retrieves and synthesizes information dynamically for each query, this pattern utilizes an AI Agent to actively and incrementally ācompileā raw information into a structured, persistent, and interlinked set of Markdown files.
Core Philosophy: āCompile, Donāt Retrieveā
In standard RAG systems, the LLM reads chunks of raw documents to answer questions but does not build long-term, evolving associations, effectively starting from scratch every time. The LLM Wiki pattern introduces a shift by treating knowledge as a compiled, structured codebase:
- Accumulative Knowledge: New source materials (PDFs, notes, articles) are read by the AI agent, which updates existing entity files, creates cross-references, and integrates new insights.
- Conflict Resolution: The agent actively flags contradictions or discrepancies between new and existing sources.
Key Features
- Active Compilation & Maintenance: The knowledge base is updated continuously or on-demand by an agent following a defined schema.
- Self-Healing/Linting: The agent runs checks for orphaned pages, stale claims, or broken links to maintain organization.
- Interlinked Structure: Uses bidirectional
[[wiki-links]]to build a semantic map of concepts. - Portability & Human-Readability: Because the output consists of plain Markdown files, it remains accessible, future-proof, and can be viewed using frontend tools like Obsidian.
Typical Architecture
The pattern is implemented using three main directories/configuration layers:
- Raw Sources (
raw/): A directory containing immutable input documents (transcripts, papers, articles). - The Wiki (
wiki/): A collection of structured, cross-linked Markdown files representing the compiled knowledge base. - The Schema (
CLAUDE.md): A configuration file detailing instructions for the AI agent (e.g., Claude Code) on how to ingest files, link entities, and format updates.
Related Topics
- Retrieval-Augmented Generation (RAG)
- Agentic Workflows
- Personal Knowledge Management (PKM)
- Semantic Knowledge Graphs