Quick Use
pip install phidata duckduckgo-search- Define an Assistant with
description,tools, optionalmemoryandknowledge_base assistant.print_response("<your question>")— or serve the playground at localhost:7777
Intro
Phidata's Assistant class is the Python-first agent abstraction — memory, knowledge bases, structured outputs, and tool use plugged in as keyword arguments. No graph, no nodes, no decorators outside the tool registration. Best for: builders who want a Python class they can grow into a production agent, not a framework that takes over their whole codebase. Works with: any LLM via LiteLLM, PgVector / Lance / SingleStore for knowledge. Setup time: 5 minutes.
Hello assistant
from phi.assistant import Assistant
from phi.tools.duckduckgo import DuckDuckGo
assistant = Assistant(
description="Research assistant. Use web search aggressively, cite sources.",
tools=[DuckDuckGo()],
show_tool_calls=True,
markdown=True,
)
assistant.print_response("Compare Pinecone, Weaviate, Qdrant in 2026")Add memory
from phi.memory import AssistantMemory
from phi.memory.db.postgres import PgMemoryDb
assistant = Assistant(
memory=AssistantMemory(db=PgMemoryDb(table_name="assistant_memory")),
...
)Memory persists across runs. The next session starts with a summary of past conversations.
Add knowledge (RAG built in)
from phi.knowledge.pdf import PDFUrlKnowledgeBase
from phi.vectordb.pgvector import PgVector
kb = PDFUrlKnowledgeBase(
urls=["https://example.com/paper.pdf"],
vector_db=PgVector(table_name="kb"),
)
kb.load(recreate=False)
assistant = Assistant(
knowledge_base=kb,
add_references_to_prompt=True,
...
)The Assistant retrieves relevant chunks per query and injects them into the prompt.
Built-in playground
from phi.playground import Playground, serve_playground_app
app = Playground(assistants=[assistant]).get_app()
serve_playground_app("main:app", reload=True)localhost:7777 gives you a chat UI to test the Assistant — useful in dev, not for prod.
FAQ
Q: Phidata vs Agno — what's the relationship? A: Same team. Phidata is the older brand; Agno is the newer name + cleaner runtime. Phidata still maintained but Agno is where new features land. For new projects, prefer Agno.
Q: Is Phidata free? A: Yes — open-source under Mozilla Public License 2.0. The hosted Phidata Cloud (monitoring + auth) is paid, but everything you run on your own infra is free.
Q: Can I use Phidata with Claude?
A: Yes — Phidata uses LiteLLM under the hood. Set llm=Claude(model='claude-3-5-sonnet-20241022') or any of 100+ providers. Tool use, structured outputs, and memory all work the same.
Source & Thanks
Built by Phidata. Licensed under MPL-2.0.
phidatahq/phidata — ⭐ 13,000+