Skip to main content

LLM Wiki vs. RAG: What Each One Is and Benchmarks

A benchmark comparing LLM Wiki and RAG on a 1,176-line Python library reveals wikis are slower and costlier, yet win on unrecorded decisions.

AI-written
Inewgen
Live15 Oct 2026Source: Dev.to3 min read (0 views)
Share
LLM Wiki vs. RAG: What Each One Is and Benchmarks

Stock photo for illustration only, not from the actual event

Font size
  • LLM Wikis are markdown page folders written and maintained by an agent with citations.
  • RAG retrieves document chunks into prompts without writing anything back.
  • On a small 1,200-line codebase, using a wiki is slower and more expensive than no wiki.
  • Wikis only win when answering questions about decisions never written in source code.

In software development, people often treat "LLM wiki" and "RAG" as two ways of achieving the same goal. In reality, they serve different functions. A recent experiment built a wiki for a real codebase and tested four identical questions with and without it. The results showed that operating without a wiki was faster, cheaper, and just as accurate, except for a fifth question whose answer never existed in the source files at all, highlighting the core distinction between the two approaches.

To define the terms properly, RAG (retrieval-augmented generation) is when a retriever finds the most relevant document chunks from a document store upon a query and pastes them into the prompt for the model to answer. The store remains a static copy of sources with no write-back mechanism. Meanwhile, agentic retrieval is what most coding agents use today without a vector database, where the agent runs shell tools to grep and read files in a loop until it finds the answer, matching how Claude Code operates on a bare repository.

developer workspace computer code editor

Stock photo for illustration only, not from the actual event

An LLM wiki consists of a folder of markdown pages written and maintained by an agent, featuring one page per concept, decision, or module, complete with source citations and internal wikilinks. When a question cannot be answered from these pages, the agent reads the source files and writes down what it learned so subsequent queries can skip them. The benchmark targeted pallets/itsdangerous, the signing library under Flask sessions, consisting of 1,176 lines of Python across 8 modules, a 292-line CHANGES.rst file, and 7 documentation pages.

55%Slower on the first pass
34%More expensive per question
$4.23Cost to build the wiki

Testing began with four typical integration questions answered against the codebase sources, yielding correct outputs with valid citations. Building the wiki via initialization prompts produced varying results across runs, demonstrating that wiki builds are non-deterministic. Querying the wiki read the index and relevant pages, falling back to sources only when necessary while updating its notes for future use.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

"RAG retrieves what was written. A wiki also records what was decided."

Vellum Labs

Deeper analysis reveals that on a 1,200-line codebase, a wiki functions as a worse RAG than having no RAG at all. The initial pass is 55% slower and 34% more expensive per question. Even after write-backs, repeat queries cost roughly the same as reading cold source files, meaning the retrieval savings never amortize the initial build cost on this scale.

The turning point arrives with the fifth question concerning a team review decision—such as keeping at most three secret keys and dropping the oldest every 30 days—which was never documented in source code, changelogs, or documentation. Because RAG and agentic retrieval can only find what someone previously wrote down, only a tool with a capture command like a wiki can record and retrieve such decisions, making it the deciding factor between a system that can answer and one that cannot.

Source: Dev.to

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article