Dev Tools

Pydantic AI Is The LangChain Killer Nobody Saw Coming

All articles
🐍🪄🔧

From the people who type-checked your dataclasses.

Behold: the Pydantic team built an agent framework and it's exactly as obnoxiously well-typed as you'd expect.

The Setup

PydanticAI lands with the same energy that made Pydantic v2 the default validator in every Python project on Earth — small surface, strict types, no clever inheritance trees. Install it, point it at a model, define an agent.

pip install pydantic-ai
export ANTHROPIC_API_KEY=sk-ant-...

The Money Pattern

Agents are typed by their result and dependencies, tools are just decorated functions, and run_sync works in a notebook without ceremony. Your IDE knows the return type. Your tests know the return type. Production knows the return type.

from pydantic import BaseModel
from pydantic_ai import Agent, RunContext

class ClaimVerdict(BaseModel):
    severity: str
    payout_aud: float
    notes: str

agent = Agent(
    "anthropic:claude-sonnet-4-5",
    result_type=ClaimVerdict,
    system_prompt="You triage Queensland hail claims. Be conservative.",
)

@agent.tool
def lookup_postcode(ctx: RunContext[None], postcode: str) -> str:
    # In real life: hit Pipedrive or BigQuery here.
    return "Gold Coast — high hail frequency"

result = agent.run_sync("Claim 4821 in 4217: cracked skylights, dented roof.")
print(result.data.severity, result.data.payout_aud)

The Catch

Ecosystem is younger. Fewer Stack Overflow answers, fewer YouTubers screaming over a thumbnail with a red arrow. The plugin surface is small on purpose, which is the right call long-term but means you'll occasionally write the integration yourself.

The Verdict

Pydantic earned trust by being right about types. They're going to earn it again by being right about agents. If you start a Python LLM project today and don't at least look at PydanticAI, you're being weird.

Let us make some quick suggestions?
Please provide your full name.
Please provide your phone number.
Please provide a valid phone number.
Please provide your email address.
Please provide a valid email address.
Please provide your brand name or website.
Please provide your brand name or website.