site_name: Pydantic AI
site_description: GenAI Agent Framework, the Pydantic way
strict: true
site_url: https://ai.pydantic.dev
repo_name: pydantic/pydantic-ai
repo_url: https://github.com/pydantic/pydantic-ai
edit_uri: edit/main/docs/
copyright: © Pydantic Services Inc. 2024 to present
nav:
- index.md
- install.md
- help.md
- troubleshooting.md
- Pydantic AI Gateway: gateway.md
- Documentation:
- Core Concepts:
- agents.md
- dependencies.md
- tools.md
- output.md
- message-history.md
- direct.md
- Models & Providers:
- Overview: models/overview.md
- models/openai.md
- models/anthropic.md
- models/google.md
- models/bedrock.md
- models/cerebras.md
- models/cohere.md
- models/groq.md
- models/huggingface.md
- models/mistral.md
- models/openrouter.md
- models/outlines.md
- Tools & Toolsets:
- tools.md
- tools-advanced.md
- toolsets.md
- deferred-tools.md
- builtin-tools.md
- common-tools.md
- third-party-tools.md
- Advanced Features:
- input.md
- thinking.md
- retries.md
- MCP:
- Overview: mcp/overview.md
- mcp/client.md
- mcp/fastmcp-client.md
- mcp/server.md
- Multi-Agent Patterns: multi-agent-applications.md
- Web Chat UI: web.md
- Embeddings: embeddings.md
- Testing: testing.md
- Pydantic Evals:
- Overview: evals.md
- Getting Started:
- Quick Start: evals/quick-start.md
- Core Concepts: evals/core-concepts.md
- Evaluators:
- Overview: evals/evaluators/overview.md
- Built-in Evaluators: evals/evaluators/built-in.md
- LLM Judge: evals/evaluators/llm-judge.md
- Custom Evaluators: evals/evaluators/custom.md
- Span-Based: evals/evaluators/span-based.md
- How-To Guides:
- Logfire Integration: evals/how-to/logfire-integration.md
- Dataset Management: evals/how-to/dataset-management.md
- Dataset Serialization: evals/how-to/dataset-serialization.md
- Concurrency & Performance: evals/how-to/concurrency.md
- Retry Strategies: evals/how-to/retry-strategies.md
- Metrics & Attributes: evals/how-to/metrics-attributes.md
- Examples:
- Simple Validation: evals/examples/simple-validation.md
- Pydantic Graph:
- Overview: graph.md
- Beta API:
- Getting Started: graph/beta/index.md
- Steps: graph/beta/steps.md
- Joins & Reducers: graph/beta/joins.md
- Decisions: graph/beta/decisions.md
- Parallel Execution: graph/beta/parallel.md
- Integrations:
- Debugging & Monitoring with Pydantic Logfire: logfire.md
- Durable Execution:
- Overview: durable_execution/overview.md
- Temporal: durable_execution/temporal.md
- DBOS: durable_execution/dbos.md
- Prefect: durable_execution/prefect.md
- UI Event Streams:
- Overview: ui/overview.md
- AG-UI: ui/ag-ui.md
- Vercel AI: ui/vercel-ai.md
- Agent2Agent (A2A): a2a.md
- Related Packages:
- Clai: cli.md
- Examples:
- Setup: examples/setup.md
- Getting Started:
- examples/pydantic-model.md
- examples/weather-agent.md
- Conversational Agents:
- examples/chat-app.md
- examples/bank-support.md
- Data & Analytics:
- examples/sql-gen.md
- examples/data-analyst.md
- examples/rag.md
- Streaming:
- examples/stream-markdown.md
- examples/stream-whales.md
- Complex Workflows:
- examples/flight-booking.md
- examples/question-graph.md
- Business Applications:
- examples/slack-lead-qualifier.md
- UI Examples:
- examples/ag-ui.md
- API Reference:
- pydantic_ai:
- api/ag_ui.md
- api/agent.md
- api/builtin_tools.md
- api/common_tools.md
- api/direct.md
- api/durable_exec.md
- api/embeddings.md
- api/exceptions.md
- api/ext.md
- api/format_prompt.md
- api/mcp.md
- api/messages.md
- api/models/anthropic.md
- api/models/base.md
- api/models/bedrock.md
- api/models/cerebras.md
- api/models/cohere.md
- api/models/fallback.md
- api/models/function.md
- api/models/google.md
- api/models/groq.md
- api/models/huggingface.md
- api/models/instrumented.md
- api/models/mcp-sampling.md
- api/models/mistral.md
- api/models/openai.md
- api/models/openrouter.md
- api/models/outlines.md
- api/models/test.md
- api/models/wrapper.md
- api/output.md
- api/profiles.md
- api/providers.md
- api/result.md
- api/retries.md
- api/run.md
- api/settings.md
- api/tools.md
- api/toolsets.md
- api/ui/ag_ui.md
- api/ui/base.md
- api/ui/vercel_ai.md
- api/usage.md
- pydantic_evals:
- api/pydantic_evals/dataset.md
- api/pydantic_evals/evaluators.md
- api/pydantic_evals/reporting.md
- api/pydantic_evals/otel.md
- api/pydantic_evals/generation.md
- pydantic_graph:
- api/pydantic_graph/graph.md
- api/pydantic_graph/nodes.md
- api/pydantic_graph/persistence.md
- api/pydantic_graph/mermaid.md
- api/pydantic_graph/exceptions.md
- Beta API:
- api/pydantic_graph/beta.md
- api/pydantic_graph/beta_graph.md
- api/pydantic_graph/beta_graph_builder.md
- api/pydantic_graph/beta_step.md
- api/pydantic_graph/beta_join.md
- api/pydantic_graph/beta_decision.md
- api/pydantic_graph/beta_node.md
- fasta2a:
- api/fasta2a.md
- Project:
- contributing.md
- changelog.md
- version-policy.md
extra:
# hide the "Made with Material for MkDocs" message
generator: false
theme:
name: "material"
custom_dir: docs/.overrides
palette:
- media: "(prefers-color-scheme)"
primary: pink
accent: pink
toggle:
icon: material/brightness-auto
name: "Switch to light mode"
- media: "(prefers-color-scheme: light)"
scheme: default
primary: pink
accent: pink
toggle:
icon: material/brightness-7
name: "Switch to dark mode"
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: pink
accent: pink
toggle:
icon: material/brightness-4
name: "Switch to system preference"
features:
- search.suggest
- search.highlight
- content.tabs.link
- content.code.annotate
- content.code.copy
- content.code.select
- navigation.path
- navigation.indexes
- navigation.sections
- navigation.tracking
- toc.follow
- announce.dismiss
logo: "img/logo-white.svg"
favicon: "favicon.ico"
# https://www.mkdocs.org/user-guide/configuration/#validation
validation:
omitted_files: warn
absolute_links: warn
unrecognized_links: warn
anchors: warn
extra_css:
- "extra/tweaks.css"
# used for analytics
extra_javascript:
- "/flarelytics/client.js"
- "https://cdn.jsdelivr.net/npm/algoliasearch@5.20.0/dist/lite/builds/browser.umd.js"
- "https://cdn.jsdelivr.net/npm/instantsearch.js@4.77.3/dist/instantsearch.production.min.js"
- "/javascripts/algolia-search.js"
markdown_extensions:
- tables
- admonition
- attr_list
- md_in_html
- pymdownx.details
- pymdownx.caret
- pymdownx.critic
- pymdownx.mark
- pymdownx.superfences
- pymdownx.snippets
- pymdownx.tilde
- pymdownx.inlinehilite
- pymdownx.highlight:
pygments_lang_class: true
- pymdownx.extra:
pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
options:
custom_icons:
- docs/.overrides/.icons
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist:
custom_checkbox: true
- sane_lists # this means you can start a list from any number
- material.extensions.preview:
targets:
include:
- '*'
- pydantic_docs.mdext
watch:
- pydantic_ai_slim
- pydantic_evals
- pydantic_graph
- examples
plugins:
- search
- social
- glightbox
- mkdocstrings:
handlers:
python:
paths: [pydantic_ai_slim/pydantic_ai]
options:
docstring_options:
# pydantic_graph/beta/graph.py uses "Type Parameters:" sections to document Generic type params
# like StateT, OutputT, etc. Griffe can't extract these from Generic[T] base classes
# (only from PEP 695 syntax), so we disable the validation warnings.
warn_unknown_params: false
relative_crossrefs: true
members_order: source
separate_signature: true
show_signature_annotations: true
signature_crossrefs: true
group_by_category: false
# 3 because docs are in pages with an H2 just above them
heading_level: 3
extensions:
- griffe_warnings_deprecated:
kind: warning
title: Deprecated
inventories:
- url: https://logfire.pydantic.dev/docs/objects.inv
- url: https://docs.python.org/3/objects.inv
- url: https://docs.pydantic.dev/latest/objects.inv
- url: https://dirty-equals.helpmanual.io/latest/objects.inv
- url: https://fastapi.tiangolo.com/objects.inv
- url: https://typing-extensions.readthedocs.io/en/latest/objects.inv
- url: https://rich.readthedocs.io/en/stable/objects.inv
- url: https://modelcontextprotocol.github.io/python-sdk/objects.inv
# waiting for https://github.com/encode/httpx/discussions/3091#discussioncomment-11205594
- llmstxt:
enabled: !ENV [CI, false]
full_output: llms-full.txt
markdown_description: |-
Pydantic AI is a Python agent framework designed to make it less painful to build production grade
applications with Generative AI.
sections:
Introduction:
- index.md
- install.md
- help.md
- troubleshooting.md
Concepts documentation:
- a2a.md
- ag-ui.md
- agents.md
- builtin-tools.md
- dependencies.md
- deferred-tools.md
- direct.md
- embeddings.md
- input.md
- tools.md
- common-tools.md
- output.md
- retries.md
- message-history.md
- multi-agent-applications.md
- thinking.md
- third-party-tools.md
- tools-advanced.md
- toolsets.md
Models:
- models/*.md
Graphs:
- graph.md
API Reference:
- api/*.md
Evals:
- evals.md
Durable Execution:
- durable_execution/*.md
MCP:
- mcp/*.md
UI Event Streams:
- ui/*.md
Optional:
- testing.md
- cli.md
- logfire.md
- contributing.md
- changelog.md
- version-policy.md
Examples:
- examples/*.md
# DON'T PUT REDIRECTS IN THIS FILE! Instead add them to docs-site/src/index.ts
hooks:
- "docs/.hooks/main.py"
- "docs/.hooks/algolia.py"