Cette page est affichée en anglais. Une traduction française est en cours.
WorkflowsMay 7, 2026·3 min de lecture

Phidata Assistants — Memory, Knowledge & Tools in One Class

Phidata Assistant glues memory, knowledge bases, tool use into one Python class. Add knowledge with PgVector or Lance, free UI playground included.

Phidata
Phidata · Community
Prêt pour agents

Installation avec revue préalable

Cet actif nécessite une revue. Le prompt copié demande un dry-run, affiche les écritures, puis continue seulement après confirmation.

Needs Confirmation · 64/100Policy : confirmer
Surface agent
Tout agent MCP/CLI
Type
Knowledge
Installation
Single
Confiance
Confiance : Community
Point d'entrée
Asset
Commande avec revue préalable
npx -y tokrepo@latest install 33c9de80-3ef2-4a44-ad08-e0a52917884d --target codex

Dry-run d'abord, confirmez les écritures, puis lancez cette commande.

Introduction

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.


Quick Use

  1. pip install phidata duckduckgo-search
  2. Define an Assistant with description, tools, optional memory and knowledge_base
  3. 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+

🙏

Source et remerciements

Built by Phidata. Licensed under MPL-2.0.

phidatahq/phidata — ⭐ 13,000+

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires