agentic_huge_data_base / wiki
页面 RAGFlow · 12 术语表·DeepWiki 中文全文译文

12 · 术语表(Glossary)

复杂文档理解与引用检索 · 本章是 RAGFlow DeepWiki 中文译文的独立章节页,保留原始链接、源码锚点、模块标签和章节层级。

项目RAGFlow 章节12 状态全文译文 模块检索、召回与索引、入库与解析、模型调用与提供方适配、文档对象与元数据
源码线索
  • README.md
  • README_ar.md
  • README_fr.md
  • README_id.md
  • README_ja.md
  • README_ko.md
  • README_pt_br.md
  • README_tr.md
  • README_tzh.md
  • README_zh.md
模块标签
  • 检索、召回与索引
  • 入库与解析
  • 模型调用与提供方适配
  • 文档对象与元数据
  • 系统架构

中文译文

术语表(中文译文)

原始 DeepWiki 页面:https://deepwiki.com/infiniflow/ragflow/12-glossary
翻译时间:2026-05-27T08:44:46.883Z
翻译模型:deepseek-chat
原文字符数:20356
项目:RAGFlow (ragflow)

---

术语表

相关源文件

以下文件被用作生成此 Wiki 页面的上下文:

  • README.md
  • README_ar.md
  • README_fr.md
  • README_id.md
  • README_ja.md
  • README_ko.md
  • README_pt_br.md
  • README_tr.md
  • README_tzh.md
  • README_zh.md
  • admin/server/admin_server.py
  • agent/canvas.py
  • agent/component/agent_with_tools.py
  • agent/component/base.py
  • agent/component/categorize.py
  • agent/component/llm.py
  • agent/tools/base.py
  • api/apps/__init__.py
  • api/apps/llm_app.py
  • api/db/__init__.py
  • api/db/db_models.py
  • api/db/init_data.py
  • api/db/services/dialog_service.py
  • api/db/services/document_service.py
  • api/db/services/file_service.py
  • api/db/services/knowledgebase_service.py
  • api/db/services/llm_service.py
  • api/db/services/task_service.py
  • api/db/services/user_service.py
  • api/ragflow_server.py
  • api/settings.py
  • api/utils/api_utils.py
  • common/mcp_tool_call_conn.py
  • conf/llm_factories.json
  • conf/service_conf.yaml
  • deepdoc/parser/excel_parser.py
  • docker/.env
  • docker/README.md
  • docker/service_conf.yaml.template
  • docs/guides/manage_files.md
  • docs/quickstart.mdx
  • rag/app/book.py
  • rag/app/laws.py
  • rag/app/manual.py
  • rag/app/naive.py
  • rag/app/one.py
  • rag/app/paper.py
  • rag/app/presentation.py
  • rag/app/qa.py
  • rag/app/table.py
  • rag/llm/__init__.py
  • rag/llm/chat_model.py
  • rag/llm/cv_model.py
  • rag/llm/embedding_model.py
  • rag/llm/rerank_model.py
  • rag/llm/sequence2txt_model.py
  • rag/llm/tts_model.py
  • rag/nlp/__init__.py
  • rag/nlp/search.py
  • rag/prompts/generator.py
  • rag/raptor.py
  • rag/svr/task_executor.py
  • rag/utils/redis_conn.py
  • test/testcases/test_web_api/test_system_app/test_apps_init_unit.py
  • web/src/components/svg-icon.tsx
  • web/src/constants/llm.ts
  • web/src/pages/user-setting/setting-model/constant.ts
  • web/src/utils/common-util.ts

本页面提供了代码库特定术语、领域概念以及 RAGFlow 中使用的架构术语的定义和技术说明。

目的与范围

RAGFlow 术语表作为新入职工程师的参考,帮助他们理解 Python 后端、Go 服务器和 React 前端中使用的特定命名规范。它将高层级的检索增强生成(RAG)概念与 rag/api/agent/ 目录中的具体实现联系起来。

核心领域术语

检索增强生成(RAG,召回-Augmented 生成)

系统的核心架构模式。它涉及从数据存储中检索相关的文档片段,为大语言模型(LLM)提供上下文,从而生成有依据的响应 README.md:75-78

数据集(知识库)

属于某个租户的逻辑文档集合。在代码中,通常被称为 KnowledgebaseKB

  • 代码实体: KnowledgebaseService api/db/services/knowledgebase_service.py:34-34
  • 数据库表: knowledgebase api/db/db_models.py:113-113
  • 本地化: 英文 UI 中称为 "Dataset",中文 UI 中称为 "知识库" README_zh.md:77-77
片段切分(解析)

将文档分解为更小、可搜索单元的过程。RAGFlow 使用"基于模板的片段切分",根据文档结构应用不同的解析器 README.md:120-124

  • 代码实体: ParserType common/constants.py:72-72
  • 实现: task_executor.py 中的 FACTORY 将解析器类型(例如 NAIVEPAPERBOOKQA)映射到具体的实现模块 rag/svr/task_executor.py:103-120
嵌入向量

将文本片段转换为数值向量的过程。这些向量存储在文档存储中,用于相似性搜索。

  • 代码实体: Base 嵌入向量类 rag/llm/embedding_model.py:107-114
  • 内置支持: BuiltinEmbed 处理本地嵌入向量推理,通常通过 settings.EMBEDDING_CFG 进行配置 rag/llm/embedding_model.py:123-142
重排序

