What is RAG? Retrieval-augmented generation explained

Why LLMs need an external library, and where RAG fits (or doesn’t).

One analogy

An LLM is a brilliant scholar two years behind on news; RAG fetches relevant passages from your library and hands them over with the question — grounded answers, with citations.

Use cases & tools

Personal document Q&A → NotebookLM; team/product knowledge bases → platforms like Dify; live web retrieval with citations is exactly what Perplexity does.

Not a silver bullet

Chunking and retrieval quality set the ceiling: garbage in, garbage out. Cross-document reasoning and aggregation often need long context or structured queries instead.

中文

RAG 是什么?检索增强生成入门与应用场景

为什么大模型需要"外接资料库",以及 RAG 适合/不适合的场景。

一个比喻讲明白

大模型像记忆力惊人但两年没看新闻的学者;RAG 是先去你的资料库里查出相关段落,连同问题一起给他——回答有据可依,还能给出处。

典型场景与工具

个人资料问答用 NotebookLM 最快;给团队/产品搭知识库问答用 Dify 这类平台;"全网即时检索+引用"其实就是 Perplexity 的形态。

RAG 不是银弹

资料切分与检索质量决定上限:垃圾进垃圾出。需要跨文档推理、汇总统计时,RAG 常常力不从心,要配合长上下文或结构化查询。

Keep reading / 继续阅读