Files
nexus/wiki/concepts/RAG.md
2026-04-23 05:51:04 +08:00

36 lines
1.5 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.
---
title: "RAG"
type: concept
tags: [rag, retrieval, llm, ai]
last_updated: 2025-04-23
---
## Definition
检索增强生成Retrieval-Augmented GenerationRAG是将大语言模型LLM链接到外部实时知识库的技术通过检索+生成的流程提升答案准确性和时效性。
## Core Mechanism
1. **检索Retrieval**:当用户提问时,从外部知识库(向量数据库/知识图谱/公司文档中检索最相关的信息块Chunk
2. **增强生成Augmented Generation**:将检索结果与用户问题作为上下文输入 LLM指示其严格基于上下文生成答案
## Key Benefits
- **知识更新与定制**:无需重新训练即可获取最新信息
- **消除幻觉**:提供事实依据,显著降低胡说八道的风险
- **引用来源**:可追溯信息来源,增加可信度
- **成本效益**:相比微调,成本更低、更新更快
## Role in AI System Architecture
- **认知层**RAG 作为 AI 系统的"记忆系统",负责信息获取与准确性保障
- 补充 [[Large Language Model]] 的知识时效性局限
- 为 [[AI Agent]] 提供可信赖的信息来源
## Related Concepts
- [[Large Language Model]] — 被增强的底层模型
- [[AI Agent]] — 依赖 RAG 提供准确信息
- [[Hybrid Search]] — RAG 常用检索策略
- [[Semantic Search]] — 向量检索的核心技术
## Sources
- [[llms-rag-ai-agent-三个到底什么区别]]
- [[rag从入门到精通系列1-基础rag]]
- [[大模型相关术语和框架总结llm-mcp-prompt-rag-vllm-token-数据蒸馏]]