https://github.com/pydantic/pydantic-ai
How Python does AI. Agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end.
https://github.com/pydantic/pydantic-ai
agent-framework genai harness harness-engineering llm pydantic python
Last synced: 2 days ago
JSON representation
How Python does AI. Agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end.
- Host: GitHub
- URL: https://github.com/pydantic/pydantic-ai
- Owner: pydantic
- License: mit
- Created: 2024-06-21T15:55:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-11-23T03:16:31.000Z (4 days ago)
- Last Synced: 2026-11-23T03:16:34.853Z (4 days ago)
- Topics: agent-framework, genai, harness, harness-engineering, llm, pydantic, python
- Language: Python
- Homepage: https://pydantic.dev/pydantic-ai
- Size: 420 MB
- Stars: 21,340
- Watchers: 118
- Forks: 3,243
- Open Issues: 1,917
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Threat model: THREAT_MODEL.md
- Citation: CITATION.cff
- Codeowners: .github/CODEOWNERS
- Agents: AGENTS.md
- Claude: CLAUDE.md
Awesome Lists containing this project
- awesome-a2a-agents - pydantic/pydantic-ai - GenAI Agent Framework, the Pydantic way (Agent Categories / <a name="Pydantic AI"></a>Pydantic AI)
- awesome-ai-tools - PydanticAI -  — 'FastAPI-feeling,' fully type-safe, model-agnostic. v2.0.0 stable (Jun 23): harness-first design with capabilities as a core primitive — a composable unit bundling tools, hooks, instructions, and model settings. Built-in OpenTelemetry/Logfire observability, AG-UI protocol support. · `MIT` · Python · 19.3k★ *GitHub API, 2026-08-16* (🧩 Agent Frameworks & SDKs / Orchestration layer)
- Awesome-LLM-VLM-Foundation-Models - Pydantic AI - A Python agent framework focused on typed dependencies, structured outputs, validation, observability and production-grade generative AI workflows. (🤖 Agent Frameworks, Protocols & Interoperability)
- awesome-ai-agents - Pydantic AI - A new experimental framework that integrates Pydantic’s structured validation with AI agent workflows. Pydantic AI focuses on enforcing strong type safety, schema validation, and structured output generation for AI-driven applications. (🛠 Frameworks)
- awesome-python - pydantic/pydantic-ai - How Python does AI. Agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end. (Machine Learning and AI / LLM and Inference)
- awesome-ag-ui - pydantic-ai - by [pydantic](https://github.com/pydantic). Eight capabilities. Predictive state updates sit commented out in the dojo config, so treat that one as off. 19,524★, MIT. (The catalog / Connect your agent framework to a front end)
- awesome-llm-knowledge-bases - Pydantic AI - Agent framework built on Pydantic for type-safe, structured AI application development. (LLM Agents & Frameworks)
- awesome-generative-ai - pydantic/pydantic-ai - Agent Framework / shim to use Pydantic with LLMs (Large Language Models (LLMs) / Autonomous LLM Agents)
- awesome-agent-services - PydanticAI - 15K (🚀 Orchestration Frameworks / Graph / pipeline frameworks)
- awesome-jev - Pydantic AI -   - Python ecosystem: official Pydantic AI agent framework shipping first-class `TypeSafeModel` integration to map Pydantic schema fields into typed Jev System One questions with confidence scoring. (Full list / Infra / SDKs / Integrations)
- awesome-mac-mini-homeserver - Pydantic AI - Type-safe Python agent framework from the Pydantic team.    (Agentic AI / Agentic frameworks)
- awesome-mistral - PydanticAI - ⭐ 21k+ – Type-safe AI agent framework. (Agents & Orchestration / Agent Frameworks)
- awesome-jev-tools - pydantic-ai - SDK Integrations: An optional TypeSafe provider and Jev model integration for Pydantic AI. (Full list / Infra / SDKs / Integrations)
- awesome-agentic-engineering-resources - **Pydantic AI** - safe agent framework. (🏗️ Reference Implementations & Case Studies / T11 / T12 · Orchestration & Multi-Agent)
- awesome-jev-projects - pydantic-ai - An optional TypeSafe provider and Jev model integration for Pydantic AI. (SDK Integrations)
- awesome-private-ai - PydanticAI - Python agent framework by the Pydantic team, model-agnostic with Ollama support for local deployment. (Agents & Orchestration)
- awesome-openclaw-money-maker - Pydantic-AI - GenAI Agent Framework with validation layer for OpenAI, Anthropic, Google SDKs. (AI Agent Frameworks / General Agent Frameworks)
- awesome-jev - **pydantic-ai** - How Python does AI. Agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end. · `Python` (Agents & automation)
- trackawesomelist - pydantic/pydantic-ai (⭐1.1k)
- awesome-cli-agentic-tools - Pydantic AI - safe agent API built on Pydantic. | `pip install pydantic-ai` | Python | (Agent Frameworks / Community)
- awesome-opensource-ai - PydanticAI - Type-safe AI agent framework from the creators of Pydantic. Model-agnostic with 20+ providers, built-in observability via Logfire, MCP/A2A protocol support, and YAML/JSON agent definitions. MIT licensed.  (4. Agentic AI & Multi-Agent Systems)
- awesome-LLM-resources - PydanticAI - Agent Framework / shim to use Pydantic with LLMs. (智能体 Agents)
- awesome-ai-for-economists - Pydantic AI - Type-safe Python agent framework with validated structured outputs across all major model providers.  (AI Agents for Research / AI Agent Frameworks)
- awesome-ai-devtools - PydanticAI - Pydantic-based framework for building typed LLM apps and agents with validation, tools, and structured outputs. (Browse The Shelves / Local LLM developer tools)
- awesome-harness-engineering - PydanticAI - safe agent framework where tool definitions, parameters, and return values are Pydantic models. Shifts "agent output doesn't match expected structure" from a runtime bug to a type-check failure; its `RunContext` dependency injection pattern is the reference design for passing session-scoped objects through the harness without global state.  (Design Primitives / Task Runners & Orchestration)
- awesome-rust-ai-libraries - Pydantic AI - Production-grade agent framework built on Pydantic featuring type-safe development, multi-model support, structured responses, dependency injection, and Logfire integration. ([Read more](/details/pydantic-ai.md)) `Type Safe` `Pydantic` `Structured Responses` (Agentic Systems)
- awesome-llm-tools - Pydantic AI - Type-safe agent framework by Pydantic team (2. Libraries & Frameworks / Python)
- awesome-ccamel - pydantic/pydantic-ai - How Python does AI. Agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end. (Python)
- awesome-agents - Pydantic AI - Production-grade type-safe agent framework from the creators of Pydantic. (Frameworks)
- awesome-local-llm - pydantic-ai - a Python agent framework designed to help you quickly, confidently, and painlessly build production grade applications and workflows with Generative AI (Tools / Agent Frameworks)
- awesome-trevor - Pydantic AI - GenAI Agent Framework, the Pydantic way (Uncategorized / Uncategorized)
- awesome-production-machine-learning - PydanticAI - ai.svg?style=social) - PydanticAI is a Python agent framework designed to make it less painful to build production grade applications with Generative AI. (Agentic Framework)
- AiTreasureBox - pydantic/pydantic-ai - 11-03_13164_0](https://img.shields.io/github/stars/pydantic/pydantic-ai.svg)|Agent Framework / shim to use Pydantic with LLMs| (Repos)
- awesome-safety-critical-ai - pydantic/pydantic-ai - agent framework / shim to use Pydantic with LLMs (🛠️ Tools / Bleeding Edge ⚗️)
- awesome-mcp-zh - pydantic/pydantic-ai/mcp-run-python
- awesome-jev - Pydantic AI - TypeSafe model provider that derives Jev questions from Pydantic output types and supports typed routing and fallback workflows. (Framework integrations)
- metorial-index - PydanticAI - A type-safe, model-agnostic framework that integrates with Pydantic for structured responses and real-time debugging in generative AI applications. Provides tools and dependency injection to enhance AI-driven project development. (APIs and HTTP Requests)
- awesome-ai-coding - pydantic-ai - → AI Agent Frameworks (📋 Changelog / 2026-07-19 — Weekly Update)
- awesome-production-agentic-systems - PydanticAI - ai.svg?cacheSeconds=86400) - PydanticAI is a Python agent framework designed to make it less painful to build production grade applications with Generative AI. (Agentic Frameworks)
- awesome-llm-tools - Pydantic AI
- awesome_ai_agents - Pydantic-AI - Agent framework / shim to use Pydantic with LLMs, useful for ensuring LLM inputs/outputs have type safety [github](https://github.com/pydantic/pydantic-ai) | [docs](https://ai.pydantic.dev/) (Building / Testing)
- awesome-evals - pydantic-evals - <https://github.com/pydantic/pydantic-ai> (`ai.pydantic.dev/evals`) — 🆕 type-safe Datasets/Cases/Evaluators with OTel tracing, from the Pydantic AI team. (5 · Evaluation infrastructure (the eval stack: datasets, scorers, online/offline, tracing, CI) / 5a · Eval frameworks & harnesses (code-first test-runners))
- awesome-pydantic-ai - Pydantic AI Repository - Official GitHub repository. Agent framework with model-agnostic architecture, type safety, dependency injection, tool integration, and structured outputs. (Official Resources)
- awesome-nlp-llm-spanish-espa-ol - Pydantic AI
- awesome-claude-multi-agent - Pydantic AI - Type-safe Python agent framework with delegation patterns, graph-based multi-agent flows, and Claude support. (Orchestration Frameworks)
- awesome-vibe-coding - Pydantic AI - Python (AI Frameworks & SDKs / Agent Frameworks)
- awesome-harness-engineering - pydantic/pydantic-ai - **21,256 星**用类型和 schema 把工具契约、结构化输出和上下文边界显式化。 (3)参考实现与开源工具(GitHub) / 编码与智能体 Harness)
- awesome-llm-agent - pydantic-ai
- awesome-agi-agents - Pydantic AI - ai)|由 Pydantic 团队打造的 Agent 框架,强调类型安全与结构化输出,将 Pydantic 的工程体验带入 GenAI 开发。| (2024-2026 重要项目)
- awesome-ai-agent-stack - pydantic/pydantic-ai - Type-safe agent framework from the Pydantic team; great for structured outputs. (Agent Frameworks & Orchestration)
- awesome-ai-agents-2026 - PydanticAI - `🌱` `[Python]` `[Pydantic]` - Type-safe agent framework from the Pydantic team with a FastAPI-style developer experience. (Orchestration Frameworks)
- awesome-prompts - PydanticAI - Official Pydantic agent runtime — typed tools, structured outputs, evals, production-ready (V1 stable)  (Tools & Libraries)
- awesome-python - pydantic-ai - A Python agent framework for building generative AI applications with structured schemas. (Machine Learning)
- awesome-ai-agents-2026 - Pydantic AI - Type-safe. Clean Pythonic API. Production-ready. (🧱 Agent Frameworks / General Purpose)
- awesome-ai-agents-2026 - Pydantic AI - <br>Best fit: Type-safe agents and validated structured output (Agent frameworks)
- github-ultimate-repos - pydantic/pydantic-ai - | ⭐ 20,851★ | 🍴 3,020 | 💻 `Python`🔗 <https://github.com/pydantic/pydantic-ai>📝 How Python does AI. Agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end.⚙️ `BPE/SentencePiece tokenization -> RoPE positional rotation -> FlashAttention-2 KV-cache -> fused quantized GEMM execution -> Softmax top-p sampling.` (📜 Master Categorized Repository Directory (100% Clickable Links) / [02] ARTIFICIAL INTELLIGENCE, LARGE LANGUAGE MODELS, FOUNDATION MODELS & QUANTIZATION)
- fucking-awesome-python - pydantic-ai - A Python agent framework for building generative AI applications with structured schemas. (Projects / AI and Agents)
- awesome-ai-agents-2026 - Pydantic AI - 🆕 ⚡ **v2.21.0(2026-07-30)**。Pydantic チームによるエージェントフレームワーク。FastAPI 流の開発体験と本物の型安全性を LLM アプリに持ち込む —— 構造化出力を Pydantic モデルで検証し、依存性注入・ストリーミング・モデル非依存のプロバイダに対応。自由形式のプロンプト連結ではなく静的型付けと検証済みツール I/O が欲しい場合の第一候補。  (🏗️ エージェントフレームワーク / その他の標準)
- awesome-selfhosted-ai - Pydantic AI - Type-safe Python agent framework with model-agnostic tool calling and structured outputs. (Agents and Automation)
- Awesome-Prompt-Engineering - GitHub
- awesome-agent-cortex - PydanticAI - Type-safe agent framework built around Pydantic. (Agent Frameworks)
- awesome-agent-collaborate-tools - PydanticAI - Production-grade agent framework from the Pydantic team. Type-safe tool calling, dependency injection, and structured output. Supports multi-agent orchestration via agent handoff primitives. (Multi-Agent Orchestration)
- awesome-ai-pulse-georgia - Pydantic AI - 21K (🧬 AI აგენტების ფრეიმვორკები)
- awesome-agi-aci-asi - PydanticAI - Agent framework with type safety, structured outputs via Pydantic, and dependency injection for testing. Async-first. (LLM Application Frameworks / Core Orchestration Frameworks)
- awesome-ai-agents - pydantic/pydantic-ai - (21094 Python) - PydanticAI is a Python agent framework that simplifies building production-grade Generative AI applications by providing type-safe, structured, and model-agnostic integration with multiple LLMs, along with features like dependency injection and real-time debugging. (Agent Integration & Deployment Tools / AI Application Development)
- awesome-llm - pydantic/pydantic-ai - How Python does AI. Agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end. (AI Agents / Agent Frameworks and Runtimes)
- awesome-automation-for-knowledge-work - pydantic/pydantic-ai - [](https://github.com/pydantic/pydantic-ai) - Agent and LLM outputs with typed schemas. (Tool Families / Typed-output and structuring tools)
- awesome-os-llm - Pydantic AI - Typed agent library from the Pydantic team. Useful when the model is local and you still want structured tool calls. (Use cases / Agents)
- awesome-ai-coding-agent-tools - Pydantic AI - Type-safe Python agent framework with automatic output validation. (Agent SDKs & Frameworks / Lightweight & Typed)
- awesome-agent-harness - GitHub - 17877-f4b400?style=flat-square)](https://github.com/pydantic/pydantic-ai) | python, typing, schema | Type-safe Python framework for agents with strong schema contracts and tooling. | (Catalog / Harness Architecture & Orchestration)
- awesome-agent-orchestration - PydanticAI - Type-safe agent framework using Pydantic models (Core Frameworks / Type-Safe & Modern Frameworks)
- Awesome-Graph-Engineering - [Paper
- Awesome-LLMOps - PydanticAI - ai.svg?style=flat&color=green)   (Orchestration / Agent Framework)
- Awesome-Agentic-Engineering - Pydantic AI - safe, Pydantic-native; schema-first LLM interactions with dependency injection. | `[official]` | (⚙️ Orchestration Frameworks / Frameworks Landscape)
- awesome-x-ops - Pydantic AI - safe Python agent framework with model-agnostic support, structured outputs, evals, MCP integration, and durable execution. (Agentic Workflow)
- awesome-ai-security - https://github.com/pydantic/pydantic-ai - \[Pydantic AI - Agent Framework\] (AI Agents & Frameworks / Agent Frameworks)
- awesome-ai-200 - pydantic/pydantic-ai
- awesome-ai-agents - PydanticAI - GenAI agent framework, the Pydantic way. Type-safe and production-ready. (Frameworks & Libraries / Single Agent)
- awesome-llm-extraction - PydanticAI - Agent framework from the Pydantic team where every result is a validated Pydantic object. (Structured output / Libraries)
- awesome-llm-agents - Pydantic AI - Type-safe agents on Pydantic with structured output (Core Frameworks)
- awesome-agent-frameworks - Pydantic AI -  - Production-grade Python agent framework from the Pydantic team leveraging type-safe structured outputs. (Agent SDK / framework)
- awesome-mcp-servers - Pydantic AI - Typed Python agent framework with MCP client and server support (Frameworks & Libraries)
- awesome-agent-evolution - PydanticAI - Type-safe AI agent framework built on Pydantic with structured outputs and dependency injection. by [\@pydantic](https://github.com/pydantic) (21,134 stars) (Agent Development Platforms)
- awesome-agentic - PydanticAI
- awesome-llm-prod - PydanticAI - Type-safe, model-agnostic agent framework with validated outputs, from the Pydantic team (Agents and Orchestration)
README
GenAI Agent Framework, the Pydantic way
---
**Documentation**: [ai.pydantic.dev](https://ai.pydantic.dev/)
---
### Pydantic AI is a Python agent framework designed to help you quickly, confidently, and painlessly build production grade applications and workflows with Generative AI.
FastAPI revolutionized web development by offering an innovative and ergonomic design, built on the foundation of [Pydantic Validation](https://docs.pydantic.dev) and modern Python features like type hints.
Yet despite virtually every Python agent framework and LLM library using Pydantic Validation, when we began to use LLMs in [Pydantic Logfire](https://pydantic.dev/logfire), we couldn't find anything that gave us the same feeling.
We built Pydantic AI with one simple aim: to bring that FastAPI feeling to GenAI app and agent development.
## Why use Pydantic AI
1. **Built by the Pydantic Team**:
[Pydantic Validation](https://docs.pydantic.dev/latest/) is the validation layer of the OpenAI SDK, the Google ADK, the Anthropic SDK, LangChain, LlamaIndex, AutoGPT, Transformers, CrewAI, Instructor and many more. _Why use the derivative when you can go straight to the source?_ :smiley:
2. **Model-agnostic**:
Supports virtually every [model](https://ai.pydantic.dev/models/overview) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Vertex AI, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud, Alibaba Cloud, SambaNova, and Outlines. If your favorite model or provider is not listed, you can easily implement a [custom model](https://ai.pydantic.dev/models/overview#custom-models).
3. **Seamless Observability**:
Tightly [integrates](https://ai.pydantic.dev/logfire) with [Pydantic Logfire](https://pydantic.dev/logfire), our general-purpose OpenTelemetry observability platform, for real-time debugging, evals-based performance monitoring, and behavior, tracing, and cost tracking. If you already have an observability platform that supports OTel, you can [use that too](https://ai.pydantic.dev/logfire#alternative-observability-backends).
4. **Fully Type-safe**:
Designed to give your IDE or AI coding agent as much context as possible for auto-completion and [type checking](https://ai.pydantic.dev/agents#static-type-checking), moving entire classes of errors from runtime to write-time for a bit of that Rust "if it compiles, it works" feel.
5. **Powerful Evals**:
Enables you to systematically test and [evaluate](https://ai.pydantic.dev/evals) the performance and accuracy of the agentic systems you build, and monitor the performance over time in Pydantic Logfire.
6. **MCP, A2A, and UI**:
Integrates the [Model Context Protocol](https://ai.pydantic.dev/mcp/overview), [Agent2Agent](https://ai.pydantic.dev/a2a), and various [UI event stream](https://ai.pydantic.dev/ui/overview) standards to give your agent access to external tools and data, let it interoperate with other agents, and build interactive applications with streaming event-based communication.
7. **Human-in-the-Loop Tool Approval**:
Easily lets you flag that certain tool calls [require approval](https://ai.pydantic.dev/deferred-tools#human-in-the-loop-tool-approval) before they can proceed, possibly depending on tool call arguments, conversation history, or user preferences.
8. **Durable Execution**:
Enables you to build [durable agents](https://ai.pydantic.dev/durable_execution/overview/) that can preserve their progress across transient API failures and application errors or restarts, and handle long-running, asynchronous, and human-in-the-loop workflows with production-grade reliability.
9. **Streamed Outputs**:
Provides the ability to [stream](https://ai.pydantic.dev/output#streamed-results) structured output continuously, with immediate validation, ensuring real time access to generated data.
10. **Graph Support**:
Provides a powerful way to define [graphs](https://ai.pydantic.dev/graph) using type hints, for use in complex applications where standard control flow can degrade to spaghetti code.
Realistically though, no list is going to be as convincing as [giving it a try](#next-steps) and seeing how it makes you feel!
## Hello World Example
Here's a minimal example of Pydantic AI:
```python
from pydantic_ai import Agent
# Define a very simple agent including the model to use, you can also set the model when running the agent.
agent = Agent(
'anthropic:claude-sonnet-4-6',
# Register static instructions using a keyword argument to the agent.
# For more complex dynamically-generated instructions, see the example below.
instructions='Be concise, reply with one sentence.',
)
# Run the agent synchronously, conducting a conversation with the LLM.
result = agent.run_sync('Where does "hello world" come from?')
print(result.output)
"""
The first known use of "hello, world" was in a 1974 textbook about the C programming language.
"""
```
_(This example is complete, it can be run "as is", assuming you've [installed the `pydantic_ai` package](https://ai.pydantic.dev/install))_
The exchange will be very short: Pydantic AI will send the instructions and the user prompt to the LLM, and the model will return a text response.
Not very interesting yet, but we can easily add [tools](https://ai.pydantic.dev/tools), [dynamic instructions](https://ai.pydantic.dev/agents#instructions), and [structured outputs](https://ai.pydantic.dev/output) to build more powerful agents.
## Tools & Dependency Injection Example
Here is a concise example using Pydantic AI to build a support agent for a bank:
**(Better documented example [in the docs](https://ai.pydantic.dev/#tools-dependency-injection-example))**
```python
from dataclasses import dataclass
from pydantic import BaseModel, Field
from pydantic_ai import Agent, RunContext
from bank_database import DatabaseConn
# SupportDependencies is used to pass data, connections, and logic into the model that will be needed when running
# instructions and tool functions. Dependency injection provides a type-safe way to customise the behavior of your agents.
@dataclass
class SupportDependencies:
customer_id: int
db: DatabaseConn
# This Pydantic model defines the structure of the output returned by the agent.
class SupportOutput(BaseModel):
support_advice: str = Field(description='Advice returned to the customer')
block_card: bool = Field(description="Whether to block the customer's card")
risk: int = Field(description='Risk level of query', ge=0, le=10)
# This agent will act as first-tier support in a bank.
# Agents are generic in the type of dependencies they accept and the type of output they return.
# In this case, the support agent has type `Agent[SupportDependencies, SupportOutput]`.
support_agent = Agent(
'openai:gpt-5.2',
deps_type=SupportDependencies,
# The response from the agent will, be guaranteed to be a SupportOutput,
# if validation fails the agent is prompted to try again.
output_type=SupportOutput,
instructions=(
'You are a support agent in our bank, give the '
'customer support and judge the risk level of their query.'
),
)
# Dynamic instructions can make use of dependency injection.
# Dependencies are carried via the `RunContext` argument, which is parameterized with the `deps_type` from above.
# If the type annotation here is wrong, static type checkers will catch it.
@support_agent.instructions
async def add_customer_name(ctx: RunContext[SupportDependencies]) -> str:
customer_name = await ctx.deps.db.customer_name(id=ctx.deps.customer_id)
return f"The customer's name is {customer_name!r}"
# The `tool` decorator let you register functions which the LLM may call while responding to a user.
# Again, dependencies are carried via `RunContext`, any other arguments become the tool schema passed to the LLM.
# Pydantic is used to validate these arguments, and errors are passed back to the LLM so it can retry.
@support_agent.tool
async def customer_balance(
ctx: RunContext[SupportDependencies], include_pending: bool
) -> float:
"""Returns the customer's current account balance."""
# The docstring of a tool is also passed to the LLM as the description of the tool.
# Parameter descriptions are extracted from the docstring and added to the parameter schema sent to the LLM.
balance = await ctx.deps.db.customer_balance(
id=ctx.deps.customer_id,
include_pending=include_pending,
)
return balance
... # In a real use case, you'd add more tools and a longer system prompt
async def main():
deps = SupportDependencies(customer_id=123, db=DatabaseConn())
# Run the agent asynchronously, conducting a conversation with the LLM until a final response is reached.
# Even in this fairly simple case, the agent will exchange multiple messages with the LLM as tools are called to retrieve an output.
result = await support_agent.run('What is my balance?', deps=deps)
# The `result.output` will be validated with Pydantic to guarantee it is a `SupportOutput`. Since the agent is generic,
# it'll also be typed as a `SupportOutput` to aid with static type checking.
print(result.output)
"""
support_advice='Hello John, your current account balance, including pending transactions, is $123.45.' block_card=False risk=1
"""
result = await support_agent.run('I just lost my card!', deps=deps)
print(result.output)
"""
support_advice="I'm sorry to hear that, John. We are temporarily blocking your card to prevent unauthorized transactions." block_card=True risk=8
"""
```
## Next Steps
To try Pydantic AI for yourself, [install it](https://ai.pydantic.dev/install) and follow the instructions [in the examples](https://ai.pydantic.dev/examples/setup).
Read the [docs](https://ai.pydantic.dev/agents/) to learn more about building applications with Pydantic AI.
Read the [API Reference](https://ai.pydantic.dev/api/agent/) to understand Pydantic AI's interface.
Join [Slack](https://logfire.pydantic.dev/docs/join-slack/) or file an issue on [GitHub](https://github.com/pydantic/pydantic-ai/issues) if you have any questions.