Skip to content

Improve knowledge search

Search settings control which Knowledge Base sections the Agent receives for its answer. Query transformation helps with short follow-ups. For example, it can turn “And on Saturday?” into a search for Saturday opening hours.

Start with the defaults

Setting Default Effect
Top K 5 Maximum number of retrieved sections
Similarity threshold 0.5 Minimum relevance score, from 0 to 1

A higher similarity threshold accepts fewer sections. A larger Top K lets the Agent use more sections. Test common customer questions before changing these values.

If no useful sections appear, check the document and connection first, then lower the threshold cautiously. If unrelated sections appear, improve source structure or raise the threshold before simply adding more context.

Choose a query transformation mode

Query transformation is disabled by default. When enabled, its history limit starts at 5.

Mode What you configure Result
LLM Transformation prompt, history and confidence settings The model interprets the turn and produces search information.
Decision Search decision prompt, rewrite model and rewrite prompt Decision chooses SEARCH or SKIP. A separate conversational model writes the query.

Decision availability depends on your workspace. In Decision mode, parallel rewrite can start rewriting alongside the search decision. This can reduce waiting but may perform a rewrite even when the decision ultimately skips retrieval.

Write separate instructions

For the Decision prompt, define when knowledge is needed:

Choose SEARCH for questions requiring our documented product or policy facts.
Choose SKIP for greetings, thanks and collecting contact details.
A short follow-up such as "And on Saturday?" needs SEARCH when it refers
back to a knowledge question.

For the rewrite prompt, define the query, not the answer:

Turn the current question and relevant history into a concise search query.
Resolve references from the conversation. Do not add unsupported facts.
Do not answer the caller.

Enter the instructions in their respective editors and add the variables offered there. The first instruction decides whether to search. The second writes the search query.

Test search and skip cases

Caller turn Expected check
“What are your opening hours?” Search for the documented hours.
“And on Saturday?” Preserve the subject from history.
“Thank you.” Skip unnecessary knowledge retrieval.
A question outside the documents Admit missing information rather than inventing an answer.

With SKIP, no knowledge is retrieved. If a knowledge question is skipped incorrectly, review the search decision in the Debug Monitor and adjust the instruction.