> 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/knowledge-base/knowledge-base.md).

# Knowledge base basics

A knowledge base organizes files, notes, directories, or web pages into a reusable collection of materials that can be searched repeatedly. First use recall testing to confirm the system can find the correct passages, then hand the knowledge base over to a conversation or Agent.

{% hint style="info" %}
If you only need to handle a small piece of text temporarily, it is faster to paste it directly into the conversation. Build a knowledge base when the materials will be reused repeatedly and the answer must be based on internal sources.
{% endhint %}

## When is it suitable to use

| Need                                                            | Recommended approach                               | Reason                                                                          |
| --------------------------------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------- |
| Query employee policies, product manuals, and project materials | Build a knowledge base                             | The materials will be reused, and you need stable citation of the original text |
| Temporarily analyze an attachment                               | Upload directly in the conversation                | No long-term maintenance or indexing needed                                     |
| The materials are still being organized                         | First organize it with \[Notes]                    | Avoid unverified content being treated as an official answer                    |
| Need to automatically process materials over the long term      | Bind to an Agent after building the knowledge base | The Agent can continuously use the same material scope during tasks             |

## What happens in a single answer

<figure><img src="/files/6e98934885eff518d13a4942ff027d90687e8866" alt="从资料解析、分块、BM25 与向量检索到合并、重排和 Top K 的知识库检索架构图"><figcaption><p>The materials are first parsed and split into chunks, then candidate passages are found using keywords or semantic search; the chat model is only responsible for forming an answer based on the recalled content.</p></figcaption></figure>

### Get to know these terms first

| Name            | Meaning in this task                                                                             |
| --------------- | ------------------------------------------------------------------------------------------------ |
| Knowledge base  | A set of materials and retrieval settings organized around the same topic                        |
| Material entry  | An imported file, note, file in a directory, or web page snapshot                                |
| Chunk           | A small passage used for retrieval after the materials are split                                 |
| Recall          | The process of finding relevant passages based on a question                                     |
| Embedding model | Converts text into vectors to match content with different wording but similar meaning; optional |
| Reranking model | Scores and reorders candidate passages again; also optional                                      |

{% hint style="success" %}
A knowledge base can still be used without an embedding model, in which case it mainly relies on BM25 keyword retrieval. For your first try, you can choose \[Do not use] and run through the creation, import, and recall workflow first.
{% endhint %}

## Complete your first use in 5 minutes

{% stepper %}
{% step %}

### 1. Create a knowledge base with a clear scope

Open the left navigation \[Knowledge Base] → click the Add button above the knowledge base list. Use the format “object + purpose” for the name, for example \[Employee Travel Policy].
{% endstep %}

{% step %}

### 2. Choose a retrieval method

For your first try, you can set \[Embedding Model] to \[Do not use]. Configure an embedding model later when you need to match conversational wording or synonyms.
{% endstep %}

{% step %}

### 3. Add materials

After entering the knowledge base, click the Add Material button and choose \[File], \[Note], \[Directory], or \[Link].

<figure><img src="/files/44d5f61914769cb7df73ba3285ad0634c35c5254" alt="知识库中的文件、笔记、目录和链接四种资料入口"><figcaption><p>Choose the entry point according to the source of the materials; do not import irrelevant directories just to reduce the number of steps.</p></figcaption></figure>
{% endstep %}

{% step %}

### 4. Wait for the materials to become ready

After processing is complete, the materials will appear in the list. Spot-check the main text and Chunks to make sure there is no garbled text, missing pages, or obvious misordering.

<figure><img src="/files/851212984cdd3ef47fd9778e231d7441c35c58ea" alt="包含多条已处理资料的员工差旅制度知识库"><figcaption><p>After the materials are ready, you still need to spot-check the content; import completion does not mean the retrieval quality is already qualified.</p></figcaption></figure>
{% endstep %}

{% step %}

### 5. Complete the recall test

Open \[Recall Test], enter a real question whose answer you already know, and check whether the correct source appears among the first few results.
{% endstep %}

{% step %}

