Technical brief / Developer Tools
Can an LLM wiki replace RAG when RAG is supported by Docling?.
What happened
Andrej Karpathy published his LLM wiki idea on 4 April 2026. In retrieval-augmented generation (RAG), software searches for source passages and gives them to a language model to write an answer. For example, a policy question can prompt a search that brings the old and new policy into the same answer. Karpathy's concern is that the model has to put that relationship together again for the next question. Karpathy's LLM wiki idea
His alternative keeps an unchanged source archive and a directory of linked Markdown pages that the model maintains. A wiki page could already explain that a new policy superseded an old one and link to both. The third layer is a set of operating instructions, or schema, such as AGENTS.md. For example, it can tell the agent where to copy a new source and which wiki pages to review when adding it.
The distinguishing feature is accumulation. Adding a source can revise several concept pages, record contradictions and update the index. Useful answers can be filed back into the wiki instead of disappearing into chat history. Karpathy reports that an ordinary index.md works at his moderate scale of roughly 100 sources and hundreds of pages, while suggesting proper search as the collection grows.
Docling converts PDFs, office documents and images into a common DoclingDocument representation that retains layout, reading order and table structure. Chunking divides a converted document into passages for search. For example, you can keep a table with its caption in one passage. For a wiki, archive the conversion alongside the original so the agent can trace a summary back to its source. Docling project · Docling chunking
Why it matters
Basic RAG is often criticised as though retrieval itself were the only problem. In practice, the failure may have happened earlier. A PDF parser can lose headings, mix columns, detach a table from its caption or split related content into unrelated chunks. Retrieval cannot recover structure that ingestion discarded.
Docling's hierarchical chunker follows the document's sections and attaches metadata, such as the heading and caption that identify a passage. Its hybrid chunker also counts tokens, units of text such as words or word fragments. If a section is too long for the search model, the chunker can split it into smaller pieces while retaining its heading. Docling chunking
A 2026 study compared ways to prepare Portuguese administrative documents for RAG. In Table 4, Docling with hierarchical splitting and image descriptions scored 94.1% on the authors' answer-accuracy measure. The strongest manually prepared Markdown configuration in that table scored 92.9%, and the plain PDF loader scored 86.2%. The study used 50 test questions and evaluated document preparation for RAG. Published paper, Table 4
Correction, 15 November 2026. Updated the baseline figures to match Table 4 of the published study. Published paper
What can actually be replaced
Vector search compares embeddings, lists of numbers that represent text, to find useful passages. For example, the question “Which policy applies now?” can match a passage headed “Supersession”. A vector database stores those lists for comparison. A small wiki can instead use file links and lexical search, which finds matching terms such as an exact policy identifier.
| RAG component | Can the wiki replace it? |
|---|---|
| Document conversion | No. Docling remains useful for both designs. |
| Embedding generation | Yes, when linked pages and lexical search provide enough discovery. |
| Vector database | Yes, for a moderate wiki navigable through index.md, links and file search. |
| Query-time chunk assembly | Mostly. Relevant synthesis is prepared during ingestion instead. |
| Immutable source archive | No. Wiki pages are derived interpretations, not original evidence. |
| Exact evidence retrieval | Only if wiki pages preserve precise citations and the agent can open the linked source. |
| Large-scale corpus discovery | Usually not. The wiki eventually needs a search index of its own. |
The wiki wins when recurring questions depend on cross-document synthesis. A concept page can already record that two product names refer to the same system, a policy superseded an earlier one and three separate documents jointly define the recovery procedure. RAG may reconstruct that relationship correctly, but it has to retrieve the right pieces each time.
Searching the prepared source passages is useful when recall matters. Recall measures how much relevant material the search finds, such as whether it returns all three passages needed to explain a recovery procedure. A source search can find a table row that never reached a wiki page. Re-indexing a changed document makes the new passages searchable while the wiki pages are still being updated.
When replacement is realistic
Replacing vector RAG with an LLM wiki is credible when most of these conditions hold:
- the corpus is curated and moderate rather than open-ended;
- sources arrive slowly enough to be reviewed during ingestion;
- questions emphasise explanation, comparison and accumulated understanding;
- wiki pages carry source links and useful provenance;
- an agent can inspect the Docling-derived source when exact evidence is needed; and
- missing a low-salience detail is inconvenient rather than dangerous.
The replacement becomes risky when the corpus contains thousands of changing documents, access controls vary by document, comprehensive recall matters, users need exact quotations or tables, or ingestion must be fully automatic. In those cases, maintaining wiki coverage becomes another difficult indexing problem.
An error in a wiki page can persist across many answers. Keep an unchanged copy of the Docling export and link material claims to stable document or section identifiers. Linting means checking the wiki for problems on a regular basis, such as a source link that points to a missing document.
A replacement architecture
A wiki-first system can avoid embeddings and a vector database while keeping Docling as the ingestion layer:
If file search starts missing important sources, add search over the archive. BM25 ranks documents by how well their words match the query, giving more weight to uncommon terms such as a specific policy identifier. Hybrid retrieval combines word-based and vector search so the system can also find relevant passages that use different wording.
My opinion
For a curated research collection of roughly the scale Karpathy describes, I would start with Docling, immutable Markdown sources, an LLM-maintained wiki and ordinary search. I would not add embeddings or a vector database until missed evidence demonstrates the need.
For a large, fast-changing or regulated corpus, I would keep Docling-supported RAG and use the wiki only as a maintained synthesis layer.
AI Disclosure
Researched and drafted with AI assistance, then reviewed by Søren Dalby. Sources are linked; errors may remain, and corrections are welcome.