RAG vs Compiled Knowledge
The Distinction
RAG (Retrieval-Augmented Generation) — retrieve relevant chunks from raw documents at query time, generate answer from scratch. Stateless. No accumulation.
Compiled Knowledge — LLM pre-processes sources into structured, interlinked pages. Cross-references, contradictions, and synthesis are computed once and maintained. Query-time work is minimal.
Arguments for Compiled Knowledge
- Synthesis across 5+ documents doesn’t need to be re-derived every time (Karpathy)
- Cross-references are pre-built — the LLM doesn’t need to discover connections at query time
- Contradictions are flagged proactively, not missed during retrieval
- Knowledge compounds — each new source enriches the existing structure
- The maintenance cost is near-zero with LLMs doing the bookkeeping
Arguments for RAG
- Simpler to implement — no wiki maintenance logic needed
- Works well for factual lookup (find the right chunk, return it)
- No risk of wiki going stale or accumulating errors
- Scales to very large corpora without manual structure
Open Questions
- At what scale does compiled knowledge break down? (Karpathy suggests ~100 sources / hundreds of pages is fine with just an index file)
- Can the two approaches be combined? (Compiled wiki for core knowledge, RAG fallback for long tail)
- How do you handle confidence/provenance when the wiki is many layers removed from raw sources?