Scripts2026年4月7日·1 分钟阅读

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 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Knowledge
安装
Single
信任
信任等级:Community
入口
Phidata — AI Agents with Memory, Knowledge & Tools
先审查命令
npx -y tokrepo@latest install 67988bf9-9e52-4878-ad19-16dc90b43bea --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
Phidata builds production AI agents with PostgreSQL-backed memory, RAG knowledge, and 50+ tools.
§01

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.

§02

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.

§03

How to use

  1. Install Phidata: pip install phidata.
  2. Create an Agent with your chosen model, tools, and knowledge source.
  3. Run the agent with .run() or .print_response() for interactive use.
§04

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?')
§05

Related on TokRepo

§06

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.

常见问题

How does Phidata handle agent memory?+

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.

What knowledge sources does Phidata support?+

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.

Does Phidata support multi-agent workflows?+

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.

Which LLM providers does Phidata work with?+

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.

Is Phidata free?+

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)
🙏

来源与感谢

Created by Phidata. Licensed under Apache 2.0.

phidata — stars 18,000+

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产