Agentic retrieval with the Smart agent
The Smart agent is a powerful tool that enhances the capabilities of traditional retrieval-augmented generation (RAG) systems. Regular RAG’s fixed search-then-generate process is limiting for complex questions that need intermediary steps and reasoning.
The Smart Agent plans the answer: picks the most appropriate sources, splits the question into sub-questions, evaluates relevancy, and iterates autonomously until the information is sufficient.
Basic usage
To set up a Smart Agent, declare all the sources you want to use (Knowledge Boxes, Perplexity, etc.) in the Sources section of the left menu. Then, create a new workflow in the Workflows section and add a Smart Agent in the Retrieval step.
Then connect your sources as Registered Agents to the Smart Agent. It is very important that you provide an extensive description of each registered agent, so that the Smart Agent can understand what each source is about and when to use it. Also select the proper function for each registered agent, depending on the type of source (MCP agents will not need one, the functions are provided dynamically by the MCP server).
In the Smart Agent configuration, you can select the planning mode:
reactive: The Smart Agent will decide what to do first, and will plan the next steps based on the information it retrieves. It is expected to be faster.plan_execute: The Smart Agent will plan all the steps in advance, and will execute them. It will be slower but more accurate when processing complex questions.
Different models can be chosen for different tasks:
- Context validation happens when the Prune context option is enabled (recommended), we recommend using a fast model - planning or the execution model (depending on the planning mode you have selected): we recommend using a more powerful model.
Note: the rephrasing model is only used in more complex workflow, it can be ignored in the present case.
Finally, add a Summarize agent in the Generation step to generate a final answer from the retrieved information.
Chat mode
If you want to use the Smart Agent in a chat interface, you need the following:
- Enable the Session history option in the Smart Agent configuration. This will allow the Smart Agent to take into account the previous conversation when planning its next steps.
- In the Summarize Agent, enable the Conversational mode. This will allow the Summarize Agent to generate a final answer that will not repeat the information already provided in the previous conversation, and will be more natural for a chat interface.