> 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/emb-models-info.md).

# Model and Retrieval Settings

The knowledge base first parses the materials and splits them into chunks, then finds the content most likely to answer the question from those chunks. The embedding model, reranking model, and Top K determine “how to search, how to rank, and how many to keep at the end”; they cannot fix missing main text or incorrect chunking.

{% hint style="info" %}
When tuning for the first time, first run one retrieval test with the current settings. After that, change only one parameter per round and always retest with the same set of questions so you can tell which setting caused the change.
{% endhint %}

## First understand the retrieval pipeline

<figure><img src="https://1658303467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2FlOKvTNoShRGrj0ErU2aK%2Fclipboard.png?alt=media&amp;token=d245723c-b825-4e3d-ab00-6e1d07a96fc9" alt="从资料解析、分块、BM25 与向量检索到合并、重排和 Top K 的知识库检索架构图"><figcaption><p>BM25 can always work on its own; after configuring an embedding model, vector retrieval is added, and reranking is an optional step after candidate merging.</p></figcaption></figure>

Every layer in the diagram affects the final result: the material content determines whether there is an answer, parsing and chunking determine whether the answer is complete, and retrieval and reranking determine whether the correct chunk can be moved to the front.

### Three common combinations

| Combination                       | Actual retrieval method                                                      | What kind of materials it suits                               | When to upgrade                                                                            |
| --------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| Do not use an embedding model     | BM25 keyword retrieval only                                                  | Many clause numbers, product names, and proper nouns          | When a different wording makes it hard to match, add an embedding model                    |
| Embedding model                   | BM25 and vector retrieval run in parallel, then candidate results are merged | The user’s wording differs greatly from the original material | When the correct chunk can be retrieved but the ranking is unstable, add a reranking model |
| Embedding model + reranking model | Rescore and rerank after hybrid retrieval                                    | Candidate chunks are similar and need stable ranking          | Keep the threshold at 0.0 first, then adjust it gradually based on noise                   |

{% hint style="success" %}
The knowledge base can still work without configuring an embedding model. Only after selecting a reranking model will the settings panel show the \[Similarity Threshold].
{% endhint %}

## Open settings and confirm the current configuration

Open \[Knowledge Base] in the left navigation → select a knowledge base → click \[Settings] in the upper right.

The default area includes \[Document Processing], \[Embedding Model], \[Reranking Model], and \[Top K]. For the first test, it is recommended to keep Top K at 6 and not raise the similarity threshold for now.

<figure><img src="https://1658303467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2FU2C9clCv11t3I9e8W0Kn%2Fclipboard.png?alt=media&amp;token=f9510d70-3b78-4f57-9316-f73e7ecf2a01" alt="知识库设置中的文档处理、嵌入模型、重排模型和 Top K"><figcaption><p>First confirm the model and Top K, then go to [Advanced Settings] to check chunking.</p></figcaption></figure>

### Recommended starting point

| Configuration item   | Initial interface values                     | Recommended starting point                                                          | Purpose and notes                                                                                                              |
| -------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Embedding model      | Do not use                                   | Do not use it first when keywords can match reliably                                | After adding it, keyword and vector retrieval will both run; billing and data handling for cloud models depend on the provider |
| Reranking model      | Do not use                                   | Enable it again when the correct chunk can be retrieved but the ranking is unstable | This adds one model scoring step and extra waiting time                                                                        |
| Top K                | 6, optional 1–50                             | Keep 6 for now                                                                      | Too small may miss the answer, too large brings more noise and takes up conversation context                                   |
| Similarity threshold | 0.0, shown only when reranking is configured | Start from 0.0                                                                      | Only filters out low-scoring reranked results; setting it too high may remove the correct chunk as well                        |

## Build a baseline with fixed questions

Before you begin, prepare 3–5 real questions with clear answers. The questions should cover proper nouns from the materials, colloquial phrasing, and situations that require context to answer.

{% stepper %}
{% step %}

### 1. First check the material text and Chunks

Confirm that the answer really exists in the material and that conditions and conclusions have not been split incorrectly. If there is a problem at this layer, handle parsing or chunking first; do not rush to adjust the model.
{% endstep %}

{% step %}

### 2. Complete the first retrieval test

Open \[Retrieval Test], enter the prepared questions one by one, and record the source hit, chunk content, order, and time taken.

<figure><img src="https://1658303467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2Fr2mSvzxjXSvwuT0gGIf6%2Fclipboard.png?alt=media&amp;token=87900ecb-c890-4894-9891-905a4caad74c" alt="召回测试中的命中来源、相关度、片段内容和排序"><figcaption><p>Do not just look at whether there is a result; also confirm that the source is correct, the chunk is complete, and the ranking is reasonable.</p></figcaption></figure>
{% endstep %}

{% step %}

### 3. Identify the layer where the problem occurs

* No correct chunk at all: first check the material content, parsing, and chunking.
* Keywords can find it, but a different wording cannot: try an embedding model.
* The correct chunk can appear, but often ranks too low: try a reranking model.
* The correct chunk is filtered out: lower the similarity threshold.
* The first few results are all relevant but the answer is still incomplete: slightly increase Top K again.
  {% endstep %}

{% step %}

### 4. Change only one item each round

For example, adjust Top K first and save it; do not change the embedding model and chunk size at the same time. If old materials are chunked or vectors already exist, reindex or rebuild as described below.
{% endstep %}

{% step %}

### 5. Retest with the same set of questions

Compare the source, chunk completeness, ranking, and time taken before and after the adjustment. If there is no improvement, restore the previous settings and then test the next item.
{% endstep %}
{% endstepper %}

## How to adjust when chunking is incomplete