### 6. Enter chat or bind an Agent

Once recall is stable, select the knowledge base in the chat input area; when you need a long-term workflow, bind the knowledge base on the Agent editing page.
{% endstep %}
{% endstepper %}

## Recommended starting point

| Configuration item   | Product default value | Recommended starting point             | Function                                                           | Applicable scenarios                                          | Notes                                                                |
| -------------------- | --------------------- | -------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------- | -------------------------------------------------------------------- |
| Knowledge base scope | —                     | A clear topic                          | Controls which materials participate in retrieval together         | Policies, products, project materials                         | Content with different permissions or lifecycles should be separated |
| Embedding model      | Do not use            | Do not use for now                     | Determines whether vector retrieval is added                       | Conversational wording differs greatly from the original text | Billing and data handling for cloud models depend on the provider    |
| Test questions       | —                     | 3 to 5 real questions                  | Establish a long-term regression baseline                          | After each materials or settings update                       | Do not test using only the material title and original sentences     |
| Enter formal use     | —                     | Materials, Chunks, and recall all pass | Avoid bringing parsing or retrieval problems into the conversation | All knowledge bases                                           | The chat model cannot make up key information that was not recalled  |

## How to tell when it is ready to use

* All required materials show as available, with none stuck in processing or error status for a long time.
* Randomly open one or two materials; the main text and Chunks should have no garbled text, missing pages, or obvious misordering.
* Use fixed questions for recall testing, and the correct source should consistently appear among the first few results.

## User case

Xiaolin wants colleagues to be able to query the travel policy. He creates an \[Employee Travel Policy] knowledge base, imports three materials covering lodging, transportation, and approvals, and leaves the embedding model unconfigured for now. After the three materials are ready, he tests with questions like “What is the lodging limit in Beijing?” and “Who approves amounts over 5,000 yuan?”

The completion standard is: for each question, the correct policy source can be found, and the passage includes both the applicable conditions and the conclusion. Only after meeting this standard does he bind the knowledge base to the Agent responsible for employee Q\&A.

## Common questions

<details>

<summary>What is the difference between a knowledge base and a chat model?</summary>

The knowledge base is responsible for finding passages from your materials, while the chat model is responsible for understanding the question and forming the answer. If key information is not found during recall, simply switching the chat model usually will not solve the problem.

</details>

<details>

<summary>Can it be used directly after materials are imported successfully?</summary>

You still need to spot-check the main text and Chunks, and complete a recall test. Successful import only means the processing flow has finished; it does not mean the results are complete or correctly ranked.

</details>

<details>

<summary>Will old materials change automatically after modifying the chunking settings?</summary>

No. To make existing materials use the new chunking settings, you need to perform \[Reindex], then retest with the same set of questions.

</details>

## Continue reading

<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>Create a knowledge base</strong></td><td>Determine the name boundary and retrieval method.</td><td><a href="/pages/ab9a4052161008c0856738c2f0fddf9ba33d1b45">/pages/ab9a4052161008c0856738c2f0fddf9ba33d1b45</a></td></tr><tr><td><strong>Add and organize materials</strong></td><td>Import files, notes, directories, and web pages.</td><td><a href="/pages/53062e948442e1c25a4e6ad7b4ec9baf548deafc">/pages/53062e948442e1c25a4e6ad7b4ec9baf548deafc</a></td></tr><tr><td><strong>Check materials and recall</strong></td><td>Verify retrieval quality with fixed questions.</td><td><a href="/pages/7c7a6d04d1e906eb7a89261dabeedb48874a9b8e">/pages/7c7a6d04d1e906eb7a89261dabeedb48874a9b8e</a></td></tr><tr><td><strong>Model and retrieval settings</strong></td><td>Continue adjusting embeddings, reranking, and chunking.</td><td><a href="/pages/244bae136e1bc54a35816d43dc1b6b0e3b8c7e3e">/pages/244bae136e1bc54a35816d43dc1b6b0e3b8c7e3e</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/en-us/knowledge-base/knowledge-base.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.
