Files
nexus/wiki/concepts/RAG.md

42 lines
1.2 KiB
Markdown
Raw 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: rag
title: "RAG"
type: concept
tags: [LLM, retrieval, augmentation]
sources:
- "[[RAG从入门到精通系列1基础RAG]]"
- "[[LLM Terms Framework]]"
last_updated: 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
- [[LLM]] ← uses ← [[RAG]]
- [[RAG]] ← includes ← [[索引]]
- [[RAG]] ← includes ← [[检索]]
- [[RAG]] ← includes ← [[生成]]
- [[RAG]] ← extends ← [[LLM]]