Files
nexus/wiki/concepts/RAG.md

1.2 KiB
Raw Blame History

id, title, type, tags, sources, last_updated
id title type tags sources last_updated
rag RAG concept
LLM
retrieval
augmentation
RAG从入门到精通系列1基础RAG
LLM Terms Framework
2025-12-18

Definition

RAGRetrieval Augmented Generation检索增强生成是一种结合检索系统和LLM生成的技术解决LLM缺乏最新和私有数据的问题。

Three-Step Process

  1. 索引Indexing将文档切分并转换为Embedding向量存入向量数据库
  2. 检索Retrieval:根据问题语义向量检索相关文档块
  3. 生成Generation将问题和相关文档输入LLM生成答案

Key Components

  • Embedding:将文本转换为数值向量
  • 向量数据库存储和检索向量表示如Qdrant
  • 文档切分将长文档分割成符合Embedding窗口的块
  • Context Window模型能接受的上下文长度限制512-8192 token

Why It Matters

解决LLM的幻觉问题让模型能够

  • 访问最新信息
  • 利用私有数据
  • 提供可溯源的回答

Connections