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

# Private Knowledge Base Q\&A

The HR team wants colleagues to look up current policies, but does not want the agent to fill in answers with common sense. This case combines the scope of materials, retrieval testing, and response rules; when content cannot be found, the agent should state it clearly.

<figure><img src="/files/234ab76e1553bbd72fc663014f01d7ecef9bde54" alt="新建知识库时的名称、嵌入模型和保存入口"><figcaption><p>Build a separate knowledge base for a single topic to avoid mixing current materials with outdated materials.</p></figcaption></figure>

<figure><img src="/files/4d704155cae35c38dbf30215b10a973239de67a7" alt="知识库 RAG 的分段、返回和过滤设置"><figcaption><p>Adjust the RAG settings according to the structure of the materials only when retrieval results are unstable.</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>1) Test with real questions; 2) check the returned materials, original text snippets, and relevance. Only when these are stable, hand the knowledge base over to the agent.</p></figcaption></figure>

## Workflow

{% stepper %}
{% step %}

### 1. Build a knowledge base with a single topic

Put current materials together, remove duplicate and outdated versions. Make file names clearly state the topic and effective scope.
{% endstep %}

{% step %}

### 2. Use real questions for retrieval testing

At minimum, test easily confused clauses, colloquial questions, and questions with no answer. Adjust materials or RAG settings until the returned snippets are stable.
{% endstep %}

{% step %}

### 3. Create a dedicated agent

Bind only this knowledge base, and in the prompt require: “Prefer citing materials; say not found when you can’t find it; do not use common sense to fill in policies.” Keep permissions to the minimum scope.
{% endstep %}

{% step %}

### 4. Start with a small scope

First use it for internal lookup, not as a direct replacement for approvals or professional judgment. Collect incorrectly answered questions and go back to the materials and retrieval tests to correct them.
{% endstep %}
{% endstepper %}

## Example question rules

```
When answering, give the conclusion first, then specify the material name and relevant paragraph. When materials conflict, list the conflicts and do not choose for us. When the knowledge base has no answer, clearly write “Not found in current materials.”
```

## Recommended combination and completion criteria

| Item                | Recommended approach                                                                                                 |
| ------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Knowledge base      | One topic, one set of materials; delete duplicates and outdated versions                                             |
| Retrieval test      | Test standard phrasing, colloquial phrasing, and questions with no answer at the same time                           |
| Agent               | Bind only the required knowledge base, and require citing materials without filling in missing content               |
| Completion criteria | Can find the correct paragraph; conflicting materials will be listed; when there is no answer, clearly say not found |

{% hint style="danger" %}
Content in the private knowledge base will be processed by the embedding and chat model services you choose. Before use, confirm the confidentiality requirements and service scope of the materials, and do not import keys and account credentials as knowledge materials.
{% 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/en-us/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.
