跪拜 Guibai
← All articles
Frontend · AI Programming · Artificial Intelligence

RAG vs Markdown+grep vs LLM Wiki: Choosing a Knowledge Base That Survives Production

By FatMii ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

RAG's operational overhead and lack of knowledge persistence are pushing teams to either simplify with plain-text search or adopt compile-on-ingest wikis. Choosing the right architecture based on data size, structure, and iteration cadence saves you from building an expensive vector pipeline that rots or a brittle keyword hack that can't scale.

Summary

RAG has been the default for private document Q&A, but its production pain is real: vector databases add operational weight, retrieval latency shows under load, and each query is a one-off splice that never builds a persistent knowledge body. A shift from query-time retrieval to ingest-time compilation is the proposed answer.

Two alternatives get detailed treatment. Markdown+grep skips vectors entirely, storing knowledge as structured Markdown and relying on grep/rg to pull context, then letting an LLM summarize. It's minimal, but it demands disciplined document structure and offers no automatic linking or correction.

The newcomer is LLM Wiki, proposed by Andrej Karpathy, where an LLM compiles incoming documents into an interconnected Markdown wiki during ingestion, then updates it incrementally, so queries need zero retrieval. The three are complementary: RAG for big static corpora, Markdown+grep for small stable notes, and LLM Wiki for long-term evolving knowledge.

Takeaways
— RAG builds a vector index from chunked documents, retrieves at query time, but needs a vector database and shows latency under high concurrency; knowledge is discarded after each answer.
— Markdown+grep stores all knowledge as structured Markdown, uses grep/rg to match keywords, then sends the context to an LLM for summarization; it works best with clean, organized docs.
— LLM Wiki, proposed by Andrej Karpathy on April 3, 2026, compiles ingested documents into structured Markdown wikis at ingest time, with incremental updates and zero-retrieval queries.
— The article recommends RAG for large static data, Markdown+grep for small personal/team knowledge bases, and LLM Wiki for long-term dynamic knowledge accumulation.
Conclusions

A central claim is that RAG's query-time retrieval is wasteful because it never builds a durable knowledge structure; the LLM Wiki answer moves the cost to ingestion, which is a different trade-off that may not fit every dataset.

Markdown+grep is a vote of confidence in human-curated, structured text over vector similarity; for many internal use cases, deterministic search beats embeddings when the docs are clean.

LLM Wiki's success depends on how reliably an LLM can compile and maintain a consistent knowledge graph; the mention of only one notable open-source implementation suggests the approach is still unproven at scale.

Concepts & terms
RAG (Retrieval-Augmented Generation)
A technique that retrieves relevant document fragments from a vector database at query time and feeds them into the LLM to ground its answer.
Markdown+grep
A lightweight knowledge base approach that stores all knowledge as structured Markdown and uses grep/rg to find relevant passages, then passes them to an LLM for summarization.
LLM Wiki
A knowledge base paradigm where the LLM compiles ingested documents into a linked Markdown wiki during ingestion, so queries require no retrieval and the knowledge base can be updated incrementally.
From the discussion

The discussion centers on two fundamental weaknesses in knowledge-base approaches: handling knowledge conflicts and performing semantic search. One position holds that technology alone cannot resolve evolving or conflicting knowledge, so intelligent Q&A should expose original sources and let users decide, rather than force a standard answer. Another position attacks keyword-based retrieval (like Option 2) as unable to match paraphrases, such as a user searching "how to buy tickets" against the official term "buy tickets," concluding that vectorization is necessary. The split is between relying on human judgment and context versus pursuing automated semantic understanding.

— Knowledge conflict and iteration require human judgment; technology cannot fully solve them, so Q&A systems should present conflicting sources and citations instead of a single standard answer.
— Keyword-based retrieval without vectorization fails on synonymy: official terms like "buy tickets" cannot match a user's natural phrasing "how to buy tickets," rendering searches useless.
— The tension lies in whether to prioritize human-in-the-loop accuracy via exposed original text or invest in semantic vectorization for automated recall, with the latter adding infrastructure complexity.
Featured comments
老年白兔码农 2 likes

Knowledge conflicts and knowledge iteration ultimately depend on humans; technology can't solve them. Moreover, "intelligent Q&A" should not force a "standard answer" but should expose the conflicting parts and the cited original text to users, letting them judge for themselves. Intelligent Q&A, or rather it should be called "intelligent consultation."

FatMii

This is a good idea, thumbs up.

黎大仙

Option 2 is essentially similar to an ES (Elasticsearch) solution. There's a serious problem: it can't do semantic search. For example, our official term is "buy tickets". Without vectorization, if a user searches "how to buy tickets", no answers can be retrieved at all.

金果果金陌陌

Keyword retrieval, but not semantic.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