# Pydantic AI

> Open-source typed Python SDK for building agents with any model, structured outputs, durable execution, realtime voice, and observability.

Pydantic AI is an open-source Python AI SDK from the Pydantic team (Pydantic Services Inc.), released under the MIT license. It provides a typed, extensible agent loop where models from many providers can be swapped with a string. The latest release listed on GitHub is v2.56.0, published 2026-10-13.

## What It Is

Pydantic AI is a Python framework for building agents that return validated, typed results. You define an agent with an output type, tools, and injected dependencies. Tool arguments and structured outputs are validated, and validation errors are sent back to the model so it can retry. Image generation and embeddings ship in the same package, while Pydantic Graph (typed control flow) and Pydantic Evals (agent testing) are separate packages.

## Pydantic AI Harness and capabilities

The companion Pydantic AI Harness package adds capabilities for long-running work: a workspace with file access and allowlisted shell, planning, subagents, cross-session memory, context compaction, tool output limits, and guardrails. Complete agents such as Coder and Researcher are composed from these capabilities, so they can be used whole or taken apart. Core capabilities include MCP and web search, and agents can also be defined through YAML/JSON specs.

## Durable execution and interfaces

Agents can run on durable backends so work survives restarts and long waits, including human approval steps. Documented engines are Temporal, DBOS, Prefect, Restate, AWS Lambda, Kitaru, Airflow, Absurd, and pgtask. The same agent can run as a CLI, web chat, UI event stream (AG-UI, Vercel AI), ACP editor agent, GitHub Agentic Workflows job, or a realtime voice session on OpenAI Realtime, Gemini Live, Azure, and xAI.

## Observability and testing

Instrumentation is OpenTelemetry-based, so traces can go to any OTel backend or to the optional Pydantic Logfire platform. Pydantic Evals lets you build datasets and score agent behavior, and a built-in test model allows offline unit tests. The optional AI Gateway offers one key for many models with cost monitoring.

## Features
- Typed agents with structured output validation and retries
- Model-agnostic API across many providers
- Function tools with dependency injection
- Pydantic AI Harness capabilities: workspace, planning, subagents, memory, guardrails
- Durable execution on Temporal, DBOS, Prefect, Restate, AWS Lambda and more
- Human-in-the-loop tool approval
- Realtime voice agents
- Image generation and embeddings
- MCP and web search capabilities
- Pydantic Evals for agent testing
- OpenTelemetry instrumentation with Logfire
- CLI, web chat, AG-UI and Vercel AI UI streams, ACP

## Integrations
OpenAI, Anthropic, Google, Amazon Bedrock, Azure AI Foundry, Groq, Mistral, xAI, Ollama, Temporal, DBOS, Prefect, Restate, AWS Lambda, Apache Airflow, Kitaru, Pydantic Logfire, OpenTelemetry, MCP, GitHub Actions

## Platforms
WEB, API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
v2.56.0

## Links
- Website: https://pydantic.dev/pydantic-ai
- Documentation: https://pydantic.dev/docs/ai/
- Repository: https://github.com/pydantic/pydantic-ai
- EveryDev.ai: https://www.everydev.ai/tools/pydantic-ai
