Function Positioning
In traditional RAG (Retrieval-Augmented Generation) solutions, the system typically performs only one retrieval + one generation. The process can be abstracted as: user query → system retrieves relevant documents → directly generates answers. This approach performs well in simple scenarios but is prone to failure in the following situations:
In traditional RAG (Retrieval-Augmented Generation) solutions, the system typically performs only one retrieval + one generation. The process can be abstracted as: user query → system retrieves relevant documents → directly generates answers. This approach performs well in simple scenarios but is prone to failure in the following situations:
User query criteria are complex, such as filtering by time, region, metrics, and so on.
The scenarios involve tables and databases, requiring computations or SQL queries.
Agentic RAG solution: An approach that enables agents to autonomously think, decompose, and plan retrieval tasks, allowing for more effective handling of the aforementioned scenarios. The knowledge base retrieval Agent autonomously plans and decomposes retrieval tasks through the Agentic RAG approach, supporting multiple invocations of combined search and computational tools to deliver accurate responses to users. Instead of performing "one-time retrieval," it proactively plans retrieval steps like a human, invokes tools across multiple rounds, and ultimately synthesizes information from various sources to deliver accurate and explainable answers.
Features and Application Scenarios
Knowledge Base Search Agent autonomously plans search and computation tasks via Agentic RAG, suitable for complex knowledge Q&A and data analysis scenarios, including but not limited to:
|
Multi-document integration | When the answer is derived from multiple documents, the Agent will perform step-by-step search and synthesize information to respond. |
Document filtering then responds | Filtering the most relevant documents based on time, region, or category among multiple similar files, then generating answers. |
Complex table queries | Combining Text2SQL, SQLExecutor, and Code Interpreter to perform complex data analysis or metric computation. |
Additionally, in Multi-Agent scenarios, the Knowledge Base Search Agent can also participate as a sub-agent to collaborate on tasks and work with other agents to accomplish complex tasks. Create and Configure a Knowledge Base Search Agent
Step 1: Import documents in the app
Create a Multi-Agent mode application, click Knowledge Management, and import documents.
Step 2: Generate knowledge base Schema
After knowledge upload is complete, click More - Knowledge Base Schema in the upper right corner.
Click Generate Knowledge Base Schema in the pop-up window.
After generation is complete, the knowledge base Schema can be viewed in the pop-up window.
Note:
Knowledge base Schema generation requires a certain amount of time. It is recommended to re-trigger the knowledge base Schema update promptly after knowledge upload completion or knowledge base updates.
If the knowledge base content is modified, the knowledge base Schema button will display a red dot to indicate updates. Click Update again to update the knowledge base Schema to the latest version.
Step 3: Add a Knowledge Base Search Agent
Switch to Application Settings, then click Add Agent.
On the Add Agent page, create and select Knowledge Base Search Agent.
The Knowledge Base Search Agent describes the scope of questions it can answer, which should be added to the handover description, for example: "A policy Q&A Agent responsible for handling policy-related inquiries."
Refer to the template and application feature requirements to enter the search rules and example Q&A.
The handover relationship is configured by default with handover rules between the Knowledge Base Search Agent and the Primary Agent.
It is recommended to supplement relevant handover rules in the Primary Agent's prompt to enhance the handover effect, for example: "For inquiries regarding xxx, please hand over to the Knowledge Base Search Agent for response."
Working Principle of Knowledge Base Search Agent
The model configuration for the Knowledge Base Search Agent is the same as other Agents, supporting multiple model selections. You can switch models on the Model Configuration page.
The Knowledge Base Search Agent's prompts consist of two parts: Search Rules and Example Q&A, both of which need to be adjusted according to application requirements. Together, they define how the Agent understands user queries, plans the search process, and generates responses aligned with business logic.
Search Rules: Used to guide the Agent in parsing business semantics, metric logic, and search preferences within natural language queries. Developers can customize the following rule types based on business requirements:
|
Business mapping rules | Describing how business entities are mapped or categorized | For example, if Customer A is a customer in a specific region, it needs to be uniformly mapped to "Region A Customer" during search. |
Metric definition logic | Description of how default values or special cases are handled for metrics | If the payment method is not specified, 'post-payment' is queried by default. |
Data retrieval preferences | Description of preference settings or splitting methods during data search | Recommend splitting query data by month. |
Example Q&A: Used to describe step-by-step rules for data invocation, helping the model better understand task decomposition, tool invocation, and answer generation. Fill in the input, output, and corresponding step-by-step search process for sample questions according to the template.·.
The introduction of the Knowledge Base Search Agent helps the model determine when to hand over to this Agent. The handover description for the Knowledge Base Search Agent can summarize its features based on the template.
Recommend summarizing its scope of responsibilities in a concise statement, for example: "A policy Q&A Agent responsible for handling policy-related inquiries."
Depending on the knowledge base content, the handover description can be flexibly adjusted, for example:
Handling knowledge Q&A for product manuals.
Responding to internal policy inquiries.
Executing financial or data analysis queries.
The Knowledge Base Search Agent comes with various built-in commonly used tools, requiring no additional configuration. It can be used directly after being added to an application. Manual modification or deletion is currently unsupported. The scope of tools includes:
|
Knowledge Base Q&A/KnowledgeRetrievalAnswer | Large models answer user questions after searching through all knowledge base content. |
Knowledge Base Q&A/BoundedKnowledgeQA | Search for content within a specified scope and summarize responses using large models, which provides a more targeted search scope. |
Knowledge Base Q&A/Text2SQL | Receives users' natural language queries and database information, automatically generates executable SQL queries, and returns the executed data results. |
Calculator/Calculator | Suitable for simple numerical calculations. |
Code Interpreter/CodeInterpreter | Can perform code execution to accomplish complex numerical statistics and data computation. |
Knowledge Base Q&A/SQLExecutor | Accepts executable SQL statements and database information, and outputs the execution results of the SQL. |
FAQs
In what scenarios is the Knowledge Base Search Agent suitable for use?
Scenarios suitable for using the Knowledge Base Search Agent include:
1. Multi-document/QA pairs/table combined responses: requires extracting partial results from multiple documents and synthesizing information to answer user queries.
2. Document-filtered responses: when it is necessary to filter the most relevant content from multiple similar documents based on specific rules (such as time, region).
3. Complex tabular data queries: require combining Text2SQL, SQLExecutor, and computational tools to process complex tabular data metric queries. These scenarios typically involve multi-step retrieval, task decomposition, and data processing, where Agents can leverage their strengths in autonomous planning and decision-making.
These scenarios typically require multi-step search, task decomposition, and data processing, where the Knowledge Base Search Agent can leverage its strengths in autonomous planning and decision-making. For simple scenarios, it is recommended to use the Knowledge Base Search plugin or standard mode for knowledge base Q&A.
What is the difference between the Knowledge Base Search Agent and the Knowledge Base Q&A plugin?
The Knowledge Base Search Agent is an autonomous intelligent agent based on the Agentic RAG approach. It autonomously plans and decomposes retrieval processes according to task requirements, supporting multiple invocations of combined retrieval and computational tools to handle complex tasks. It is suitable for high-complexity scenarios such as multi-document comprehensive responses and complex data queries. Whereas the Knowledge Base Q&A plugin uses conventional single-pass RAG for response retrieval, performing single knowledge searches and query operations, making it ideal for knowledge Q&A tasks relying on a single retrieval information source.