LLM-Wiki: Karpathy's Knowledge-Compilation Paradigm vs Traditional RAG
Key points
- Core insight: interpretation vs compilation. RAG re-derives knowledge on every query (stateless, runtime assembly, chunk-level citations). LLM-Wiki compiles knowledge at ingest time into a persistent, cross-linked Markdown wiki with source-level traceability, surfaced contradictions, and accumulated synthesis.
- Three-layer architecture.
raw/— immutable source files (LLM read-only)wiki/— fully LLM-owned:index.md,log.md, plussources/,entities/,concepts/,analyses/pagesAGENTS.md— schema that disciplines the LLM as a wiki maintainer- Three core operations. Ingest (summarize → extract entities/concepts → create/update pages → cross-link → update index+log), Query (synthesize from existing pages; archive good answers), and Lint (detect contradictions, orphans, missing references).
- Rohit's v2 enhancements. Confidence scoring per fact, explicit supersession of outdated claims, gradual forgetting of unused facts, memory consolidation tiers (raw observation → episodic → semantic → procedural), typed entity–relation knowledge graphs, hybrid search via BM25 + vectors + graph traversal with reciprocal rank fusion, and event-driven automation (auto-ingest on new sources, auto-archive on session end, scheduled lint).
- Comparison table.
- Strengths reported by practitioners. Compounding knowledge, near-zero maintenance, no vector database needed, Git-friendly Markdown, works best within roughly 100k tokens of content.
- Pain points. Token cost grows with wiki size, output quality is model-bound, schema design requires iteration, hallucinations can get baked into the wiki, soft ceiling around 100 articles / 400k words, no built-in memory decay, human review needed for high-precision domains.
- Selection guidance. LLM-Wiki fits personal research (≤100 sources / ≤400k words), knowledge-dense cross-document reasoning, and fully local setups. RAG remains better for million-document enterprise corpora and highly dynamic, open-ended queries. A recommended hybrid stack layers wiki search (hot core), vector retrieval (cold edge), and real-time query for the freshest data.
- Conclusions. LLM-Wiki is not a RAG replacement but a different problem-solving axis — "knowledge compilation" rather than "retrieval optimization." The schema (AGENTS.md) is the real product. Scaling limits are real but extendable. LLM capability sets the ceiling, so a human-in-the-loop review layer is advisable.
- Karpathy original: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
- AGISeek tutorial: https://github.com/AGISeek/llm-wiki
- Rohit's v2: https://gist.github.com/rohitg00/2067ab416f7bbe447c1977edaaa681e2
- BrainDB discussion: https://www.reddit.com/r/LocalLLaMA/comments/1sq8yms/braindb_karpathys_llm_wiki_idea_but_as_a_real_db/
| Dimension | RAG (interpret) | LLM-Wiki (compile) | |---|---|---| | Assembly time | Query time | Ingest time | | State | Stateless | Stateful | | Cross-references | Discovered ad hoc | Pre-built | | Contradiction detection | Invisible until queried | Flagged at ingest | | Citation quality | Chunk-level (lossy) | Source-level (traceable) |