Files
nexus/wiki/sources/RAG从入门到精通系列1:基础RAG.md

2.4 KiB
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
RAG从入门到精通系列1基础RAG source
rag
llm
retrieval-augmented-generation
向量数据库
https://mp.weixin.qq.com/s/TlFNOw7_3Q8qywKLpVUmfg
2026-04-15

Source File

  • raw/AI/RAG从入门到精通系列1基础RAG.md

Summary

  • 核心主题:基础 RAG检索增强生成的技术原理与工程实践
  • 问题域:如何让 LLM 使用外部私有数据或最新数据
  • 方法/机制Indexing文档加载→切分→向量化→存入向量库→ Retrieval问题向量化→相似度检索→ Generation问题+知识片段→PromptTemplate→LLM生成
  • 结论/价值RAG 是连接 LLM 与外部数据源的通用方法LangChain/LlamaIndex 等框架可简化管道构建

Key Claims

  • LLM 本身不具备特定任务相关的私有数据或最新数据
  • RAG 通过 Indexing-Retrieval-Generation 三阶段将外部数据连接到 LLM
  • Embedding Model 的 Context Window 有限512~8192 token需将文档切分成 Split
  • Vector Store 实现各种 Embedding Vector 相似度比较方法
  • LangChain/LlamaIndex 框架可简化检索与生成链路的串联

Key Concepts

  • RAG:检索增强生成,连接 LLM 与外部数据源的方法
  • Embedding:将文本转为固定长度数值向量,捕获语义信息
  • 向量数据库:存储 Embedding Vector实现相似度检索
  • Indexing:文档加载、文本切分、向量化、存入向量库的过程
  • Retrieval:根据问题语义向量检索相似知识片段
  • Generation:将问题+知识片段输入 LLM 生成答案
  • LangChainLLM 应用开发框架,支持 RAG 管道构建
  • Token模型处理文本的基本单位英文3-4字母/中文1汉字 ≈ 1 token
  • Context WindowEmbedding Model 能接受的最大 token 数通常512~8192
  • Split/文档块:切分后的文档片段,满足 Embedding Model 长度限制

Key Entities

  • LangChainLLM 应用开发框架
  • QdrantRust 编写的开源向量数据库
  • BAAI:开源 Embedding Model 提供方(如 BGE 系列)

Connections