Phidata — AI Agents with Memory, Knowledge & Tools
Python framework for building AI agents with built-in memory (PostgreSQL), knowledge bases (RAG), and 50+ tool integrations. Production-ready with monitoring dashboard. 18,000+ GitHub stars.
先审查再安装
这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。
npx -y tokrepo@latest install 67988bf9-9e52-4878-ad19-16dc90b43bea --target codex先 dry-run,确认写入项后再运行此命令。
What it is
Phidata is a Python framework for building AI agents that come with built-in memory (backed by PostgreSQL), knowledge bases (via RAG), and 50+ tool integrations out of the box. It provides a structured approach to creating agents that remember conversations, search through documents, and take actions via external APIs.
The framework targets developers building production AI assistants, customer support bots, or research agents that need persistent state and access to domain-specific knowledge.
How it saves time or tokens
Phidata bundles memory, knowledge, and tool calling into a single framework. Without it, you would need to separately integrate a vector database, build RAG pipelines, implement conversation persistence, and wire up tool schemas. Phidata provides all of this with minimal configuration, reducing setup time from days to hours.
How to use
- Install Phidata:
pip install phidata. - Create an Agent with your chosen model, tools, and knowledge source.
- Run the agent with
.run()or.print_response()for interactive use.
Example
from phi.agent import Agent
from phi.tools.duckduckgo import DuckDuckGo
from phi.model.openai import OpenAIChat
agent = Agent(
model=OpenAIChat(id='gpt-4o'),
tools=[DuckDuckGo()],
description='You are a research assistant.',
instructions=['Always cite your sources.'],
show_tool_calls=True,
markdown=True,
)
agent.print_response('What are the latest developments in AI agents?')
Related on TokRepo
- Phidata Deep-Dive -- detailed Phidata framework breakdown
- AI Tools for Agents -- compare AI agent frameworks
Common pitfalls
- Phidata's memory requires a PostgreSQL database for persistence. For local development, use Docker to run a lightweight Postgres instance.
- Tool calling adds latency per turn. Limit the number of active tools to those the agent actually needs for the current task.
- Knowledge base indexing must be triggered manually after adding new documents. Automate re-indexing in your CI/CD pipeline for production.
常见问题
Phidata stores conversation history and agent state in PostgreSQL. Each session has a unique ID, and the agent automatically loads prior context when a session resumes. This gives agents persistent memory across restarts.
Phidata supports PDF files, web pages, text documents, and custom data sources for RAG. Documents are chunked, embedded, and stored in a vector database (pgvector by default) for semantic retrieval.
Yes. Phidata provides a Team class for orchestrating multiple agents. You can define agents with different roles and have them collaborate on tasks with a supervisor agent routing work.
Phidata supports OpenAI, Anthropic, Google Gemini, Groq, Together AI, Ollama, and other providers. You swap models by changing the model parameter in the Agent constructor.
Phidata is open source under the MIT license. There is also a paid cloud platform (phi.com) for monitoring, debugging, and team collaboration on agent projects.
引用来源 (3)
- Phidata GitHub— AI agents with memory, knowledge, and 50+ tool integrations
- Phidata Memory Docs— PostgreSQL-backed agent memory and pgvector knowledge
- Phidata Teams Docs— Multi-agent team orchestration
来源与感谢
讨论
相关资产
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.
Graphiti — Real-Time Knowledge Graphs for AI Agents
Build real-time knowledge graphs for AI agents by Zep. Temporal awareness, entity extraction, community detection, and hybrid search. Production-ready. 24K+ stars.
Phidata — Build & Deploy AI Agents at Scale
Framework for building, running, and managing AI agents at scale. Memory, knowledge, tools, reasoning, and team workflows. Monitoring dashboard included. 39K+ stars.
Zep — Long-Term Memory for AI Agents and Assistants
Production memory layer for AI assistants. Zep stores conversation history, extracts facts, builds knowledge graphs, and provides temporal-aware retrieval for LLMs.