knowledge retrieval

更新时间:
复制 MD 格式

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.

Features

The Knowledge Retrieval service is designed for enterprise-level search across multiple knowledge bases and offers the following core capabilities:

  • multi-knowledge-base federated search: Search up to 15 knowledge bases simultaneously without querying them individually.

  • High-precision retrieval: Achieve high-quality results through a pipeline that includes query rewrite, hybrid search (vector and keyword), and a reranking model.

  • Granular parameter configuration: Configure retrieval parameters such as the vector recall count, reranking model, similarity threshold, and field filters independently for each knowledge base.

  • Multimodal support: Search across text, images (in image knowledge bases), and content within audio and video files.

How it works

When the Knowledge Retrieval service receives a query, it processes the query in the following steps:

  1. query rewrite (Optional): Rewrites the user's query to improve retrieval accuracy.

  2. Vector and keyword search: Retrieves relevant chunks based on semantic similarity and keyword matching.

  3. Rerank: Refines the initial results using a reranking model and filters out low-scoring chunks.

  4. Return results: After reranking, the service re-weights the original semantic scores and returns the final list of chunks, sorted from the highest to the lowest weighted score.

Create a retrieval service

Prerequisites

  • You have created at least one knowledge base with uploaded and parsed documents.

  • To use multi-knowledge-base federated search, ensure all relevant knowledge bases are in the same business space.

Procedure

  1. Go to the Knowledge Base page and click the Knowledge Retrieval tab.

  2. In the upper-right corner, click Create Retrieval Service.

  3. In the dialog box that appears, enter a Service Name (required, up to 15 characters) and a Description (optional, up to 200 characters), then click Confirm.

  4. After the service is created, you are redirected to its configuration page. Click + Add to associate one or more knowledge bases (up to 15).

  5. Configure parameters such as Knowledge Base Routing, hybrid ranking model, hybrid ranking model mode, and maximum recall count as needed. For details, see the Configuration parameters section below.

  6. After you complete the configuration, click Publish in the upper-right corner. You can then view the service status in the retrieval service list.

Configuration parameters

Global retrieval settings

The configuration page includes the following global parameters that apply to all associated knowledge bases:

Parameter

Value range

Description

Knowledge Base

Up to 15

Associate the knowledge bases you want to search. Click + Add to select knowledge bases. You can set a weight for each knowledge base. A higher weight prioritizes its results in the final ranking. Click the image icon next to a knowledge base to expand its individual retrieval settings.

Knowledge Base Routing

On/Off

When enabled, the system automatically determines which knowledge bases to query based on search intent, avoiding the need to search all of them. This routing decision relies on a large model and may incur model invocation fees.

hybrid ranking model

When enabled, the service uses a hybrid ranking model to uniformly rank results from all knowledge bases. When disabled, each knowledge base uses its internal reranking model, and the results are returned in groups. For text-only knowledge bases, you can select:

  • No Model

  • qwen3-rerank

  • qwen3-rerank(hybrid)

For multimodal knowledge bases (such as image or visual understanding knowledge bases), you can select:

  • No Model

  • qwen3-vl-rerank

hybrid ranking model mode

The operating mode for the hybrid ranking model. Options include:

  • Q&A mode: Ranks results based on question-and-answer relevance. The model assumes the query is a question and prioritizes chunks that are likely to answer it.

  • similarity mode: Ranks results based on semantic similarity to the query, prioritizing chunks that are semantically close to the query.

  • custom advanced mode: Allows you to customize and intervene in the reranking model.

maximum recall count

1–20

The total number of chunks to return after the hybrid ranking process.

Individual knowledge base settings

Click the image icon next to a knowledge base to expand its individual retrieval parameters:

Parameter

Value range

Description

initial vector search top-k

1–100

The number of chunks to initially retrieve during the vector search phase. This option is available only for Basic Document Q&A and Table knowledge bases.

initial keyword search top-k

1–100

The number of chunks to initially retrieve during the keyword search phase. This option is available only for Basic Document Q&A and Table knowledge bases.

reranking model

Independently ranks the results retrieved from this knowledge base. For Basic Document Q&A and Table knowledge bases, you can select models like qwen3-rerank. For multimodal knowledge bases, you can select qwen3-vl-rerank. This option is not available for Instant Q&A knowledge bases.

reranking model mode

The operating mode of the reranking model (Q&A mode or similarity mode). Q&A mode ranks based on question-and-answer relevance, prioritizing chunks that can answer the query. Similarity mode ranks based on semantic similarity, prioritizing chunks similar to the query. This is available only when a reranking model is enabled.

similarity threshold

0.01–1.0

Filters out chunks with a reranked score below this threshold. A higher value yields more precise results but may exclude some relevant content.

maximum recall count

1–20

The number of chunks to return from this knowledge base after reranking.

tag filtering

Filters the search scope based on document tags. Enter a tag and press Enter, or select an existing tag from the drop-down list.

structured field filtering

Filters the search scope based on the structured fields of documents. This option is available only for Table knowledge bases.

Test retrieval performance

After you publish a retrieval service, you can test its performance directly from the console:

  1. In the retrieval service list, click a service to go to its details page.

  2. Enter a query in the chat window on the right.

  3. View the returned chunks, which show the similarity score, source document, and retrieval time.

Related documentation