Retrieval
最后更新于
最后更新于
When users build knowledge base Q&A AI applications, if multiple knowledge bases are associated within the application, the service layer supports two retrieval modes: N-to-1 retrieval and Multi-path retrieval.
The Agent independently determines and selects the most matching single knowledge base for querying relevant text based on user intent and knowledge description. This mode is suitable for applications with distinct knowledge and fewer knowledge bases. N-to-1 retrieval relies on the model's inference capability to choose the most relevant knowledge base based on user intent. When inferring the knowledge, the knowledge serves as a tool for the Agent, chosen through intent inference; the tool description is essentially the knowledge description.
When users upload knowledge, the system automatically summarizes each knowledge base. To achieve the best retrieval results in this mode, you can view the system-generated summary description under “Knowledge -> Settings -> Knowledge Description” and check if this content summarizes the knowledge's content.
Here is the technical flowchart for N-to-1 retrieval:
Therefore, this mode's recall effectiveness can be impacted when there are too many knowledge bases or the knowledge descriptions lack sufficient distinction. This mode is more suitable for applications with fewer knowledge bases.
Based on user intent, this mode matches all knowledge bases simultaneously, queries relevant text chunks from multiple knowledge bases, and after a re-ranking step, selects the best results matching the user's question from the multi-path query results. Configuring the Rerank model API is required. In Multi-path retrieval mode, the search engine retrieves text content related to the user's query from all knowledge bases associated with the application, merges the results from multi-path recall, and re-ranks the retrieved documents semantically using the Rerank model.
Multi-path retrieval does not rely on the model's inferencing capability or knowledge descriptions so that this mode can achieve higher-quality recall results in multi-knowledge searches. Additionally, incorporating the Rerank step can effectively improve document recall. Therefore, when creating a knowledge base Q&A application associated with multiple knowledge bases, we recommend configuring the retrieval mode to multi-path retrieval.