Agent runtime

Pydantic AI

The agent framework from the Pydantic team — typed agents, structured outputs, tool calling, retries, and evals built around Pydantic validation, with first-class multi-provider and fallback support.

Operating principle

Production AI is a system: context, tools, permissions, traces, evals, and feedback loops around the model.

What it is

Pydantic AI is a Python agent framework: you define an agent with a model, instructions, tools, and a typed output schema, and the framework handles validation, model retries on schema failure, streaming, usage limits, and fallback across providers. Its companion pydantic-evals covers datasets, deterministic evaluators, and LLM-as-judge scoring; Pydantic Logfire instruments the runs.

Why it matters

It brings the type-safety discipline Python teams know from FastAPI to agents: structured output is the default, not an add-on, and the abstraction stays thin enough to read. For teams that found heavyweight frameworks opaque, it is the credible middle between raw SDK calls and a framework that owns your architecture.

How we use it

Pydantic AI is the default agent framework in our production stack. Every completion runs through one instrumented seam — budget check, model construction with fallback chains, the call, usage logging — and pydantic-evals drives the regression suites that gate prompt and model changes.

Related resources