> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/knowledge-base/create.md).

# 创建知识库

创建时最重要的两个选择是名称和嵌入模型。资料可以稍后添加，但名称边界和检索方式会影响后续维护。

{% hint style="info" %}
第一次体验可以把【嵌入模型】设为【不使用】。知识库仍会使用 BM25 关键词检索，先把导入和召回流程跑通即可。
{% endhint %}

## 创建前先做两个决定

### 名称要说明资料边界

优先使用“对象 + 用途”，例如【员工差旅制度】、【产品售后手册】或【市场研究资料】。避免使用【资料】、【测试】这类以后无法判断内容范围的名称。

### 选择嵌入方式

| 选择     | 适合场景          | 检索方式          | 前置条件         |
| ------ | ------------- | ------------- | ------------ |
| 不使用    | 第一次体验、关键词明确   | BM25 关键词检索    | 无            |
| 云端嵌入模型 | 用户问法与资料原文差异较大 | BM25 + 向量混合检索 | 对应模型服务可正常调用  |
| 本地嵌入模型 | 希望在本机完成向量化    | BM25 + 本地向量检索 | 先在【本地模型】完成下载 |

## 创建步骤

{% stepper %}
{% step %}

### 1. 打开创建窗口

打开左侧导航【知识库】，点击知识库列表上方的新增按钮。
{% endstep %}

{% step %}

### 2. 输入名称

输入一个能说明范围的名称，例如【员工差旅制度】。
{% endstep %}

{% step %}

### 3. 选择嵌入模型

选择可用的云端或本地嵌入模型；暂时不需要语义检索时，选择【不使用】。

<figure><img src="/files/nVg3nFnV6kY0xL8BqC1e" alt="填写员工差旅制度名称并选择嵌入模型的知识库创建表单"><figcaption><p>名称决定资料边界；嵌入模型决定是否加入向量检索。</p></figcaption></figure>
{% endstep %}

{% step %}

### 4. 点击创建

确认名称和模型后点击【创建】。创建完成后会进入空白知识库。
{% endstep %}

{% step %}

### 5. 添加第一批资料

点击添加资料按钮，导入一两份答案明确的文件或笔记，再等待处理完成。
{% endstep %}
{% endstepper %}

## 使用本地嵌入模型

打开【设置】→【本地模型】，在【嵌入模型】区域下载可用模型。界面显示的模型和下载大小可能随安装环境变化，以当前列表为准。

<figure><img src="/files/64Eq8VXPVoQpChU3Bcsv" alt="本地模型设置中的嵌入模型下载入口"><figcaption><p>下载完成后，回到知识库创建或设置页面选择该模型。</p></figcaption></figure>

{% hint style="warning" %}
本地嵌入只代表向量化在本机完成。文档解析、重排和聊天是否使用云端，仍取决于各自选择的服务和模型。
{% endhint %}

## 已有资料后更换模型

从仅使用 BM25 的知识库启用嵌入模型时，可以建立向量索引。已有向量的知识库更换嵌入模型时，界面会进入【重建知识库】流程。

{% hint style="danger" %}
开始重建前先确认新模型可以正常调用。重建后重新完成召回测试；不要在同一轮又更换模型、又修改分块，否则无法判断结果变化来自哪里。
{% endhint %}

## 配置说明

| 配置项    | 产品默认值 | 建议起点        | 作用         | 适用场景        | 注意事项               |
| ------ | ----- | ----------- | ---------- | ----------- | ------------------ |
| 名称     | 空     | 对象 + 用途     | 区分资料边界     | 所有知识库       | 权限或生命周期不同的资料应分开    |
| 嵌入模型   | 不使用   | 第一次体验先不使用   | 决定是否加入向量检索 | 口语问法、同义表达较多 | 云端模型的计费和数据处理取决于服务商 |
| 本地嵌入模型 | 未下载   | 有本地处理需求时再下载 | 在本机完成向量化   | 离线或隐私要求较高   | 仍需单独检查解析、重排和聊天模型   |

## 预期结果

* 新知识库出现在列表中，名称能与其他知识库区分。
* 你清楚当前使用的是关键词检索还是混合检索。
* 选择的云端模型可以调用，或本地模型已经完成下载。

## 用户案例

小林第一次建立【员工差旅制度】知识库。他先选择【不使用】嵌入模型，导入三份制度并完成召回测试。关键词查询稳定后，他再配置嵌入模型，用相同问题比较口语问法的结果。

完成标准是：升级检索方式后，原来的固定问题没有退化，口语问法能更稳定地找到同一条制度。

## 常见问题

<details>

<summary>创建按钮不可用怎么办？</summary>

检查名称是否为空，以及所选模型是否仍可用。模型服务未配置时，可以先改为【不使用】完成创建。

</details>

<details>

<summary>不使用嵌入模型会不会完全搜不到？</summary>

不会。知识库仍会使用 BM25 关键词检索，问题用词与资料越接近，结果通常越稳定。

</details>

<details>

<summary>每个主题都要单独建库吗？</summary>

以“使用时是否应该一起检索”为判断标准。权限、生命周期或主题完全不同的资料更适合分开。

</details>

## 继续阅读

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>添加与整理资料</strong></td><td>导入内容并处理同名冲突。</td><td><a href="/pages/KqrmmA6AhNp8FZJwM7GQ">/pages/KqrmmA6AhNp8FZJwM7GQ</a></td></tr><tr><td><strong>检查资料与召回</strong></td><td>用真实问题验收结果。</td><td><a href="/pages/2UnkjUdpXro2JxR2fSG2">/pages/2UnkjUdpXro2JxR2fSG2</a></td></tr><tr><td><strong>模型与检索设置</strong></td><td>了解嵌入、重排和重建。</td><td><a href="/pages/DTHQaP2Ctb9T9fgrIxtg">/pages/DTHQaP2Ctb9T9fgrIxtg</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cherryai.com.cn/knowledge-base/create.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
