The Knowledge Retrieval service supports searching a single knowledge base or performing a multi-knowledge-base federated search to help you find relevant content from your private enterprise knowledge bases. You can create and configure retrieval services in the console or integrate them into your applications using the API.
Create a Retrieval Service
- Log on to the console and go to Knowledge Services → Knowledge Retrieval.
- Click Create Retrieval Service in the upper-right corner. In the dialog box that appears, enter a Service Name (required, up to 40 characters) and a Description (optional, up to 200 characters), then click Confirm.
- After the service is created, you are redirected to its configuration page. Click + Add to associate one or more knowledge bases (up to 15). You can set a weight for each knowledge base. A higher weight prioritizes its results in the final ranking.
- Configure global retrieval parameters, such as knowledge base routing and the re-ranking model. For details, see Global Retrieval Configuration below. To configure independent parameters for a specific knowledge base, click the Settings icon to the right of the knowledge base to expand its configuration panel. For details, see Per-Knowledge-Base Configuration below.
- Enter a query in the chat window on the right to view the returned chunks, including similarity scores, source documents, and retrieval latency.
- After you complete the configuration, click Publish in the upper-right corner. After publishing, you can call the retrieval service through the API.
- At least one knowledge base must exist, and it must contain successfully parsed documents.
- For multi-knowledge-base federated retrieval, all knowledge bases must reside in the same workspace.
Global Retrieval Configuration
The following parameters apply uniformly to all associated knowledge bases:
| Parameter | Valid Range | Description |
|---|---|---|
| Knowledge Base Routing | On/Off | When enabled, the system automatically determines which knowledge bases to query based on retrieval intent, avoiding the need to search all of them. The routing decision relies on a large model and incurs model invocation fees |
| Re-ranking Model | qwen3-rerank / qwen3-rerank(hybrid) / qwen3-vl-rerank / No model | When enabled, a re-ranking model uniformly sorts results from multiple knowledge bases. When disabled, each knowledge base sorts its results independently. For text-only knowledge bases, select the qwen3-rerank series. For multimodal knowledge bases, select qwen3-vl-rerank |
| Re-ranking Mode | Q&A Mode / Similarity Mode / Custom Advanced Mode | Q&A Mode: Ranks chunks by Q&A matching score, prioritizing chunks that are likely to answer the query. Similarity Mode: Ranks chunks by semantic similarity. Custom Advanced Mode: Allows custom intervention in the re-ranking model |
| Max Recall Count | 1~20 | The total number of chunks returned after re-ranking |
Per-Knowledge-Base Configuration
Click the expand icon next to a knowledge base to configure its independent retrieval parameters:
After expanding the panel, you can configure parameters such as query rewriting, recall TopK, re-ranking model, and similarity threshold for the knowledge base.
| Parameter | Valid Range | Description |
|---|---|---|
| Query Rewriting | On/Off | Rewrites and optimizes the user input to improve retrieval performance |
| Initial Vector Retrieval TopK | 1~100 | The number of chunks initially retrieved in the vector search phase |
| Initial Keyword Retrieval TopK | 1~100 | The number of chunks initially retrieved in the keyword search phase |
| Re-ranking Model | qwen3-rerank, etc. / No model | Independently sorts the results retrieved from this knowledge base |
| Re-ranking Mode | Q&A Mode / Similarity Mode | Q&A Mode ranks chunks by Q&A matching score. Similarity Mode ranks chunks by semantic similarity. Available only when a re-ranking model is selected |
| Similarity Threshold | 0.01~1.0 | Filters out chunks whose scores fall below the threshold after re-ranking. A higher value yields more precise results but may exclude relevant content |
| Max Recall Count | 1~20 | The number of chunks returned from this knowledge base after re-ranking |
| Tag Filtering | — | Filters the retrieval scope based on document tags. Enter a tag and press Enter, or select an existing tag from the drop-down list |
Retrieval Workflow
After receiving a query request, the Knowledge Retrieval service returns results in the following steps:
- Query Rewriting (optional): Rewrites and optimizes the user input to improve retrieval performance.
- Vector + Keyword Retrieval: Retrieves relevant chunks based on semantic similarity and keyword matching.
- Re-ranking: Uses a re-ranking model to refine the retrieved results and filter out low-scoring chunks.
- Result Return: After re-ranking, the original semantic scores are weighted, and the chunks are returned in descending order of weighted score.
API Invocation
Call the service through the Knowledge Retrieval API:
nodes array contains the matched chunks, including the original content, relevance scores, and source metadata.
This is the low-level retrieval API for a single knowledge base. It directly returns vector and keyword retrieval results without re-ranking. To enable re-ranking, configure a re-ranking model when you create the retrieval service (see Global Retrieval Configuration above) and call the service through its API.