> 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/advanced-basic/cases/private-knowledge-qa.md).

# 私有知識庫問答

人事團隊想讓同事查詢現行制度，但唔希望 Agent 用常識補寫答案。呢個案例把資料範圍、召回測試同回答規則放埋一齊；搵唔到內容時，Agent 應明確說明。

<figure><img src="/files/3371247165fb5d0b676da08fee2912c7cf4fc607" alt="新建知识库时的名称、嵌入模型和保存入口"><figcaption><p>為單一主題建立獨立知識庫，避免現行資料同過期資料混埋一齊。</p></figcaption></figure>

<figure><img src="/files/aac5a2c666c86432b9ef93f6ab68b406a8e3d33a" alt="知识库 RAG 的分段、返回和过滤设置"><figcaption><p>只有召回結果唔穩定時，再根據資料結構調整 RAG 設定。</p></figcaption></figure>

<figure><img src="https://3562065924-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2Fgit-blob-413972fdce3631aee8d1619db3a9936b2dfc3774%2Fcherry-v2-guide-knowledge-recall.png?alt=media" alt="员工差旅制度知识库对海外租车能否报销问题给出的实际召回结果"><figcaption><p>① 用真實問題測試；② 核對返回資料、原文片段同相關度。只有呢度穩定，先至把知識庫交俾 Agent 使用。</p></figcaption></figure>

## 操作流程

{% stepper %}
{% step %}

### 1. 建立主題單一嘅知識庫

把現行資料放埋一齊，移除重複同過期版本。文件名寫清主題同生效範圍。
{% endstep %}

{% step %}

### 2. 用真實問題做召回測試

至少測試容易混淆嘅條款、口語化問法同冇答案嘅問題。調整資料或 RAG 設定，直到返回片段穩定。
{% endstep %}

{% step %}

### 3. 建立專用 Agent

只綁定呢套知識庫，喺提示詞中要求「優先引用資料；搵唔到時話未搵到；唔好用常識補寫制度」。權限保持最小範圍。
{% endstep %}

{% step %}

### 4. 從小範圍開始使用

先用於內部查找，唔直接取代審批或專業判斷。收集答錯嘅問題，返去資料同召回測試入面修正。
{% endstep %}
{% endstepper %}

## 示例問題規則

```
回答時先給結論，再註明資料名稱同相關段落。資料之間衝突時列出衝突，唔幫我哋選擇。知識庫冇答案時明確寫「目前資料未找到」。
```

## 建議組合同完成標準

| 項目    | 建議做法                      |
| ----- | ------------------------- |
| 知識庫   | 一個主題一套資料，刪除重複同過期版本        |
| 召回測試  | 同時測試標準問法、口語問法同冇答案嘅問題      |
| Agent | 只綁定需要嘅知識庫，要求引用資料同埋唔補寫     |
| 完成標準  | 搵到正確段落；衝突資料會列出；冇答案時明確話未找到 |

{% hint style="danger" %}
私有知識庫入面嘅內容會由你揀選嘅嵌入同對話模型服務處理。使用前確認資料嘅保密要求同服務範圍，唔好將密鑰同帳號憑據作為知識資料匯入。
{% endhint %}


---

# 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/advanced-basic/cases/private-knowledge-qa.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.
