Agentic AI using the Phidata Framework


In the world of artificial intelligence, a powerful shift is taking place—toward Agentic AI. These are not just language models responding to queries, but intelligent software agents capable of planning, reasoning, using tools, and even collaborating with other agents to accomplish complex tasks.
One of the best frameworks to build such agents with elegance and power is Phidata. Let’s explore how Phidata simplifies agent creation while allowing powerful multi-agent orchestration.
🚀 What is Phidata?
Phidata is a Python-based framework that helps you build multi-modal, tool-using, memory-powered, reasoning-capable agents. You can create individual agents or team them up into a collaborative workflow—all with a clean and simple development experience.
💡 Why Use Phidata?
Minimal boilerplate – agents can be created in just a few lines.
Supports multi-modal inputs – text, image, audio, video.
Supports tool usage – web search, file reading, APIs.
Supports teamwork – combine multiple agents into workflows.
Built-in agent UI – interact with your agents through a web interface.
🛠️ Getting Started
1. Install Phidata
pip install phidata
2. Create a Simple Agent
Let’s say you want to create an AI agent that uses Google Search to answer questions.
from phidata.agent.tools.duckduckgo import DuckDuckGoSearchTool
from phidata.agent import LLMAgent
from phidata.llm.openai import OpenAIGpt4
search_tool = DuckDuckGoSearchTool()
agent = LLMAgent(
name="search_bot",
llm=OpenAIGpt4(),
tools=[search_tool],
instructions="You are a helpful AI agent. Use the search tool to find accurate and recent information."
)
response = agent.run("What's the latest update on SpaceX?")
print(response.content)
This agent will call DuckDuckGo to fetch relevant information and summarize it for you using GPT-4.
3. Add a Custom Tool
You can easily build your own tools. Here's an example of a basic calculator tool:
from phidata.agent.tool import Tool
class CalculatorTool(Tool):
name = "calculator"
description = "Performs basic arithmetic operations."
def run(self, input: str) -> str:
try:
result = eval(input)
return f"The result is {result}"
except Exception as e:
return f"Error: {e}"
calc_tool = CalculatorTool()
agent = LLMAgent(
name="math_helper",
llm=OpenAIGpt4(),
tools=[calc_tool],
instructions="Use the calculator tool for any math-related questions."
)
response = agent.run("What is (42 * 2) + 15?")
print(response.content)
4. Create Multi-Agent Workflows
Phidata allows you to define multiple agents and connect them into pipelines:
from phidata.agent.team import AgentTeam
researcher = LLMAgent(
name="researcher",
llm=OpenAIGpt4(),
tools=[DuckDuckGoSearchTool()],
instructions="Research the topic and summarize key points."
)
writer = LLMAgent(
name="writer",
llm=OpenAIGpt4(),
instructions="Write a blog post based on the research notes provided."
)
team = AgentTeam(
name="blog_team",
agents=[researcher, writer]
)
response = team.run("Write a blog post about the impact of AI in healthcare.")
print(response.content)
The researcher gathers info, and the writer creates content based on that. This is agentic teamwork in action.
🧠 Adding Memory and State
Phidata supports long-term memory using vector stores and structured state management. This means agents can remember past interactions and retrieve knowledge dynamically. (We'll explore this more in an advanced post.)
✨ Conclusion
Phidata makes it easy to go from a prompt-based chatbot to a full-blown intelligent agent that can:
Browse the web
Use custom tools
Collaborate in teams
Interact via a GUI
Maintain memory and state
Whether you’re building a solo assistant or an AI-powered workflow for your business, Phidata gives you the cleanest and most scalable foundation to do it.
**Thank you for reading the article!**😊
Subscribe to my newsletter
Read articles from ANURAG KULE directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
