Pydantic-AI
What it is: An agent framework from the team behind Pydantic. Treats every agent response as a typed Pydantic model, gives you function tools with full type validation, and supports dependency injection for clean separation between business logic and LLM glue.
Why it matters for data work
Data agents that return free-form text are a debugging nightmare. Pydantic-AI forces structured outputs by construction — your agent literally cannot return malformed JSON because the framework retries until the response validates against your schema.
Install & configure
pip install pydantic-ai
Define an Agent with a result type, register tools as decorated Python functions, and run. Streaming, tool-call validation, and structured retries are built in.
Example usage
Build a data quality agent: input a dataframe summary, return a typed QualityReport model with a list of issues, severity, and suggested SQL fixes. Because the response is a Pydantic model, you can pipe it directly into a downstream automation without parsing.
Author & links
Author: Pydantic (Samuel Colvin et al)
Repo: github.com/pydantic/pydantic-ai
License: MIT
Related skills
If you need explicit graph orchestration with checkpoints, look at LangGraph instead.
← Back to Agent Frameworks