Pydantic AI is a Python SDK for typed agent loops, tools, structured outputs, and multiple model providers. The same agent can run in a terminal, web UI, voice, or durable workflows.
Overview
Pydantic AI is a Python framework for building agents and LLM applications with end-to-end typing. You define agents, tools, and output types so validation and schemas stay consistent across models and interfaces.
One agent definition can run behind a web frontend, in a terminal TUI, on realtime voice providers, on background queues with durable execution engines, in GitHub Actions, or as a plain object you call directly. Optional Pydantic AI Harness adds composable capabilities such as memory, guardrails, sub-agents, planning, and persistence, including a bundled coding agent.
The SDK supports many model providers through a unified API, structured outputs, dependency injection via run context, MCP server connections, streaming to UI protocols, image generation, embeddings, and integrations with Pydantic Evals and Pydantic Graph for evaluation and graph workflows. Instrumentation uses OpenTelemetry and integrates with Pydantic Logfire or other OTLP backends.
Related packages cover pricing data, sandboxed code execution, and gateway-based model routing with cost monitoring. Documentation and examples walk through extraction, durable runs, voice sessions, and production deployment concerns.
Key features
- Typed agents, tools, and outputs
- Swappable multi-provider models
- MCP server integration
- Realtime voice session support
- Durable execution on several engines
- Composable Harness capabilities
- Streaming UI event protocols
- OpenTelemetry and Logfire tracing
Use cases
- Structured data extraction agents
- Terminal or web coding assistants
- Voice-enabled support agents
- Long-running durable agent workflows
Does the same job as
Pydantic AI doesn't name these products itself, but its own description shows it does the same job.