Pydantic AI
Typed Python agent framework from the team behind Pydantic, with durable execution on Temporal, DBOS, Prefect and others
Facts
- Price
- Free plan
- Runs on
- Python
- License
- MIT, open source
- Category
- AI
- Facts checked
Price checked · Current prices on github.com ↗
Our verdict
#2 of 10 in AI agent frameworks
Typed Python agents on any model
What it does
- Typed agents with validated, structured outputs
- Model switching by string, with fallback between providers
- Durable runs through Temporal, DBOS, Prefect, and other engines
- Human approval of tool calls
- OpenTelemetry tracing to any backend
Pros
- Plain Python that type checkers understand
- Provider-neutral, including local models
- A stated promise of no breaking changes within a major version
- Sends traces to Logfire only when you add a token
Cons
- Python only
- Crash recovery needs an engine you run, such as Temporal
- Graphs and step snapshots live in separate packages
- Smaller community than LangChain's
- Choose if:
- Your team already uses Pydantic models and type checking throughout
About Pydantic AI
Pydantic AI is an open-source Python framework for building LLM agents, made by the team behind Pydantic validation. Agents are ordinary Python code with typed structured outputs, typed dependency injection and tools, and they run on most model providers (OpenAI, Anthropic, Google, Bedrock, Ollama and many more). Multi-agent work uses delegation through tools, hand-off in your own code, or the separate Pydantic Graph package for typed state machines. Durable execution runs on engines you operate, including Temporal, DBOS, Prefect and Restate, and traces are plain OpenTelemetry that can go to Logfire or any other backend. It is MIT licensed, Python only, and has had a stable V1 API since September 2025 and a V2 since June 2026.
Ranked in
-
#2 of 10 AI agent frameworks Typed Python agents on any model 4.3/5
How it scored
-
Control over flow and state , counts double 4/5
Pydantic Graph (a separate free package) gives typed graph workflows, StepPersistence in the free Harness snapshots every step for save, resume and fork, and human approval is built in. Crash recovery needs an external engine such as Temporal, DBOS or Prefect, so not 5.
4/5 means: A workflow or graph engine in the free library with saved state, pause and resume, and human approvals
Agents survive restarts and run for days on the engine you already operate, with human-in-the-loop approval built in.
github.com/pydantic/pydantic-ai · checked Pydantic AI supports nine durable execution engines, plus a builder for any other engine.
pydantic.dev/docs/ai/capabilities/durable_execution/overview · checked A durable engine journals the agent’s model requests and the tool calls it wraps, and a restarted run replays the completed ones from the journal and retries the one in flight.
pydantic.dev/docs/ai/capabilities/durable_execution/overview · checked Saving, resuming, and forking a run need no engine: StepPersistence from Pydantic AI Harness snapshots every settled step to a store you choose, the way a checkpointer does (see Persistence). The engine is for recovering a run that crashes partway through a step.
github.com/pydantic/pydantic-ai · checked When plain control flow isn't enough, Pydantic Graph brings the same typing to graph-based workflows.
github.com/pydantic/pydantic-ai · checked
Show all 5
-
Production track record and API stability 4/5
Stable V1 since September 2025 with a written stability commitment, V2 in June 2026 with a migration guide, and active maintenance by the Pydantic team. A V2 breaking release lowers the case for 5.
4/5 means: Stable 1.0 or later with a stability commitment, active maintenance and named production users
In September 2025, Pydantic AI reached V1 and committed to API stability: no changes that break your code until V2. V2 is now available, collecting the breaking and behavior changes that stability guarantee didn’t allow.
pydantic.dev/docs/ai/project/changelog · checked The stable V2.0 release. There are no new breaking or behavior changes since the betas;
pydantic.dev/docs/ai/project/changelog · checked
-
Tracing and debugging 4/5
Built-in OpenTelemetry tracing exports to any backend, and Logfire is the maker's trace viewer with a free tier (10M records a month, hard-capped). The viewer is a separate hosted product and no rewind or replay debugger was found, so not 5.
4/5 means: Built-in tracing to the backend you choose, plus a visual debugger or trace viewer, local or from the maker, usable without a paid plan
This means you can debug and monitor Pydantic AI with any OpenTelemetry backend.
pydantic.dev/docs/ai/integrations/logfire · checked A deployment without that directory or a LOGFIRE_TOKEN sends nothing to Logfire
pydantic.dev/docs/ai/integrations/logfire · checked
-
Freedom to switch model providers 5/5
Native support for OpenAI, Anthropic, Google, Bedrock, Azure, Groq, Mistral, xAI, Ollama and more, switched with a model string, with no flagship feature tied to one vendor, and FallbackModel to fall back between providers.
5/5 means: Everything in 4, with no provider getting features others don't, and fallback or routing between providers built in
Virtually every model and provider (OpenAI, Anthropic, Google, Bedrock, Azure AI Foundry, Groq, Mistral, xAI, Ollama, and dozens more), swappable with a string
github.com/pydantic/pydantic-ai · checked
-
Multi-agent support 4/5
Documented patterns are delegation through tools, hand-off in code or by output function, graph control flow, and Harness SubAgents and Deep Agents, all controlled in code. A2A support (FastA2A) is also available.
4/5 means: Several built-in patterns, such as supervisor, handoff, parallel and group chat, that the developer controls in code
“Agent delegation” refers to the scenario where an agent delegates work to another agent, then takes back control when the delegate agent (the agent called from within a tool) finishes. If you want to hand off control to another agent completely, without coming back to the first agent, you can use an output function.
pydantic.dev/docs/ai/guides/multi-agent-applications · checked “Programmatic agent hand-off” refers to the scenario where multiple agents are called in succession, with application code and/or a human in the loop responsible for deciding which agent to call next.
pydantic.dev/docs/ai/guides/multi-agent-applications · checked
-
Learning curve and everyday developer experience 5/5
Plain Python agents with typed dependencies and validated, typed outputs, so many mistakes show up in the type checker before runtime; practitioners single out the type safety as the reason to choose it. Docs are extensive, though one practitioner reported a gap in the quickstart.
5/5 means: Everything in 4, with a design practitioners single out as pleasant to work in, such as plain code, strong typing and errors caught before runtime
When plain control flow isn't enough, Pydantic Graph brings the same typing to graph-based workflows.
github.com/pydantic/pydantic-ai · checked
-
Integrations and community help , counts half 4/5
MCP is in core, many providers and nine durability engines are integrated, and the repo has 21.4k stars. It is a large community but smaller than LangChain's, so not 5.
4/5 means: MCP support, many ready-made integrations, and a large community with plenty of examples and answers
21.4k stars
github.com/pydantic/pydantic-ai · checked Pydantic AI supports nine durable execution engines, plus a builder for any other engine.
pydantic.dev/docs/ai/capabilities/durable_execution/overview · checked Virtually every model and provider (OpenAI, Anthropic, Google, Bedrock, Azure AI Foundry, Groq, Mistral, xAI, Ollama, and dozens more), swappable with a string
github.com/pydantic/pydantic-ai · checked
Top of this ranking
- LangGraph #1
- Mastra #3
- Microsoft Agent Framework #4
-
Sources
15 quotes from 5 pages; the 12 most useful are below.
-
Limits and known issues 2
In September 2025, Pydantic AI reached V1 and committed to API stability: no changes that break your code until V2. V2 is now available, collecting the breaking and behavior changes that stability guarantee didn’t allow.
pydantic.dev/docs/ai/project/changelog · checked The stable V2.0 release. There are no new breaking or behavior changes since the betas;
pydantic.dev/docs/ai/project/changelog · checked
-
Features 10
Agents survive restarts and run for days on the engine you already operate, with human-in-the-loop approval built in.
github.com/pydantic/pydantic-ai · checked Pydantic AI supports nine durable execution engines, plus a builder for any other engine.
pydantic.dev/docs/ai/capabilities/durable_execution/overview · checked A durable engine journals the agent’s model requests and the tool calls it wraps, and a restarted run replays the completed ones from the journal and retries the one in flight.
pydantic.dev/docs/ai/capabilities/durable_execution/overview · checked Temporal, DBOS, Prefect, Restate, and AWS Lambda are co-maintained by the Pydantic and vendor teams.
pydantic.dev/docs/ai/capabilities/durable_execution/overview · checked Saving, resuming, and forking a run need no engine: StepPersistence from Pydantic AI Harness snapshots every settled step to a store you choose, the way a checkpointer does (see Persistence). The engine is for recovering a run that crashes partway through a step.
github.com/pydantic/pydantic-ai · checked When plain control flow isn't enough, Pydantic Graph brings the same typing to graph-based workflows.
github.com/pydantic/pydantic-ai · checked “Agent delegation” refers to the scenario where an agent delegates work to another agent, then takes back control when the delegate agent (the agent called from within a tool) finishes. If you want to hand off control to another agent completely, without coming back to the first agent, you can use an output function.
pydantic.dev/docs/ai/guides/multi-agent-applications · checked “Programmatic agent hand-off” refers to the scenario where multiple agents are called in succession, with application code and/or a human in the loop responsible for deciding which agent to call next.
pydantic.dev/docs/ai/guides/multi-agent-applications · checked This means you can debug and monitor Pydantic AI with any OpenTelemetry backend.
pydantic.dev/docs/ai/integrations/logfire · checked A deployment without that directory or a LOGFIRE_TOKEN sends nothing to Logfire
pydantic.dev/docs/ai/integrations/logfire · checked
Show all 10
