Esta página se muestra en inglés. Una traducción al español está en curso.
WorkflowsMay 7, 2026·3 min de lectura

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.

Listo para agents

Instalación con revisión previa

Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.

Needs Confirmation · 64/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Knowledge
Instalación
Single
Confianza
Confianza: Community
Entrada
Asset
Comando con revisión previa
npx -y tokrepo@latest install 33c9de80-3ef2-4a44-ad08-e0a52917884d --target codex

Primero dry-run, confirma las escrituras y luego ejecuta este comando.

Introducción

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+

🙏

Fuente y agradecimientos

Built by Phidata. Licensed under MPL-2.0.

phidatahq/phidata — ⭐ 13,000+

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados