mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-29 20:05:25 +08:00
docs: add rerank model documentation
- Add rerank model section to zh/en model configuration pages with supported providers table and Bailian extra_args guide - Update zh/en features pages with Cohere/Jina/Voyage providers and RAG rerank support - Add optional rerank configuration section to zh/en knowledge base pages
This commit is contained in:
@@ -55,13 +55,16 @@ For platform-specific feature support, please check [this document](/en/insight/
|
||||
| [ModelScope](https://modelscope.cn/docs/model-service/API-Inference/intro) | ✅ | LLM gateway (MaaS) |
|
||||
| [TBox (Ant TreasureBox)](https://tbox.cn/) | ✅ | LLMOps platform |
|
||||
| [Coze](https://coze.cn) | ✅ | LLMOps platform |
|
||||
| [Cohere](https://cohere.com/) | ✅ | Rerank models |
|
||||
| [Jina](https://jina.ai/) | ✅ | Rerank models |
|
||||
| [Voyage AI](https://voyageai.com/) | ✅ | Rerank models |
|
||||
|
||||
## LLM Application Paradigm Implementation
|
||||
|
||||
| Application Paradigm | Status | Remarks |
|
||||
| --- | --- | --- |
|
||||
| Agent | ✅ | |
|
||||
| RAG | ✅ | Using Chroma as vector database |
|
||||
| RAG | ✅ | Using Chroma as vector database, supports Rerank re-scoring |
|
||||
| MCP | ✅ | Support Stdio and HTTP protocol |
|
||||
|
||||
## System Extensibility
|
||||
|
||||
@@ -29,6 +29,17 @@ Go to your pipeline configuration, under the "AI" tab, choose `Local Agent` as t
|
||||
|
||||
<img width="400px" src="/images/zh/deploy/knowledge/use_kb.png" alt="use_kb" />
|
||||
|
||||
### Configure Reranking (Optional)
|
||||
|
||||
After selecting a knowledge base, you can configure a **Rerank Model** below to improve retrieval quality:
|
||||
|
||||
- **Rerank Model**: Select a configured rerank model (if none available, add one in [Model Configuration](/en/usage/models/readme) first)
|
||||
- **Rerank Top-K**: Number of most relevant results to keep after reranking, default is 5
|
||||
|
||||
<Tip>
|
||||
Rerank models are optional. When configured, candidate documents from knowledge base retrieval are re-scored by the rerank model, keeping only the top-K most relevant results before passing them to the LLM, significantly reducing noise from irrelevant content.
|
||||
</Tip>
|
||||
|
||||
<Info>
|
||||
LangBot's built-in knowledge base can be used only when the runner is set to `Local Agent`. For other runners, refer to their documentation.
|
||||
</Info>
|
||||
|
||||
@@ -45,3 +45,42 @@ The system has integrated the official embedding model provided by seekdb, no pa
|
||||
- On the "Embedding Model" page, select "seekdb-built-in";
|
||||
- Click "Save" to use it immediately;
|
||||
- Then select this model in your knowledge base to take effect.
|
||||
|
||||
### Rerank Model
|
||||
|
||||
Rerank models re-score RAG retrieval results to significantly improve the precision of knowledge base answers. When a knowledge base returns multiple candidate documents, the rerank model uses a cross-encoder to precisely score each document's relevance to the query, selecting only the most relevant content.
|
||||
|
||||
Enter `Model Name` and select `Model Provider`, then submit. After that, select this model in your pipeline's "AI" configuration.
|
||||
|
||||
<Tip>
|
||||
Rerank models are optional. Without one, knowledge base results are used in their original retrieval order. With a rerank model configured, results are re-scored and only the top-K most relevant results are kept.
|
||||
</Tip>
|
||||
|
||||
**Supported providers and models:**
|
||||
|
||||
| Provider | Recommended Models | Notes |
|
||||
| --- | --- | --- |
|
||||
| [SiliconFlow](https://siliconflow.cn/) | `BAAI/bge-reranker-v2-m3`, `Qwen/Qwen3-Reranker-8B` | Recommended for China |
|
||||
| [Jina](https://jina.ai/) | `jina-reranker-v2-base-multilingual` | Multilingual |
|
||||
| [Cohere](https://cohere.com/) | `rerank-v3.5` | Industry leading |
|
||||
| [Voyage AI](https://voyageai.com/) | `rerank-2.5` | |
|
||||
| [GiteeAI](https://ai.gitee.com/) | `bge-reranker-v2-m3`, `Qwen3-Reranker-8B` | |
|
||||
| [Aliyun Bailian](https://bailian.console.aliyun.com/) | `qwen3-rerank`, `gte-rerank` | Requires extra args, see below |
|
||||
| [OpenRouter](https://openrouter.ai/) | `cohere/rerank-v3.5`, `cohere/rerank-4-pro` | Universal gateway |
|
||||
| [302.AI](https://share.302.ai/SuTG99) | `jina-reranker-m0`, `qwen3-rerank` | |
|
||||
| OpenAI Compatible | Any service supporting `/rerank` | Universal |
|
||||
|
||||
### Using Rerank Models with Aliyun Bailian
|
||||
|
||||
Aliyun Bailian's rerank API endpoint path differs from its LLM endpoint. You need to specify `rerank_url` in the model's **extra arguments**:
|
||||
|
||||
1. When adding a model, select the `Aliyun Bailian` provider
|
||||
2. Enter the model name (e.g., `qwen3-rerank`)
|
||||
3. Add an extra argument:
|
||||
- Key: `rerank_url`
|
||||
- Type: `string`
|
||||
- Value: `https://dashscope.aliyuncs.com/compatible-api/v1/reranks`
|
||||
|
||||
<Warning>
|
||||
Other providers (SiliconFlow, Jina, Cohere, etc.) do not require extra arguments — they use the standard `/rerank` endpoint.
|
||||
</Warning>
|
||||
|
||||
@@ -55,13 +55,16 @@ LangBot 是一个开源的大语言模型原生即时通信机器人开发平台
|
||||
| [ModelScope](https://modelscope.cn/docs/model-service/API-Inference/intro) | ✅ | 大模型聚合平台 |
|
||||
| [TBox(蚂蚁百宝箱)](https://tbox.cn/) | ✅ | LLMOps 平台 |
|
||||
| [Coze](https://coze.cn) | ✅ | LLMOps 平台 |
|
||||
| [Cohere](https://cohere.com/) | ✅ | Rerank 模型 |
|
||||
| [Jina](https://jina.ai/) | ✅ | Rerank 模型 |
|
||||
| [Voyage AI](https://voyageai.com/) | ✅ | Rerank 模型 |
|
||||
|
||||
## LLM 应用范式实现
|
||||
|
||||
| 应用范式 | 状态 | 备注 |
|
||||
| --- | --- | --- |
|
||||
| Agent | ✅ | |
|
||||
| RAG | ✅ | 使用 Chroma 作为向量数据库 |
|
||||
| RAG | ✅ | 使用 Chroma 作为向量数据库,支持 Rerank 重排序 |
|
||||
| MCP | ✅ | 支持 Stdio 和 HTTP 两种方式 |
|
||||
|
||||
## 系统扩展性
|
||||
|
||||
@@ -29,6 +29,17 @@ LangBot 原生支持 RAG(Retrieval-Augmented Generation,即检索增强生
|
||||
|
||||
<img width="400px" src="/images/zh/deploy/knowledge/use_kb.png" alt="use_kb" />
|
||||
|
||||
### 配置重排序(可选)
|
||||
|
||||
选择知识库后,您可以在下方配置**重排序模型**来提升检索质量:
|
||||
|
||||
- **重排序模型**:选择已配置的 Rerank 模型(如未配置,请先到[模型配置](/zh/usage/models/readme)中添加)
|
||||
- **重排序保留数量(Top-K)**:重排序后保留的最相关结果数量,默认为 5
|
||||
|
||||
<Tip>
|
||||
重排序模型是可选的。配置后,知识库检索返回的候选文档会经过重排序模型重新打分,只保留最相关的 Top-K 条,再交给大模型回答,显著减少无关信息干扰。
|
||||
</Tip>
|
||||
|
||||
<Info>
|
||||
仅当运行器为`内置 Agent`时,才可以使用 LangBot 原生知识库,若要在使用其他运行器时使用知识库,请参考所使用的运行器对应产品的文档。
|
||||
</Info>
|
||||
|
||||
@@ -23,7 +23,8 @@ LangBot Models 是 LangBot 官方提供的模型服务。当您使用 LangBot Sp
|
||||
├── API Keys: [sk-xxx]
|
||||
├── LLM 模型: gpt-4o
|
||||
├── LLM 模型: gpt-4o-mini
|
||||
└── 向量模型: text-embedding-3-small
|
||||
├── 向量模型: text-embedding-3-small
|
||||
└── 重排序模型: rerank-v3.5
|
||||
```
|
||||
|
||||
<Tip>
|
||||
@@ -57,6 +58,45 @@ LangBot Models 是 LangBot 官方提供的模型服务。当您使用 LangBot Sp
|
||||
|
||||
### 使用 seekdb 内置嵌入模型(零配置)
|
||||
系统已集成 seekdb 提供的官方嵌入模型,无需填写任何参数。
|
||||
- 在“嵌入模型”页面选择「seekdb-内置」;
|
||||
- 在”嵌入模型”页面选择「seekdb-内置」;
|
||||
- 点击「保存」即可立即使用;
|
||||
- 后续在知识库中选择该模型即可生效。
|
||||
|
||||
### 重排序模型 (Rerank Model)
|
||||
|
||||
重排序模型用于对 RAG 检索结果进行重新评分排序,显著提升知识库回答的精准度。当知识库返回多个候选文档时,重排序模型会使用 cross-encoder 对每个文档与查询的相关性进行精确打分,筛选出最相关的内容。
|
||||
|
||||
填入 `模型名称`、选择 `模型供应商`,然后提交即可。之后请在流水线的”AI 能力”配置中选择此模型。
|
||||
|
||||
<Tip>
|
||||
重排序模型是可选的。不配置时,知识库检索结果将按向量相似度排序直接使用。配置后,检索结果会经过重排序模型重新打分,只保留最相关的 Top-K 条结果。
|
||||
</Tip>
|
||||
|
||||
**支持的供应商和模型:**
|
||||
|
||||
| 供应商 | 推荐模型 | 备注 |
|
||||
| --- | --- | --- |
|
||||
| [SiliconFlow](https://siliconflow.cn/) | `BAAI/bge-reranker-v2-m3`, `Qwen/Qwen3-Reranker-8B` | 国内推荐 |
|
||||
| [Jina](https://jina.ai/) | `jina-reranker-v2-base-multilingual` | 多语言支持 |
|
||||
| [Cohere](https://cohere.com/) | `rerank-v3.5` | 全球领先 |
|
||||
| [Voyage AI](https://voyageai.com/) | `rerank-2.5` | |
|
||||
| [GiteeAI](https://ai.gitee.com/) | `bge-reranker-v2-m3`, `Qwen3-Reranker-8B` | |
|
||||
| [阿里云百炼](https://bailian.console.aliyun.com/) | `qwen3-rerank`, `gte-rerank` | 需要额外参数,见下方 |
|
||||
| [OpenRouter](https://openrouter.ai/) | `cohere/rerank-v3.5`, `cohere/rerank-4-pro` | 通用网关 |
|
||||
| [302.AI](https://share.302.ai/SuTG99) | `jina-reranker-m0`, `qwen3-rerank` | |
|
||||
| OpenAI 兼容 | 任意支持 `/rerank` 的服务 | 通用 |
|
||||
|
||||
### 阿里云百炼使用重排序模型
|
||||
|
||||
阿里云百炼的重排序 API 端点路径与其 LLM 端点不同,需要在模型的**额外参数**中指定 `rerank_url`:
|
||||
|
||||
1. 添加模型时,选择 `阿里云百炼` 供应商
|
||||
2. 填入模型名称(如 `qwen3-rerank`)
|
||||
3. 在额外参数中添加一个参数:
|
||||
- Key: `rerank_url`
|
||||
- Type: `string`
|
||||
- Value: `https://dashscope.aliyuncs.com/compatible-api/v1/reranks`
|
||||
|
||||
<Warning>
|
||||
其他供应商(SiliconFlow、Jina、Cohere 等)无需填写额外参数,使用标准的 `/rerank` 端点即可。
|
||||
</Warning>
|
||||
|
||||
Reference in New Issue
Block a user