> 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/docs/zhong-wen-fan-ti/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/08edf0e757ffc7c2d089d2da0a40f67390ec26e0" alt="填写员工差旅制度名称并选择嵌入模型的知识库创建表单"><figcaption><p>名稱決定資料邊界；嵌入模型決定係咪加入向量檢索。</p></figcaption></figure>
{% endstep %}

{% step %}

### 4. 撳建立

確認名稱同模型之後撳【建立】。建立完成後會進入空白知識庫。
{% endstep %}

{% step %}

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

撳添加資料按鈕，導入一兩份答案明確嘅文件或筆記，再等處理完成。
{% endstep %}
{% endstepper %}

## 使用本地嵌入模型

打開【設定】→【本地模型】，喺【嵌入模型】區域下載可用模型。介面顯示嘅模型同下載大小可能會隨安裝環境變化，以而家列表為準。

<figure><img src="/files/daf18374d7034c0c0e38d0b72286c6c93bdfd893" 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/51861a0e6495a8d2826da9dc67f188b5d67b3563">/pages/51861a0e6495a8d2826da9dc67f188b5d67b3563</a></td></tr><tr><td><strong>檢查資料同召回</strong></td><td>用真實問題驗收結果。</td><td><a href="/pages/c63f889f83b9213cb096e7e37b06ede1b3b4a986">/pages/c63f889f83b9213cb096e7e37b06ede1b3b4a986</a></td></tr><tr><td><strong>模型同檢索設定</strong></td><td>了解嵌入、重排同重建。</td><td><a href="/pages/80a36504e872dfe466466dc078aa9127440ec266">/pages/80a36504e872dfe466466dc078aa9127440ec266</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/docs/zhong-wen-fan-ti/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.
