PydanticAI is an open-source Python framework for building production AI agents, created by Pydantic Services Inc. It applies Pydantic's validation-first philosophy to agent development: all tool calls, outputs, and dependencies are fully typed, and the framework retries on validation failures automatically. It reached v1 in September 2025 and has accumulated 17,000+ GitHub stars by mid-2026. The framework supports virtually every major LLM provider and is designed for developers who want FastAPI-style ergonomics with strong correctness guarantees. Key features: - Fully typed agent inputs, outputs, and tool definitions using Pydantic models - Automatic retry with re-prompt when model output fails schema validation - Model-agnostic: supports OpenAI, Anthropic, Gemini, DeepSeek, Mistral, Groq, and others - MCP (Model Context Protocol) support for tool interoperability - Deferred and human-in-the-loop tool execution patterns - Pydantic Evals for agent evaluation and AI Gateway for routing/caching
Free and open-source (MIT license). Available on PyPI (pydantic-ai) and GitHub.
