Phidata Documentation
website·Indexed 33 days ago
https://docs.phidata.comA framework for building autonomous agents with memory, knowledge, and tools. Phidata enables the creation of agent teams, structured output using Pydantic models, and advanced RAG capabilities through various chunking strategies and embedders including OpenAI, Azure OpenAI, Gemini, and Ollama. It includes a built-in Agent UI playground for interacting with agents.
What's inside Phidata
- Workflows in Phidata are deterministic, stateful, multi-agent pipelines defined as Python classes. They provide full control over the agent sequence and input processing, and include built-in memory for storing state and caching results in a database, allowing agents to reuse results from previous steps.
Overview of Phidata Agent API
The Agent API allows developers to serve AI agents using a FastAPI server. It utilizes a Postgres database to store agent memory and knowledge. The API can be run locally using Docker or deployed to production environments on AWS.Overview of Phidata development application structure
The development application runs locally on Docker. Its resources are defined inworkspace/dev_resources.py, and common settings for workspace apps and resources are managed via theWorkspaceSettingsobject inworkspace/settings.py.Overview of Phidata (Agno)
Phidata (now rebranded as Agno) is a framework used to build multi-modal agents and workflows. It allows developers to create agents equipped with memory, knowledge, tools, and reasoning. Key capabilities include multi-agent orchestration, built-in Agentic RAG, structured outputs, and a dedicated Agent UI for interaction.Overview of Phidata Apps and Applications as Code
Phidata Apps allow you to define tools such asFastApi,PgVector,Streamlit,Jupyter, andDjangoas Python classes. This 'Applications as Code' approach abstracts away the complexity of defining containers and volumes, allowing the same App definition to run on Docker, AWS (ECS), or Kubernetes (EKS). The App automatically handles the creation of underlying resources like LoadBalancers, Services, and Deployments.Overview of the Phidata Agent App architecture
The Agent App provides a framework to serve AI agents using a FastAPI server, test them via a Streamlit UI, and persist memory and knowledge using a Postgres database. It is designed to be run locally using Docker or deployed to production on AWS.Overview of Phidata Agent Memory types
Phidata provides three primary types of memory to improve Agent Experience (AX):
- Chat History: Previous messages from the conversation. It is recommended to send the last 3-5 messages to the model.
- User Memories: Notes and insights about the user used to personalize responses.
- Summaries: A condensed version of the conversation added to the prompt when chat history becomes too long.
Access phidata agent examples and cookbook
phidata provides a variety of agent recipes ranging from basic workflows to advanced fine-tuning and evaluations. These examples can be run individually or accessed collectively via the phidata cookbook repository on GitHub.# Clone the phidata cookbook to run examples locally git clone https://github.com/agno-agi/phidata.git cd phidata/cookbookUnderstand how vector databases power Agent knowledge retrieval
Phidata uses vector databases to efficiently retrieve relevant information from dense datasets through a three-step process:
- Chunking: Breaking down knowledge into smaller pieces to ensure search queries return only the most relevant results.
- Loading: Converting these chunks into embedding vectors and storing them in the vector database.
- Searching: Converting a user's input message into an embedding and performing a 'nearest neighbor' search in the vector database to find the most relevant context.
Twitter toolkit available functions
•
create_tweet: Creates and posts a new tweet •reply_to_tweet: Replies to an existing tweet •send_dm: Sends a direct message to a Twitter user •get_user_info: Retrieves information about a Twitter user •get_home_timeline: Gets the authenticated user's home timelineBuild deterministic multi-agent programs with Workflows
Workflows in Phidata are deterministic, stateful, multi-agent programs designed for production applications. They provide full control over the agent process, allowing developers to define the exact order of agent execution and how input is processed using pure Python. Key features include built-in state management and caching, which allow agents to store and reuse intermediate results from previous executions via a database.Create an Image Agent to analyze images with Phidata
Use theAgentclass fromphi.agentcombined with a multimodal model likegpt-4oto analyze one or more images. You can pass a list of image URLs to theimagesparameter within theprint_responsemethod to ask questions about the visual content and identify differences between images.from phi.agent import Agent from phi.model.openai import OpenAIChat agent = Agent( model=OpenAIChat(id="gpt-4o"), markdown=True, ) agent.print_response( "What are in these images? Is there any difference between them?", images=[ "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg", "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg", ], )