Skip to content

Paradigm Comparison: RAG vs LLM Wiki

Two fundamentally different approaches to building AI knowledge infrastructure.

Pipeline Overview

RAG Pipeline
────────────────────────────────────────────────────────
Raw docs → chunk → embed → vector store
                                         ↘ [query time]
                              query → ANN search → LLM → answer


LLM Wiki (Knowledge Compilation)
────────────────────────────────────────────────────────
Raw docs → LLM compiles → structured wiki pages → FTS index
                                                           ↘ [query time]
                                    query → FTS / graph → read page → answer

Dimension-by-Dimension Comparison

DimensionRAGLLM Wiki
Core operationRetrieve at query timeCompile at write time
StorageVector DB + raw chunksStructured Markdown + SQLite FTS
SearchANN similarity searchFTS5 BM25 + graph traversal
Knowledge formImplicit (vectors)Explicit (readable Markdown)
AuditabilityLowHigh (git diff, lint)
Multi-hop reasoningLLM-dependentVia related graph links
Embedding requiredYesNo (pure FTS)
Knowledge accumulationNone (static index)Compounds over time
Token cost at query timeHigh (raw chunks passed to LLM)Low (pre-compiled page)
LatencyHigher (ANN + LLM)Lower (FTS sub-millisecond)
InfrastructureVector DB requiredSQLite only
Human readabilityNo (vectors opaque)Yes (plain Markdown)
Best forBroad doc Q&A, real-time/live dataLong-term knowledge, agent memory, research

When to Use Each

Choose RAG when:

  • You need to query a large, dynamic corpus that changes frequently
  • Real-time or near-real-time data ingestion is required
  • Semantic similarity across heterogeneous documents matters most
  • You don't need to maintain or review the knowledge layer

Choose LLM Wiki when:

  • Knowledge needs to accumulate and improve over time
  • Auditability and human review of knowledge are important
  • Agents need to search and reason across a curated knowledge base
  • You want to minimize query-time token costs
  • You want offline-capable, zero-infrastructure search

They Are Not Mutually Exclusive

Many production systems combine both:

  • RAG for broad retrieval across large, changing corpora
  • LLM Wiki as a curated, high-quality knowledge layer for known domains

Example hybrid: raw ingestion via RAG pipeline → high-confidence results compiled into wiki pages for long-term reuse.


See also: RAG Technologies · LLM Wiki Technologies

Released under the MIT License.