一个二阶段检索过程,其中专门的模型(重排序器)根据查询对检索到的片段进行相关性评分,以提高精确度 README.md:138-139

  • 代码实体: RerankModel 工厂映射 api/apps/llm_app.py:29-29

代码库特定术语

对话(助手)

一个配置对象,定义了聊天的行为方式,包括它搜索哪些数据集、使用哪个大语言模型(LLM)以及系统提示词。

  • 代码实体: DialogService api/db/services/dialog_service.py:98-99
  • 数据库表: dialog api/db/db_models.py:653-653
会话(对话)

用户与对话或代理之间的交互。

  • 数据库表: conversation api/db/db_models.py:701-701
  • 服务层: ConversationService api/db/services/conversation_service.py:34-34
租户

多租户的顶层实体。所有数据集、文档和大语言模型(LLM)配置都限定在 tenant_id 范围内。

  • 模型包装器: LLMBundle api/db/services/llm_service.py:105-105
  • 模型配置: get_model_config_by_type_and_name 检索特定租户的大语言模型(LLM)设置 api/db/joint_services/tenant_model_service.py:78-78
任务执行器

负责处理繁重任务的后台工作进程,例如文档解析、嵌入向量和 GraphRAG 索引。它从 Redis Streams 中消费任务。

  • 关键逻辑: task_executor.py 使用信号量(如 task_limiter)管理并发任务处理 rag/svr/task_executor.py:142-149
  • 任务类型:dataflowraptormemory 等标识符映射到 PipelineTaskType rag/svr/task_executor.py:122-129
记忆

AI 代理跨会话持久化信息的功能,分为原始、语义、情景和程序等类型 README.md:92-92

  • 代码实体: handle_save_to_memory_task rag/svr/task_executor.py:39-39
  • 任务类型: PipelineTaskType.MEMORY rag/svr/task_executor.py:127-127

系统空间映射

自然语言到代码实体映射

此图展示了 UI/文档中面向用户的概念如何映射到后端的特定类和数据库模型。

概念映射图

graph TD
    subgraph "自然语言空间(UI/文档)"
        UI_Dataset["'数据集/知识库'"]
        UI_Chat["'聊天/助手/对话'"]
        UI_Agent["'代理/工作流/画布'"]
        UI_File["'文档/文件'"]
    end

    subgraph "代码实体空间(后端)"
        KB_Svc["KnowledgebaseService"]
        DLG_Svc["DialogService"]
        CVS_Svc["UserCanvasService"]
        DOC_Svc["DocumentService"]

        DB_KB[("表:knowledgebase")]
        DB_DLG[("表:dialog")]
        DB_CVS[("表:user_canvas")]
        DB_DOC[("表:document")]
    end

    UI_Dataset --> KB_Svc
    KB_Svc --> DB_KB

    UI_Chat --> DLG_Svc
    DLG_Svc --> DB_DLG

    UI_Agent --> CVS_Svc
    CVS_Svc --> DB_CVS

    UI_File --> DOC_Svc
    DOC_Svc --> DB_DOC

来源:api/db/db_models.py:113-653api/db/services/knowledgebase_service.py:34-34api/db/services/dialog_service.py:98-99api/db/services/document_service.py:41-42api/db/db_models.py:1126-1126

任务执行数据流

映射文档处理任务从"自然语言空间"(用户操作)到"代码实体空间"(后台处理)的生命周期。

任务生命周期图

sequenceDiagram
    participant User as "用户(Web/API)"
    participant Svr as "api/apps/document_app.py"
    participant Redis as "RedisStream(SVR_QUEUE)"
    participant Exec as "rag/svr/task_executor.py"
    participant Parser as "rag/app/*.py(解析器)"

    User->>Svr: "上传文档"
    Svr->>Svr: "DocumentService.insert()"
    Svr->>Redis: "TaskService.add_task()"

    Note over Exec: "task_executor.py:主循环"
    Redis-->>Exec: "消费流消息"
    Exec->>Exec: "set_progress(task_id, msg='处理中...')"

    Exec->>Parser: "FACTORY[parser_id].chunk()"
    Parser-->>Exec: "片段列表"

    Exec->>Exec: "嵌入向量与索引"
    Exec->>Exec: "TaskService.update_progress(prog=1.0)"

来源:rag/svr/task_executor.py:103-120rag/svr/task_executor.py:161-181api/db/services/document_service.py:41-42api/db/services/task_service.py:32-32

技术缩写

缩写全称描述代码指针
DSL领域特定语言代理工作流图的 JSON 表示。agent/canvas.py:29-29
MCP模型上下文协议用于将大语言模型(LLM)连接到外部数据和工具的协议。README.md:98-98
TEI文本嵌入向量推理用于部署文本嵌入向量模型的工具包,用于内置嵌入向量。rag/llm/embedding_model.py:134-138
RAPTOR递归抽象处理...一种用于长文档的树状组织检索方法。rag/svr/task_executor.py:43-51
OCR光学字符识别用于文档解析,从图像或 PDF 中提取文本。rag/llm/chat_model.py:29-29
KG知识图谱基于图的解析和检索策略。rag/svr/task_executor.py:118-118
BM25最佳匹配 25搜索引擎使用的排序函数,用于估计文档的相关性。README.md:138-138

来源:README.md:75-139rag/llm/embedding_model.py:134-138rag/svr/task_executor.py:43-127agent/canvas.py:29-29rag/llm/chat_model.py:39-51