For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

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.

First understand the retrieval pipeline

从资料解析、分块、BM25 与向量检索到合并、重排和 Top K 的知识库检索架构图
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.

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

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.

知识库设置中的文档处理、嵌入模型、重排模型和 Top K
First confirm the model and Top K, then go to [Advanced Settings] to check chunking.
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.

1

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.

2

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.

召回测试中的命中来源、相关度、片段内容和排序
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.
3

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.

4

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.

5

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.

How to adjust when chunking is incomplete

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

知识库高级设置中的智能分段、分隔符、分段大小和重叠大小
For general materials, you can start with Smart Chunking enabled, Chunk Size 1024, and Overlap Size 200.
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

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.

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.

本地模型设置中的嵌入模型下载入口
First complete the local model download, then return to the knowledge base to select it and build the index.

Tuning loop

用固定问题进行召回测试、定位问题、单项调整、重新索引并复测的知识库质量调优闭环
Fixed questions → check results → locate the layer → adjust one item → reindex if necessary → retest.

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

Can the knowledge base still search without an embedding model?

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

Why can’t I see [Similarity Threshold]?

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

Why did old materials not change after modifying the chunk size?

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

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

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.

Continue reading

Last updated

Was this helpful?