Files

46 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
id: ai.rag.index
title: RAG 检索增强生成
type: index
domain: ai
stack: [rag]
tags: [RAG, 检索, 知识库, 评测]
week: [5, 6]
---
# RAG 检索增强生成
RAG(Retrieval-Augmented Generation):先从知识库检索相关资料,再让大模型基于资料回答。这是企业 AI 应用里落地最多的形态(制度问答、客服知识库、文档助手),也是 AI 应用岗位面试的必考题。重点不在“调通一个 demo”,而在**切分、混合检索、权限、引用和拒答、评测**这些决定效果和能否上线的环节。
## 学习路线
| 顺序 | 课程 | 级别 | 预计 |
| --- | --- | --- | --- |
| 1 | [RAG 流水线和文档切分:加载、清洗、切分策略、元数据](01-pipeline-chunking.md) | 基础 | 3 小时 |
| 2 | [检索优化:向量 + 关键词混合检索、RRF 融合、重排、查询改写](02-hybrid-rerank.md) | 进阶 | 3 小时 |
| 3 | [生成与评测:带引用的提示词、拒答、检索评测和答案评测](03-generation-eval.md) | 进阶 | 3 小时 |
## 企业场景
- [带权限的企业知识库问答:不同部门看到不同内容](scenarios/permission-aware-kb.md)
## 面试题
- [RAG 面试题](interview.md)
## 示例代码
- [examples/mini-rag](examples/mini-rag/):不依赖外部服务的最小 RAG 流水线——按标题切分、混合检索(向量 + BM25 + RRF)、权限过滤、拒答阈值、带引用的提示词、Recall@3 / MRR 评测(需要 `jieba`、`rank_bm25`、`numpy`)
## 在 16 周计划中
- [第 5 周:RAG(一)](../../../plan/week05-rag-1.md)、[第 6 周:RAG(二)](../../../plan/week06-rag-2.md)
## 官方资料
RAG 相关的框架和模型服务更新很快,接口和参数以官方文档为准:
- LangChain 检索相关文档:https://docs.langchain.com/
- LlamaIndex:https://developers.llamaindex.ai/
- Ragas(RAG 评测):https://docs.ragas.io/