RAG vs Wiki Compilation
Fundamental architectural comparison between traditional Retrieval-Augmented Generation (RAG) systems and andrej-karpathy's llm-wiki-pattern approach to knowledge management. Represents a shift from ephemeral retrieval to persistent knowledge compilation.
Core Philosophical Difference
Traditional RAG: Knowledge is rediscovered from scratch on every query Wiki Compilation: Knowledge is compiled once and maintained persistently
This difference has profound implications for knowledge accumulation, query efficiency, and system sophistication over time.
Operational Comparison
Traditional RAG Workflow
- User asks question
- System retrieves relevant document chunks
- LLM pieces together fragments at query time
- Generates answer from scratch
- Answer disappears into chat history
Wiki Compilation Workflow
- Sources ingested incrementally into persistent wiki
- Knowledge integrated with existing understanding
- User asks question
- System searches pre-compiled wiki pages
- LLM synthesizes from maintained knowledge
- Good answers filed back as new wiki pages
Architectural Trade-offs
RAG Advantages
- Simplicity: Straightforward to implement and understand
- Source Fidelity: Directly references original document chunks
- Real-time: Can incorporate new documents immediately
- Stateless: No complex state management required
RAG Limitations
- Redundant Work: Same analysis repeated for similar queries
- Fragment Dependency: Quality depends on chunk retrieval accuracy
- No Accumulation: Insights don't compound over time
- Context Loss: Subtle connections require re-discovery each time
Wiki Compilation Advantages
- Knowledge Compounding: Understanding builds and strengthens over time
- Sophisticated Synthesis: Cross-references and contradictions pre-analyzed
- Query Efficiency: Answers draw from compiled knowledge, not raw chunks
- Persistent Learning: System gets smarter with each source and query
Wiki Compilation Limitations
- Complexity: Requires sophisticated maintenance workflows
- Delayed Integration: New sources need processing before availability
- State Management: Must maintain consistency across evolving knowledge base
- Schema Evolution: System architecture must adapt as understanding grows
Scaling Characteristics
RAG: Performance degrades with document volume due to retrieval complexity Wiki Compilation: Performance improves with volume as knowledge density increases
Use Case Suitability
RAG Optimal For
- Document search and basic Q&A
- Large, relatively static document collections
- Simple factual retrieval tasks
- Systems requiring immediate source transparency
Wiki Compilation Optimal For
- Research and analysis over time
- Complex synthesis across multiple sources
- Personal knowledge management
- Domains requiring evolving understanding
Knowledge Quality Evolution
RAG: Knowledge quality remains constant - system doesn't learn Wiki Compilation: Knowledge quality improves through:
- Cross-source validation and contradiction resolution
- Incremental refinement of understanding
- Connection discovery between previously isolated concepts
- Synthesis sophistication increases with experience
Implementation Complexity
RAG: Vector databases, embedding models, retrieval tuning Wiki Compilation: Schema design, maintenance workflows, consistency checking
Future Hybrid Approaches
Emerging systems may combine both approaches:
- Wiki compilation for core knowledge domains
- RAG fallback for novel or peripheral queries
- Automatic promotion from RAG results to wiki compilation