pydantic-ai

Build typed AI agents from Python functions with Pydantic AI tools.

Updated Feb 20, 2026
One-click install
npx skills add https://github.com/jota-batuta/batuta-dots --skill pydantic-ai-jota-batuta
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pydantic-ai
Source: https://github.com/jota-batuta/batuta-dots/tree/main/BatutaClaude/skills/pydantic-ai
Command: npx skills add https://github.com/jota-batuta/batuta-dots --skill pydantic-ai-jota-batuta

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pydantic AI enables developers to quickly convert plain Python functions into structured, typed, LLM-callable tools, reducing boilerplate and enabling reliable runtime behavior.

Core Features & Use Cases

  • Typed agent definitions with RunContext[Deps] and @agent.tool decorators
  • Dynamic instructions via @agent.instructions
  • Google Gemini provider integration and AG-UI exposure for HTTP access
  • Easy dependency injection and stateful tools with a typed deps container
  • Reusable canonical agent patterns for multi-provider AI workflows

Quick Start

Define a typed dependencies dataclass, implement your tools with @agent.tool, create an Agent with a model, and call agent.run to start.

Frequently Asked Questions about pydantic-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build typed AI agents in Python with structured outputs?

Build typed AI agents by defining an Agent() with a model string, deps_type, and output_type, then using @agent.tool decorators to convert Python functions into structured, LLM-callable tools with typed dependencies.

How does RunContext dependency injection work for AI agents?

RunContext dependency injection provides typed dependencies to your AI agent tools at runtime. You define a typed deps container dataclass, and RunContext[Deps] passes it securely to tool functions, enabling stateful, structured workflows without boilerplate.

Can I use Google Gemini models with Python AI agents?

Yes, you can use Google Gemini models with Python AI agents. This approach supports Google Gemini provider integration, allowing you to specify the model string in your Agent() definition for cross-provider AI workflows.

What is the best way to expose an AI agent over HTTP for web apps?

Expose an AI agent over HTTP using AG-UI integration. This feature provides HTTP access to your typed AI agents, allowing web applications to interact with your structured Python tools and dependency-injected workflows.

How do I create dynamic instructions for an LLM agent?

Create dynamic instructions for an LLM agent using the @agent.instructions decorator. This allows you to generate instructions dynamically via RunContext, adapting the agent's behavior based on runtime dependencies and state.

Do I need Pydantic to define structured tools for LLMs?

You need Pydantic AI to define structured tools for LLMs. It requires an Agent() definition with typed dependencies and output types, ensuring safe, structured workflows by leveraging typed dependencies and tool decorators rather than untyped function calls.