In this blog post, I will share, how you can build Agentic RAG using Phidata which is an Agentic Framework to create complex agents workflow.
How to Create Agents in Phidata
Here I will create two agents, one is a web search agent and another one is a website agent. Before proceeding with further steps there are some prerequisites you need to follow.
Prerequisites
You need an OpenAI API key in order to run Phidata and, a second Groq API key that enables us to use open-source models with fast inference.
How to create Groq and OpenAI API Keys
Create an account on Groq and go to the settings option to create an API key.
Once you have done the above steps, then store the API keys in the environment variable by creating an env file and storing the respective keys there.
All the codes are available on my Github page, so you don't need to find them anywhere. Please mark the fork on my GitHub page that motivates me to write more content for you.So let's proceed with them, to take further steps.
Create Agents
First, we create a web search agent. Here, we will mention the agent's name, their respective roles, the model name (any model you can choose depending upon the use case on the Groq platform), the tools name (Google search), Instructions (Mention the instructions needed to perform the specific task), enable the tool calls and markdown.
Second, we create a website agent here we will mention the same parameters above except we define instructions to perform.
After creating these two agents. We will create a multi-agent where we combine the above two agents. Here we give the team that defines agents, instructions for the two agents that we earlier defined above, and enable tools calls and markdown.
When the user gives a query like "What is the latest news about the given blog URL" as input then the first agent will fetch information about the latest news and pass this to another agent that will fetch information for the blog URL and combine the results and it will show this to the user.
End Note
So, these are the above steps you can follow to build multi-agent RAG using Phidata, This agentic framework provides multiple tools and services that you can use to build complex AI applications.