dotsagent.io
Language:English
Framework · Pydantic

Pydantic AI at a glance

A Python agent framework from the Pydantic team, built around type hints, validated structured outputs and dependency injection. It stands out for durable execution on seven engines, from Temporal to Airflow, and ships Pydantic Evals alongside.

Best for: Type-safe Python agents whose outputs must validate, with your pick of durable engine.

Key facts

Maintainer
Pydantic
Languages
Python
Licence
MIT
Latest version
2.52.0 · September 30, 2026
Repository
pydantic/pydantic-ai · 20,308 stars
Hosted option
None

Quickstart

Install the package, set the credentials, then run the smallest agent from the official docs. Model IDs are the ones the docs use and may not be enabled on your account.

Install
pip install pydantic-ai

Needs OPENAI_API_KEY (or use Agent('test') offline)

Python
from typing import Literal

from pydantic import BaseModel, Field

from pydantic_ai import Agent, RunContext

class Sentiment(BaseModel):
    label: Literal['positive', 'negative', 'neutral']
    score: float = Field(ge=-1, le=1)

agent = Agent('openai:gpt-6-sol', output_type=Sentiment)

@agent.tool
def recent_reviews(ctx: RunContext, product: str) -> list[str]:
    """Fetch recent review snippets for a product."""
    return ['The new release fixed everything I complained about!']

result = agent.run_sync('How are people feeling about the Extract app?')
print(result.output)
#> label='positive' score=0.9

Quickstart source

Features

Any modelYesSwitching model is a string change; offline test model included
MCP clientYesAdded as an MCP capability on the agent
MCP serverNot confirmed
Multi-agentYesSubAgents capability, and typed control flow with Pydantic Graph
Durable runsYesTemporal, DBOS, Prefect, Restate, AWS Lambda, Kitaru or Airflow
Human approvalYesApproval works under durable execution too
TracingYesOpenTelemetry-native; one line sends traces to Logfire
EvalsYesPydantic Evals, a separate package from the same project

Recent changes

  • Moved to a 2.x line; 1.x still gets maintenance releases, such as v1.107.7 on 30 September 2026.
  • The new pydantic-ai-harness package adds Coder, Researcher and SubAgents.
  • Added realtime voice, image generation and embeddings.
  • The docs moved to pydantic.dev/docs/ai/.

Alternatives in the same language

Sources

  1. ai.pydantic.dev/
  2. github.com/pydantic/pydantic-ai
  3. pypi.org/pypi/pydantic-ai/json
  4. api.github.com/repos/pydantic/pydantic-ai/releases

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026