LLM-Wiki Setup Tutorial: Karpathy's Self-Evolving Personal Knowledge Base Approach

LLM-Wiki transforms LLMs from interpreters into compilers for building self-evolving personal knowledge bases.
LLM-Wiki, proposed by Andrej Karpathy, addresses the limitations of traditional knowledge management and RAG approaches. Its core philosophy transforms LLMs from ad-hoc retrieval "interpreters" into knowledge-preprocessing "compilers," compiling raw documents into structured, bidirectionally-linked Wiki artifacts. This enables cross-document association analysis and continuous knowledge network evolution, creating a compounding effect where knowledge grows smarter over time.
What is LLM-Wiki?
LLM-Wiki is a revolutionary personal knowledge base building philosophy proposed by Andrej Karpathy. Karpathy is an iconic figure in deep learning—after completing his PhD under Fei-Fei Li at Stanford University, he became one of the founding members of OpenAI. In 2017, he joined Tesla as AI Director, leading the development of the Autopilot pure-vision autonomous driving system. After leaving again in 2023, he founded the AI-native education company Eureka Labs, dedicated to restructuring the learning experience with AI. His educational content on X (formerly Twitter) is renowned for making complex topics accessible, and his open-source project nanoGPT is widely used by developers worldwide to learn LLM fundamentals. LLM-Wiki is a methodology distilled from his personal knowledge management practice, embodying his signature thinking style of "redesigning systems from first principles."
The core motivation behind LLM-Wiki is that traditional knowledge management approaches are fundamentally flawed. Papers, articles, screenshots, and bookmarks we collect online are scattered everywhere, forming isolated information silos that ultimately become "digital garbage." While traditional RAG (Retrieval-Augmented Generation) introduces LLMs into the mix, it's essentially a "one-shot deal"—each query is independent, knowledge cannot compound, and your 100th note doesn't make your 1st note any smarter.
Technical Limitations of Traditional RAG: RAG operates in two phases—the offline phase splits documents into fixed-length text chunks, converts them into high-dimensional vectors via an Embedding Model, and stores them in a vector database (e.g., Pinecone, Chroma); the online phase vectorizes user queries, retrieves the most relevant chunks via cosine similarity, then feeds them to the LLM for answer generation. The core limitations of this architecture are: document chunking destroys the holistic semantic structure of knowledge; vector similarity search excels at "literal matching" but struggles to capture deep logical connections; each query is independent, with historical interactions unable to accumulate into reusable structured knowledge; and the retrieval process is a black box—results are unpredictable and difficult to debug.
The core idea of LLM-Wiki is to transform the LLM from an interpreter into a compiler: instead of ad-hoc retrieval and answer assembly, raw documents are pre-"compiled" into structured, highly interconnected Wiki artifacts. This analogy draws from a fundamental concept in computer science—an Interpreter reads source code line by line and executes it on the fly, re-parsing on every run with no ability to accumulate optimization information across executions; a Compiler transforms source code into optimized intermediate artifacts in one pass, with subsequent execution directly using the compiled output, and the compilation process performing global optimizations. LLM-Wiki borrows the compiler's "preprocessing + global optimization" approach: raw documents are the source code, Wiki pages are the compiled artifacts, and during "compilation" the LLM not only distills individual documents but also performs cross-document global association analysis. Every new piece of knowledge input automatically updates related existing pages, and the knowledge network continuously iterates and grows through use, achieving exponential evolution—getting smarter the more you use it.

LLM-Wiki's Three-Layer Architecture
LLM-Wiki employs a clear three-layer architecture, with each layer serving a distinct purpose:
Layer 1: Raw Data Layer (Raw)
This is the directory for storing raw documents, including manually saved articles, web bookmarks, screenshots, emails, PDFs, quick notes, and personal analysis reports. This layer follows a read-only policy—contents in the directory can only be read by the LLM, never written to or modified, thereby permanently preserving untampered factual baselines and ensuring knowledge source traceability.
Layer 2: Wiki Artifact Layer
Content in the Wiki folder is entirely auto-generated by the LLM, containing entities, concepts, summaries, and a bidirectional link network. Bidirectional Links are the core data structure of this layer—a concept first proposed by hypertext pioneer Ted Nelson in the 1960s and later popularized by modern note-taking tools like Obsidian. Unlike unidirectional hyperlinks, bidirectional links simultaneously establish an "A→B" connection and automatically record a "referenced by A" reverse relationship on page B, enabling every knowledge node to be aware of its position within the entire network. From a graph theory perspective, LLM-Wiki constructs a directed graph where nodes are concept/entity pages and edges are reference relationships, supporting the discovery of unexpected knowledge connections through backlinks and the detection of knowledge blind spots through isolated node analysis. Similar to Wikipedia's page structure, knowledge points are interconnected through links, forming a browsable knowledge graph that enables structured, networked presentation and reuse of information.
Layer 3: Rules Layer
This is essentially an "operating manual" for the LLM, similar to a System Prompt, telling the LLM how to interpret and process content. Its core function is to tune a general-purpose LLM into a disciplined, domain-aware agent.
Related articles
TutorialsChatGPT Plus Subscription Guide: Are GPT-5.5, image-2, and Codex Worth the Upgrade?
A detailed look at ChatGPT Plus features — GPT-5.5, image-2, and Codex — with a Plus vs Pro comparison and a complete step-by-step subscription guide for users outside the US.
TutorialsHarness AI Engineering in Practice: Using Claude Code to Master Enterprise-Level E-Commerce Development
Deep dive into Harness AI Engineering: master enterprise e-commerce development with Claude Code using the Rules, Skills, Wiki, and Changes framework.
TutorialsCursor + Codex Dual-IDE Collaboration: A Practical Methodology for Open-Source Project Customization
A complete methodology for open-source project customization based on real-world experience, detailing the Cursor+Codex dual-IDE workflow, seven-stage process, MVP validation, and AI source code reading techniques.