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

# 私有知识库问答

人事团队想让同事查询现行制度，但不希望 Agent 用常识补写答案。这个案例把资料范围、召回测试和回答规则放在一起；找不到内容时，Agent 应明确说明。

<figure><img src="/files/WBbS3eBWM1QiWGucWUCs" alt="新建知识库时的名称、嵌入模型和保存入口"><figcaption><p>为单一主题建立独立知识库，避免现行资料与过期资料混在一起。</p></figcaption></figure>

<figure><img src="/files/GOHOKqcAMzi1ulVWNLr6" 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/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.
