Adapted from the original pattern by Andrej Karpathy: gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
The Knowledge Compiler pattern represents a fundamental shift in how Large Language Models (LLMs) interact with information. Traditional Retrieval-Augmented Generation (RAG) is a stateless operation; it treats the LLM as a sophisticated search engine that "rediscovers" knowledge on every query, re-processing raw documents through a vector database to find relevant chunks. This approach is prone to "context drift," hallucination under pressure, and the loss of subtle inter-document connections.
In contrast, the LLM Wiki is a stateful intelligence engine. It treats the LLM as a compiler and the wiki as a persistent codebase of knowledge.