Registry / llm-agents / phidata

phidata

JSON →
library2.7.10pypypi✓ verified 82d ago

PhiData (phidata) is a Python library designed for building multi-modal AI Agents with capabilities like memory, knowledge retrieval (RAG), and tool integration. It simplifies the development of complex AI workflows by providing high-level abstractions for agents, assistants, and various components. The current stable version is 2.7.10, and it maintains an active release cadence with frequent updates.

pip install phidata
INSTALL
IMPORT
SIG · PHIDATA
P
phidata
llm-agentspythonv2.7.10
Install
6.4s avg
Import
Disk
59MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.7.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.000s · 58.6MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 6.4s · import 0.000s · 59MB
59MB installed
● package 59MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Assistant
from phi.assistant import Assistant
from phidata.assistant import Assistant

This quickstart demonstrates how to initialize an OpenAI LLM and create a simple Assistant to handle chat interactions. It highlights the basic setup for agents in phidata. Remember to set your `OPENAI_API_KEY` environment variable.

import os from phidata.llm.openai import OpenAILLM from phidata.assistant import Assistant # Ensure OPENAI_API_KEY is set in your environment variables # For local development, you might use python-dotenv: # from dotenv import load_dotenv; load_dotenv() # Initialize LLM (e.g., OpenAI) # Replace with os.environ.get('OPENAI_API_KEY', '') for production if not using dotenv llm = OpenAILLM(model="gpt-4o", api_key=os.environ.get('OPENAI_API_KEY', '')) # Create an Assistant assistant = Assistant(llm=llm, name="MyChatAssistant") # Run a chat interaction response = assistant.chat("Hello, how are you?") print(f"Assistant: {response}") response = assistant.chat("What is the capital of France?") print(f"Assistant: {response}") # Example with a tool (requires 'pip install "phidata[wikipedia]"') # from phidata.tools.wikipedia import WikipediaTool # assistant_with_tool = Assistant( # llm=llm, # name="WikiAssistant", # tools=[WikipediaTool()] # ) # response = assistant_with_tool.chat("Who is Marie Curie?") # print(f"WikiAssistant: {response}")
Debug
Known issues
breakingPhidata v2 introduced significant breaking changes compared to v1. Imports, configuration (from YAML to Python classes), and core APIs (e.g., `workflows` module) were completely refactored. Code written for v1 will not work with v2.
fix
Migrate your codebase to the phidata v2 API. Refer to the official documentation (docs.phidata.dev) for updated import paths, class names, and configuration patterns.
affects: 1.x -> 2.x
gotchaPhidata requires Pydantic v2. If your project has other dependencies that explicitly pin Pydantic v1, you may encounter dependency conflicts or runtime errors due to incompatible Pydantic models.
fix
Ensure all dependencies in your project are compatible with Pydantic v2, or use a tool like `pip-tools` or `poetry` for robust dependency resolution. Isolate environments if necessary.
affects: 2.x
gotchaAll LLM integrations (OpenAI, Mistral, Anthropic, etc.) require their respective API keys to be set as environment variables (e.g., `OPENAI_API_KEY`). Failing to set these will result in authentication errors.
fix
Set the required API key as an environment variable (e.g., `export OPENAI_API_KEY='sk-...'`). For local development, consider using `python-dotenv` to load keys from a `.env` file.
affects: 2.x
gotchaMany advanced features, tools, and vector database integrations (e.g., Gradio UI, Qdrant, ChromaDB, specific LLMs like Mistral/Anthropic) require installing phidata with optional 'extras'. Without these, you will encounter `ModuleNotFoundError`.
fix
Install phidata with the necessary extras using `pip install "phidata[extra_name]"`. For example, `pip install "phidata[qdrant]"` for Qdrant support. Consult the phidata documentation for a list of available extras.
affects: 2.x
Upgrade
Version history
2.7.10latest on PyPI · released Jan 27, 2025
Audit
Dependencies
openairequiredPrimary LLM integration, widely used.
pydanticrequiredData validation and settings management (v2 required).
python-dotenvrequiredLoading environment variables from .env files.
gradiooptionalFor building web UIs for agents.
qdrant-clientoptionalFor Qdrant vector database integration.
chromadboptionalFor ChromaDB vector database integration.
mistralaioptionalFor Mistral AI LLM integration.
anthropicoptionalFor Anthropic LLM integration.
Agent activity
27 hits · last 30 days
node
24
OpenAI (training)
1
Resources
phidata — pip install phidata · libregistry