📷 "Wooden Touchscreen Terminal - front" by barnoid is licensed under CC BY-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/2.0/.
LLM-Wiki: Karpathy's Pattern for Persistent AI Knowledge Management
In April 2026, AI researcher and OpenAI co-founder Andrej Karpathy published a widely noticed GitHub Gist titled „LLM Wiki“. The concept went viral within a few days – over 16 million views on X and more than 5,000 stars on GitHub. The reason for this resonance: Karpathy proposed a fundamentally different approach to AI-powered knowledge management that challenges the limits of the previously dominant RAG (Retrieval-Augmented Generation) paradigm.
The Core Problem of Traditional Knowledge Systems
Most current AI knowledge systems operate on the RAG principle: documents are indexed in a vector database, relevant text passages are retrieved for a query, and passed to a language model that synthesizes an answer from them. The problem: With every query, the system starts from scratch. No knowledge accumulation occurs. A question that requires the interplay of five different documents is pieced together from raw data each time – without the system learning from previous interactions.
Karpathy compares this approach to executing source code with every request, rather than compiling it once and reusing the optimized artifact. His LLM-Wiki-Pattern transfers this „compile“ metaphor to knowledge management.
The Three-Layer Architecture of the LLM Wiki
The LLM Wiki is not a finished product, but an architectural pattern based on a strict separation of three layers:
Layer 1 – raw/ (The immutable source of truth): This directory contains all source documents in their raw format – articles, papers, meeting transcripts, blog posts. These files are immutable. The LLM reads them but never modifies them. They serve as a verifiable fact base and audit trail.
Layer 2 – wiki/ (The synthesized knowledge layer): This is the heart of the pattern. The LLM reads the raw data and generates structured, interlinked Markdown files from it – one page per concept, entity, or topic. The pages are networked via wikilinks ([[concept]]) and contain YAML frontmatter with metadata such as origin and timestamp. Three special files (index.md, log.md, overview.md) keep track.
Layer 3 – The Schema (Governance): The schema (e.g., a CLAUDE.md file) defines which concepts the wiki should track at all. It is the contract between human intention and AI execution: humans define what knowledge should be, the LLM takes care of how this knowledge is organized and kept up to date.
Differences from Classic RAG
The decisive conceptual difference: RAG is stateless, the LLM Wiki is stateful. While RAG scours the same raw data anew with every query, the LLM Wiki compiles the knowledge once into a persistent, ever-enriching artifact.
When a new source is added, the LLM does not just index it for later retrieval; it extracts the core information, integrates it into existing pages, updates summaries, marks contradictions with earlier findings, and strengthens or challenges the ongoing synthesis. The cross-references are already there, the synthesis reflects everything that has ever been read.
Use Cases and Tools
Karpathy himself describes applications from personal knowledge management (diary, health data, self-improvement) over research topics (papers, articles, reports spanning weeks and months) to team wikis fed from Slack threads, meeting transcripts, and project documents.
As a frontend, Obsidian is recommended – the Markdown files can be directly visualized and searched in its Graph View. The workflow: the AI agent (e.g., Claude Code, OpenAI Codex, or OpenCode) is open on one half of the screen, Obsidian on the other. The human curates the sources and asks questions, the agent handles all the writing and maintenance work.
The community quickly adopted the pattern. Projects such as LLMWikiNG, obsidian-llm-wiki-local (fully local with Ollama and Qwen3), or OpenKnowledge (with WYSIWYG editor and MCP support) show that the concept is implementable in various environments.
Conclusion
Andrej Karpathy’s LLM Wiki pattern is more than a short-lived hype – it addresses a fundamental problem of AI-powered knowledge management: the lack of knowledge accumulation in pure RAG systems. By purposefully leveraging the strengths of LLMs (summarizing, linking, updating) for maintaining a persistent knowledge base, a system emerges that improves with every new source. For anyone who regularly works with large amounts of information and wants to structure it systematically, this architectural pattern is worth a closer look.
Sources
- Karpathy, A.: LLM Wiki – GitHub Gist
- Hermanns, C.: Das LLM-Wiki nach Andrej Karpathy – cherware.de
- Starmorph: How to Build Karpathy’s LLM Wiki – Complete Guide
- Nayak, P.: Beyond RAG – How Andrej Karpathy’s LLM Wiki Pattern Builds Knowledge That Actually Compounds – Level Up Coding
- NiharShrotri/llm-wiki: Local LLM-maintained personal wiki – GitHub
🌐 Machine-translated from the German original, editorially reviewed. 🤖 Written with AI assistance.