AI researcher Andrej Karpathy published an architecture document introducing the "LLM Wiki" concept, a design pattern aimed at replacing conventional Retrieval-Augmented Generation (RAG). Instead of rediscovering knowledge from scratch on every query, an LLM agent incrementally builds and maintains a persistent, interlinked collection of local Markdown files. By updating 10 to 15 related wiki pages during a single source ingest, the system compiles knowledge once and compounds context over time.
The Three-Tier Architecture
Karpathy's framework shifts the workload of knowledge base maintenance from humans to AI agents. The system separates personal knowledge management into three distinct layers to ensure reliability and organization.
The bottom layer consists of immutable raw sources like research papers, clips, and data files. Above that sits the wiki itself—a directory of Markdown files containing entity pages, concept summaries, and syntheses written entirely by the LLM. The final layer is a schema file, such as CLAUDE.md or AGENTS.md, which defines rules and workflows for the agent using markdown-compatible tools like Obsidian.
Ingestion, Queries, and Automated Maintenance
Traditional RAG systems pull raw source chunks on demand, forcing models to re-derive insights repeatedly. The LLM Wiki pattern instead executes an explicit ingestion workflow where adding a single document updates topic summaries, flags contradictions, and cross-references existing pages.
The system relies on key operational workflows and tools:
- Incremental Ingest: New sources automatically update the content catalog (
index.md) and modify related concept pages across the vault. - Chronological Logging: A structured
log.mdfile tracks every ingest, query, and maintenance pass for clear timeline auditability. - System Health Checks: Periodic "linting" operations ask the agent to scan for orphan pages, outdated statements, or missing cross-references.
- Search Integration: Local search CLI tools like
qmdenable hybrid BM25 and vector search when the index file grows beyond standard context limits.
Limitations and Practical Caveats
While the system reduces bookkeeping overhead to near zero, it requires initial user setup and discipline. The architecture remains intentionally abstract, requiring users to manually define their own directory conventions and schema rules alongside their preferred agent interface. Additionally, handling visual context remains clunky, as LLMs cannot read Markdown with inline images in a single pass and must inspect raw attachments separately.