doc: add docs for knowledge base

This commit is contained in:
Junyan Qin
2025-07-18 17:23:38 +08:00
parent 60fa2c3a94
commit 83cf595353
9 changed files with 82 additions and 5 deletions
+9 -1
View File
@@ -128,7 +128,7 @@ export default defineConfig({
],
},
{
text: "配置对话模型",
text: "配置模型",
link: "/zh/deploy/models/readme",
},
{
@@ -140,6 +140,10 @@ export default defineConfig({
{ text: "n8n", link: "/zh/deploy/pipelines/n8n" },
],
},
{
text: "使用知识库",
link: "/zh/deploy/knowledge/readme",
},
{
text: "系统环境设置",
link: "/zh/deploy/settings",
@@ -354,6 +358,10 @@ export default defineConfig({
{ text: "n8n", link: "/en/deploy/pipelines/n8n" },
],
},
{
text: "Using Knowledge Base",
link: "/en/deploy/knowledge/readme",
},
{
text: "System Settings",
link: "/en/deploy/settings",
Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

+29
View File
@@ -0,0 +1,29 @@
# Using Knowledge Base
LangBot natively supports RAG (Retrieval-Augmented Generation), you can create a knowledge base and bind it to a pipeline, and the pipeline will answer questions based on the content in the knowledge base.
:::info
- You need to configure the embedding model before creating a knowledge base, please read [Configure Models](/en/deploy/models/readme).
:::
## Build Knowledge Base
In the knowledge base page, click the `Create Knowledge Base` button, fill in the knowledge base name, select the configured embedding model, and click the `Create` button.
<img width="400px" src="/assets/image/zh/deploy/knowledge/upload_docs.png" alt="create_kb" />
## Use Knowledge Base
Please go to the pipeline configuration, in the "AI" page, select `Local Agent` as the runner, and select the knowledge base you just created below.
<img width="400px" src="/assets/image/zh/deploy/knowledge/use_local_agent.png" alt="use_kb" />
<img width="400px" src="/assets/image/zh/deploy/knowledge/use_kb.png" alt="use_kb" />
:::info
Only when the runner is `Local Agent`, can you use the LangBot native knowledge base, if you want to use the knowledge base with other runners, please refer to the documentation of the corresponding product.
:::
Now you can use the knowledge base to chat in the `Chat Debug` or the robot bound to the pipeline:
<img width="400px" src="/assets/image/zh/deploy/knowledge/use_kb_in_chat.png" alt="use_kb_in_chat" />
+30
View File
@@ -0,0 +1,30 @@
# 使用知识库 (Knowledge Base)
LangBot 原生支持 RAG(Retrieval-Augmented Generation,即检索增强生成),您可以创建知识库,并将其与流水线绑定,流水线将根据知识库中的内容回答问题。
:::info
- 知识库的创建和使用需要先配置嵌入模型,请先阅读[配置模型](/zh/deploy/models/readme)。
:::
## 构建知识库
在知识库页面,点击`创建知识库`按钮,填写知识库名称,选择已配置好的嵌入模型,然后点击`创建`按钮。
之后请到知识库的“文档”页面,上传文档,LangBot 将会在后台开始解析和索引。
<img width="400px" src="/assets/image/zh/deploy/knowledge/upload_docs.png" alt="create_kb" />
## 使用知识库
请到流水线配置中,“AI 能力”页,选择`内置 Agent`作为运行器,并在下方选择您刚刚创建的知识库。
<img width="400px" src="/assets/image/zh/deploy/knowledge/use_local_agent.png" alt="use_kb" />
<img width="400px" src="/assets/image/zh/deploy/knowledge/use_kb.png" alt="use_kb" />
:::info
仅当运行器为`内置 Agent`时,才可以使用 LangBot 原生知识库,若要在使用其他运行器时使用知识库,请参考所使用的运行器对应产品的文档。
:::
现在即可在`对话调试`或流水线所绑定的机器人上使用知识库进行对话:
<img width="400px" src="/assets/image/zh/deploy/knowledge/use_kb_in_chat.png" alt="use_kb_in_chat" />
+14 -4
View File
@@ -1,12 +1,14 @@
# 配置模型 (Models)
模型将被流水线用于处理消息,您配置的第一个模型将被设置为默认流水线的模型。
## 对话模型 (LLM Model)
对话模型将被流水线用于处理消息,您配置的第一个模型将被设置为默认流水线的模型。
![arch](/assets/image/zh/deploy/models/arch.png)
可以添加多个模型,然后再流水线中选择具体使用什么模型
![模型配置](/assets/image/zh/deploy/models/model_config.png)
<img width="400px" src="/assets/image/zh/deploy/models/model_config.png" alt="model_config" />
填入这四个参数`模型名称`、`模型供应商`、`请求 URL`、`API Key`,然后提交即可
@@ -26,6 +28,14 @@
请求 URL 填入中转的 Base URL 即可,例如
![模型配置](/assets/image/zh/deploy/models/other_provider.png)
<img width="400px" src="/assets/image/zh/deploy/models/other_provider.png" alt="other_provider" />
:::
:::
## 嵌入模型 (Embedding Model)
嵌入模型将被用于计算消息的向量,若您需要使用知识库,请配置此模型。
<img width="400px" src="/assets/image/zh/deploy/models/embedding_model.png" alt="embedding_model" />
填入这四个参数`模型名称`、`模型供应商`、`请求 URL`、`API Key`,然后提交即可,之后请在知识库中配置使用此模型。