← Back to Payloads
Open Source2026-06-19

Pydantic AI Is the FastAPI Moment for GenAI and Most Agent Frameworks Are Now Derivative Work

The Pydantic team shipped an agent framework in 2024. By mid-2026 it sits at 17,000+ GitHub stars and 3.8M weekly PyPI downloads — second only to LangChain, the framework whose validation layer Pydantic already writes. Pydantic AI is not a better LangChain. It is the FastAPI-style answer to GenAI: type-safe end-to-end, dependency-injected, model-agnostic across 25+ providers, with durable execution, MCP, A2A, graphs, and streaming structured outputs. The team that wrote the validation library every other framework uses wrote their own agent framework. The implications are larger than the framework.
Quick Access
Install command
$ mrt install pydantic-ai
Browse related skills
Pydantic AI Is the FastAPI Moment for GenAI and Most Agent Frameworks Are Now Derivative Work

Pydantic AI Is the FastAPI Moment for GenAI and Most Agent Frameworks Are Now Derivative Work

FastAPI did not win Python web development by having more features than Flask or Django. It won by treating Pydantic Validation and modern type hints as the foundation of the developer experience. You stopped writing tests for the boring layers because the types guaranteed them.

The same team just shipped the same idea for LLM agents. It is called Pydantic AI, and the reason it matters is not the feature list. It is who wrote it.

Hey guys, Mr. Technology here.

The Team That Already Won

pydantic is the validation layer of the OpenAI SDK, the Anthropic SDK, the Google ADK, LangChain, LlamaIndex, AutoGPT, Transformers, CrewAI, Instructor, and roughly every other serious Python LLM library. Every time a JSON schema is generated from a Python class, every time a structured-output client validates a parsed message — that is the Pydantic team. They are the substrate.

When that team built their own agent framework, they had the same advantage FastAPI had over Flask in 2018: they already own the validation primitive the rest of the stack depends on. As of June 2026 the project sits at 17,000+ GitHub stars and ~3.8M weekly PyPI downloads (second-highest of any agent framework), Apache 2.0, maintained by Samuel Colvin and the crew that ships pydantic-core.

The Core Idea

Most agent frameworks model an agent as a string of prompts with optional tools. Pydantic AI models an agent as typed inputs, typed outputs, typed tool arguments, typed dependencies, and a typed result. Every dependency that can be injected is injected. The static type checker becomes your first test suite.

python
from pydantic_ai import Agent, RunContext
from pydantic import BaseModel
class SupportResult(BaseModel):
    customer_name: str
    action: Literal['reset_password', 'refund', 'escalate']
    notes: str
class SupportDeps(BaseModel):
    customer_id: int
    db: Database
agent = Agent(
    'anthropic:claude-sonnet-4-6',
    deps_type=SupportDeps,
    output_type=SupportResult,
    instructions='You are a careful bank support agent.',
)
@agent.tool
async def customer_name(ctx: RunContext[SupportDeps]) -> str:
    return await ctx.deps.db.customer_name(id=ctx.deps.customer_id)
result = agent.run_sync('My account is locked', deps=deps)
# result.output is a SupportResult, not a string you have to parse

That result.output is the entire pitch. It is a Pydantic model. It is validated. It has .model_dump_json() and .action. It survives mypy --strict. The framework returns the object the type signature promised — not a string and a request to please use Instructor to parse it. This is the FastAPI feel: every layer below the LLM is a typed contract, and the LLM sits inside it.

What It Actually Ships

Pydantic AI is not a thin orchestrator. It is the most fully-featured open-source agent framework shipping in 2026:

  • Model-agnostic across 25+ providers — OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, Bedrock, Vertex, Ollama, LiteLLM, Groq, OpenRouter, Together, Fireworks, Cerebras, Hugging Face. The Model protocol implements the rest in ~30 lines.
  • Capabilities — composable units bundling tools, hooks, instructions, and model settings. Built-in Thinking(), provider-adaptive WebSearch(), and MCP().
  • Graphs for complex control flow. State-graph primitives typed with Pydantic state models. The type-safe answer to LangGraph.
  • Durable execution via Temporal and DBOS. Long-running agents survive API failures, restarts, and human-in-the-loop pauses; state and tool calls are checkpointed.
  • Plus streaming structured output, MCP and A2A interop, human-in-the-loop tool approval, a YAML/JSON agent spec, and Evals + Logfire/OpenTelemetry.

It is a complete platform under Apache 2.0, maintained by the team that wrote the validation library everyone else depends on.

What It Beats, What It Loses To

Versus LangChain. LangChain has the integrations catalog and LangSmith. Pydantic AI has type safety end-to-end and the validation primitive baked in. For new production code the advantage is decisive — you stop writing the parser layer, the schema-validation layer, and the tool-arg tests. The 3.8M weekly PyPI downloads are teams quietly switching because the developer experience is better.

Versus LangGraph. LangGraph pioneered the state-graph pattern. Pydantic AI has a graph module with the same primitive plus full Pydantic state types and the rest of the platform attached. LangGraph is a graph library. Pydantic AI is an agent framework that happens to have graphs.

Versus CrewAI, AutoGen, and the vendor SDKs. Role-based and vendor-locked patterns respectively; both fine for what they ship. Pydantic AI is type-first and provider-agnostic. The day you need to switch from OpenAI to Anthropic, or run the same agent against a local Ollama model, is the day the abstraction pays for itself.

Where Pydantic AI loses. Pure no-code workflow DSLs, and the graph module is younger than LangGraph's. If your team ships a hardcoded single-provider stack and never plans to change, the type-safety advantage is smaller.

The Take

Pydantic AI is the FastAPI moment for GenAI. Not because it has more features. Because the team that wrote the validation library every other framework uses wrote the framework. The type system is the primitive. The same shift that made Flask look slow in 2019 is happening to the agent-framework category in 2026.

The teams that recognize this now will spend 2026 building production agents with full type safety, switching providers without rewrites, and shipping durable execution graphs that survive their first outage. The teams that do not will still be writing result.choices[0].message.content parsers in 2027 wondering why the agent broke.

You already depend on Pydantic. Now you can build on it directly.

Mr. Technology

Sources

Related Dispatches