GITBOOK-153: No subject
parent
9bc3fd8637
commit
c4ca70c233
Binary file not shown.
|
After Width: | Height: | Size: 697 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 329 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 422 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 276 KiB |
|
|
@ -61,9 +61,11 @@
|
|||
* [知识库](guides/knowledge-base/README.md)
|
||||
* [创建知识库&上传文档](guides/knowledge-base/chuang-jian-zhi-shi-ku-shang-chuan-wen-dang.md)
|
||||
* [知识库管理&文档维护](guides/knowledge-base/zhi-shi-ku-guan-li-wen-dang-wei-hu.md)
|
||||
* [应用关联知识库](guides/knowledge-base/ying-yong-guan-lian-zhi-shi-ku.md)
|
||||
* [从 Notion 导入数据](guides/knowledge-base/sync-from-notion.md)
|
||||
* [通过 API 维护知识库](guides/knowledge-base/maintain-dataset-via-api.md)
|
||||
* [外部数据工具](guides/knowledge-base/external\_data\_tool.md)
|
||||
* [RAG 召回效果检查点](guides/knowledge-base/rag-zhao-hui-xiao-guo-jian-cha-dian.md)
|
||||
* [工具](guides/gong-ju.md)
|
||||
* [快速接入工具](guides/tools/quick-tool-integration.md)
|
||||
* [高级接入工具](guides/tools/advanced-tool-integration.md)
|
||||
|
|
|
|||
|
|
@ -85,6 +85,25 @@ Dify 各版本的 ETL 方案选择:
|
|||
|
||||
### 索引方式
|
||||
|
||||
### **ETL 可选配置**
|
||||
|
||||
在 RAG 的生产级应用中,为了获得更好的数据召回效果,需要对多源数据进行预处理和清洗,即 ETL (_extract, transform, load_)。为了增强非结构化/半结构化数据的预处理能力,Dify 支持了可选的 ETL 方案:**Dify ETL** 和[ ](https://docs.unstructured.io/welcome)**Unstructured ETL** 。Unstructured 能够高效地提取并转换您的数据为干净的数据用于后续的步骤,具体信息可参考 [Unstructured 官网](https://unstructured.io/)。Dify 各版本的 ETL 方案选择:
|
||||
|
||||
* SaaS 版不可选,默认直接使用 Unstructured ETL
|
||||
* 社区版可选,默认使用 Dify ETL ,可通过环境变量开启 Unstructured ETL
|
||||
|
||||
提取文件格式支持上的差异如下:
|
||||
|
||||
| DIFY Extractor | Unstructured Extractor |
|
||||
| ---------------------------------------------- | ------------------------------------------------------------------------ |
|
||||
| txt、markdown、md、pdf、html、htm、xlsx、xls、docx、csv | txt、markdown、md、pdf、html、htm、xlsx、xls、docx、csv、eml、msg、pptx、ppt、xml、epub |
|
||||
|
||||
{% hint style="info" %}
|
||||
不同的 ETL 方案在文件提取效果的方面也会存在差异,想了解更多关于 Unstructured ETL 的数据处理方式,请参考[官方文档](https://docs.unstructured.io/open-source/core-functionality/partitioning)。
|
||||
{% endhint %}
|
||||
|
||||
### 索引方式
|
||||
|
||||
你需要选择文本的**索引方式**来指定数据的匹配方式,索引策略往往与检索方式相关,你需要根据场景需求来选择合适的索引方式。
|
||||
|
||||
**高质量模式:**将调用 OpenAI 的嵌入接口进行处理,以在用户查询时提供更高的准确度。
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
# RAG 召回效果检查点
|
||||
|
||||
🚧 维护中
|
||||
|
||||
### 数据 ETL 检查点
|
||||
|
||||
* [检查分段质量](zhi-shi-ku-guan-li-wen-dang-wei-hu.md#jian-cha-fen-duan-zhi-liang)
|
||||
|
||||
### 数据检索检查点
|
||||
|
||||
* [检查召回效果](zhi-shi-ku-guan-li-wen-dang-wei-hu.md#jian-cha-zhao-hui-xiao-guo)
|
||||
|
||||
### 应用端检查点
|
||||
|
||||
* 召回
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
# 应用关联知识库
|
||||
|
||||
### 如何编排一个 AI 知识库应用
|
||||
|
||||
已创建的知识库可以作为外部知识提供给大模型用于精确回复用户问题。你可以在 Dify 的[所有应用类型](../application-design/#application\_type)关联知识库。
|
||||
|
||||
以聊天助手为例,使用流程如下:
|
||||
|
||||
1. 打开应用编排页
|
||||
2. 在上下文设置中点击 「 添加 」
|
||||
3. 从已创建的知识库中选择单个或者多个知识库
|
||||
4. 配置知识库召回策略并保存
|
||||
5. 在 「 添加功能 」 内打开 「引用和归属 」 功能
|
||||
6. 在 「 调试与预览 」 内输入与知识库相关的用户问题进行调试
|
||||
7. 调试完成之后保存并发布为一个 AI 知识库问答类应用
|
||||
|
||||
<figure><img src="../../.gitbook/assets/image (187).png" alt=""><figcaption><p>在应用内关联知识库</p></figcaption></figure>
|
||||
|
||||
### 召回设置
|
||||
|
||||
在应用编排的知识库召回设置中提供了两种召回策略:
|
||||
|
||||
**N 选 1 召回**,根据用户意图和知识库描述,由 Agent 自主判断选择最匹配的单个知识库来查询相关文本,适合知识库描述区分度大且知识库数量偏少的应用。
|
||||
|
||||
**多路召回(推荐)**,根据用户意图同时匹配所有知识库,从多路知识库查询相关文本片段,经过重排序步骤,从多路查询结果中选择匹配用户问题的最佳结果,需配置 Rerank 模型 API。
|
||||
|
||||
<figure><img src="../../.gitbook/assets/image (189).png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
### 选择适合的召回模式
|
||||
|
||||
**N 选 1 召回模式**
|
||||
|
||||
N 选 1 召回由 Function Call/ReAct 进行驱动,每一个关联的知识库作为函数,LLM 会自主选择与用户问题最匹配的 1 个知识库来进行查询,推理的依据为用户问题与知识库描述的语义匹配性。
|
||||
|
||||
因此 N 选 1 模式的召回效果主要受三个因素影响:
|
||||
|
||||
* 系统推理模型的能力
|
||||
* 知识库的描述是否清晰,知识库描述决定了 LLM 能够推理出正确的 Function
|
||||
* 知识库的个数,函数过多时将会影响 LLM 的推理精确性
|
||||
|
||||
当应用内关联过多知识库时, N 选 1 模式的效果会随着知识库数量增加受到影响。
|
||||
|
||||
在用户上传知识库时,系统推理模型将自动为知识库生成一个摘要描述。为了在该模式下获得最佳的召回效果,你可以在“知识库->设置->知识库描述”中查看到系统默认创建的摘要描述,并检查该内容是否可以清晰的概括知识库的内容。
|
||||
|
||||
以下是 N 选 1 召回模式的技术流程图:
|
||||
|
||||
<figure><img src="../../.gitbook/assets/image (190).png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
Loading…
Reference in New Issue