PydanticAI logo

AI AGENTS

PydanticAI

by Pydantic

agentpydanticopen-source

Overview

Typed, extensible Python SDK for building production-grade AI agents.

Details

PydanticAI is Pydantic’s type-safe Python framework for building AI agents. It provides an agent loop with composable capabilities, validated and structured outputs, tools, typed dependencies, and observability. Its Agent API supports defining instructions, function tools or toolsets, output types, dependencies, and agent runs. Documented capabilities include web search, web fetching, image generation, and Model Context Protocol (MCP) support.

When to Use

Build Python AI agents that need typed dependencies and validated structured outputs. Create tool-enabled agent workflows with instructions tools output types and observability. Use a model-agnostic SDK with documented support for providers such as OpenAI Anthropic Gemini Bedrock Groq Hugging Face Mistral and OpenRouter.

Getting Started

  1. Use Python 3.10 or newer.
  2. Install the package with `pip install pydantic-ai`.
  3. Create an Agent with instructions
  4. tools
  5. dependencies
  6. and an output type as needed.
  7. Consult the official agent and model-provider documentation to configure a model and run the agent.

Key Features

  • Type-safe Python agent development
  • Validated structured outputs
  • Agent loop with composable capabilities
  • Function tools and toolsets
  • Typed dependency handling
  • Observability integrations
  • Model-agnostic provider support
  • Documented web search
  • web fetch
  • image generation
  • and MCP capabilities

Capabilities

  • AI agent development
  • Structured and validated outputs
  • Tool-enabled agent workflows
  • Typed dependencies
  • Web search and web fetching
  • Image generation
  • Model Context Protocol support

Last updated Sep 10, 2026