Expand \[Advanced Settings] to see \[Smart Chunking], \[Separator], \[Chunk Size], and \[Overlap Size].

<figure><img src="https://1658303467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2FSuW1LQlcdqCWxhLJEEQe%2Fclipboard.png?alt=media&amp;token=6ea5de2d-e4a1-40e2-b31c-d9ca31779eed" alt="知识库高级设置中的智能分段、分隔符、分段大小和重叠大小"><figcaption><p>For general materials, you can start with Smart Chunking enabled, Chunk Size 1024, and Overlap Size 200.</p></figcaption></figure>

| Configuration item | Initial interface values | When to adjust                                                                                                     | Common side effects                                                          |
| ------------------ | ------------------------ | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| Smart Chunking     | Enable                   | Keep it enabled when the materials have clear headings and paragraph structure                                     | When disabled, splitting is done only by separators                          |
| Separator          | `\n\n`                   | Adjust when the materials have stable custom paragraph boundaries                                                  | When Smart Chunking is disabled, the separator cannot be empty               |
| Chunk Size         | 1024 tokens              | Reduce it when one chunk mixes multiple topics; increase it when conditions and conclusions are always split apart | Too large increases noise, too small loses context                           |
| Overlap Size       | 200 tokens               | Increase slightly when key information often crosses chunk boundaries                                              | Must be smaller than the chunk size; too large will create duplicate content |

{% hint style="warning" %}
Chunking settings only affect content added afterward. To make existing materials use the new settings, choose \[Reindex] from the material row menu, then retest with the same set of questions.
{% endhint %}

## Changing models and rebuilding the knowledge base

When enabling an embedding model for a knowledge base that previously used only BM25, vector indexing can be completed directly. When changing the embedding model for a knowledge base that already has vectors, the interface will enter the \[Rebuild Knowledge Base] process, because vectors generated by different embedding models cannot be mixed.

{% hint style="danger" %}
Before starting the rebuild, confirm that the new embedding model can be called successfully. After rebuilding, you need to complete the retrieval baseline again; do not change the model and modify chunking in the same round, or you will not be able to tell where the result change came from.
{% endhint %}

If you need to complete embeddings locally, open \[Settings] → \[Local Models], download an available model in the \[Embedding Model] area, then return to the knowledge base settings to select it.

<figure><img src="https://1658303467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2FKtorqL7bBJINtcB1uKOE%2Fclipboard.png?alt=media&amp;token=ce9a7810-c719-4392-aeb1-839f414f37e8" alt="本地模型设置中的嵌入模型下载入口"><figcaption><p>First complete the local model download, then return to the knowledge base to select it and build the index.</p></figcaption></figure>

## Tuning loop

<figure><img src="https://1658303467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2FmfHDAsphgab351BnEKkY%2Fclipboard.png?alt=media&amp;token=0fc8847f-23e0-4d93-8938-26e818df4b8f" alt="用固定问题进行召回测试、定位问题、单项调整、重新索引并复测的知识库质量调优闭环"><figcaption><p>Fixed questions → check results → locate the layer → adjust one item → reindex if necessary → retest.</p></figcaption></figure>

Only keep changes that consistently improve the fixed test questions. If the results do not improve, restore the previous set of settings instead of continuing to stack more changes.

## A complete example

Xiaolin maintains a set of employee travel expense rules. The materials say “lodging expense standards,” but employees often ask, “How much can I claim at most for a hotel stay?”

1. He first tested with the default settings and found that using the original wording could match, but colloquial phrasing was unstable.
2. He configured an embedding model and completed indexing, then retested with the same questions.
3. The correct chunk could appear consistently, but sometimes ranked too low, so he then configured a reranking model.
4. He kept Top K at 6 and the threshold at 0.0, and only gradually raised the threshold when irrelevant results were clearly present.

The completion standard is: the same lodging standard can be found in the first few results for all three different phrasings, and the chunk contains both the applicable conditions and the reimbursement cap.

## FAQ

<details>

<summary>Can the knowledge base still search without an embedding model?</summary>

Yes. The knowledge base will use BM25 keyword retrieval, which is suitable for clause numbers, proper nouns, and wording close to the original text.

</details>

<details>

<summary>Why can’t I see [Similarity Threshold]?</summary>

Only after selecting a reranking model will the settings panel show \[Similarity Threshold].

</details>

<details>

<summary>Why did old materials not change after modifying the chunk size?</summary>

Chunking settings only affect content added afterward. Please run \[Reindex] on the existing materials, then retest with the same questions.

</details>

<details>

<summary>The correct chunk does not appear at all. Should I increase Top K first?</summary>

First check the material body text and Chunks. If parsing or splitting is wrong, increasing Top K will only return more incorrect or incomplete chunks.

</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>Knowledge Base Beginner's Guide</strong></td><td>First build a general understanding of how the knowledge base works.</td><td><a href="/docs/en-us/knowledge-base/knowledge-base.md">Getting Started with Knowledge Bases</a></td></tr><tr><td><strong>Document parsing and OCR</strong></td><td>When the main text is missing or recognition is incorrect, troubleshoot from the material processing layer.</td><td><a href="/docs/en-us/knowledge-base/document-preprocessing.md">Document Parsing and OCR</a></td></tr><tr><td><strong>Add and organize materials</strong></td><td>Learn about reindexing, material status, and content maintenance.</td><td><a href="/docs/en-us/knowledge-base/sources.md">Add and Organize Materials</a></td></tr><tr><td><strong>Check materials and recall</strong></td><td>Continue practicing retrieval tests and result evaluation.</td><td><a href="/docs/en-us/knowledge-base/recall-test.md">Check Materials and Retrieval</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/emb-models-info.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.
