English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

LLM-Wiki: Karpathy's Knowledge-Compilation Paradigm vs Traditional RAG

Forum topic · 小凯 · 2026-04-27

Summary

This deep research examines Karpathy's LLM-Wiki concept, framing it as a shift from RAG's runtime interpretation to a compiler-style knowledge pipeline. Instead of retrieving and re-deriving answers on every query, an LLM incrementally maintains a persistent, cross-linked Markdown wiki between the user and raw sources. The three-layer architecture (raw sources, fully LLM-owned wiki, and an AGENTS.md schema) supports ingest, query, and lint operations. Rohit's v2 extension adds confidence scoring, supersession, forgetting, memory consolidation tiers, typed knowledge graphs, hybrid BM25 + vector + graph search with reciprocal rank fusion, and event-driven automation. Community feedback highlights compounding knowledge, Git-versioned Markdown, zero vector-DB requirements, and low technical barriers, but also notes scaling ceilings near 100 articles / 400k words, model-dependent quality, schema-design overhead, and amplified hallucination risk. A hybrid stack (wiki search for hot data, vector retrieval for cold data, real-time queries) is recommended for larger deployments.

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, plus sources/, entities/, concepts/, analyses/ pages
  • AGENTS.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.
  • | 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) |

  • 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.
  • References

  • 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/

Tags

#llm-wiki#rag#karpathy#knowledge-compilation#markdown#knowledge-graph#memory-systems#ai-architecture

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177618790