In short.
Pydantic AI’s Retries guide is a practical reference for Python AI-agent developers, but configuring one retry limit does not bound every attempt underneath it. Its main contribution is separating transient-failure recovery, switching models and asking a model to correct tool calls or output. It recommends choosing one owner for transient retries and explains provider exceptions, request deadlines and retry visibility. The examples and numerical scenarios are documentation claims; no code was executed, and actual reliability, latency and charges are not assessed.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete captured Retries documentation page at [https://pydantic.dev/docs/ai/core-concepts/retries/index.md], including examples, provider exceptions and deprecation notices. Linked pages, dependency implementations, provider terms and live services are excluded. No code was executed. Runtime behavior, measured performance, actual charges and compatibility with an installed environment are not assessed; licensing remains unknown.
The overview
Identity
This is the complete Retries page in Pydantic AI’s core-concepts documentation at [https://pydantic.dev/docs/ai/core-concepts/retries/index.md]. It teaches how recovery works across an agent, its model clients and the infrastructure sending requests.
The resource combines a conceptual map, Python configuration examples, provider-specific qualifications and guidance for inspecting failures.
Assessment
The guide is particularly useful when an agent sends more requests than expected, takes too long to fail or reaches a fallback model too slowly. It connects those symptoms to independent retry budgets that stack rather than replace one another.
Its strongest detail is the distinction between resending a request and sending correction feedback to the model. The breadth also makes it a demanding first introduction: readers need to identify which SDK, transport and workflow engine their application actually uses. No measured improvement in reliability or performance is established.
Users
The primary audience is Python developers configuring Pydantic AI agents. Beginners can start with the RetryOnModelErrors capability; experienced developers get explanations of nested budgets, provider defaults, streaming failures, durable execution and message-history records.
Developers making direct model requests outside an agent are directed toward transport retries. Teams using Temporal, DBOS or Prefect also get guidance on coordinating workflow retries with SDK behavior.
Capabilities
The page maps nine layers: transport retries, provider SDK retries, durable execution, same-model retries, model fallback, capability-requested model attempts, tool retries, output retries and model-request hooks. It identifies failed batch resubmission as an additional layer.
Examples cover synchronous and asynchronous Tenacity transports, response validation, bounded backoff, Retry-After handling and provider retry settings. Inspection guidance covers failed_attempts, tool retry metadata, message-history helpers and HTTPX instrumentation. These are documented capabilities, not verified execution results.
Using it
Requirements
Reading the guide requires no installation. Applying its examples requires a Python environment with the relevant Pydantic AI packages and integration dependencies. Hosted-model examples also require access to the chosen provider. Minimum Python requirements and a complete set of pinned dependency versions are not established.
The transport examples use httpx2 and Tenacity; the page supplies pydantic-ai-slim[retries] as the dependency extra for retry transports. Bedrock uses boto3 instead. Durable execution examples require the corresponding workflow engine and integration.
Mechanism
The guide models network traffic as N × F × M × K: model requests in a logical call, model-level attempts, SDK attempts and transport attempts. Successful tool calls can add follow-up model requests too. Durable re-execution can repeat the lower layers again.
Tool and output retries send feedback that asks the model to correct its work. Tool counters are keyed by tool name and reset after success; text-output retries share a run-wide budget, while tool-output limits apply per output tool. Model-request hooks raising ModelRetry consume the output budget; RetryModelRequest requests another attempt under a separate ceiling of 100 attempts per request step.
The timeout setting applies per attempt where supported. The guide distinguishes request_timeout, which bounds attempts to one model including relevant retries, from first_event_timeout, which bounds waiting until streamed output starts.
Setup
The simplest agent configuration adds RetryOnModelErrors() to the Agent capabilities. According to the page, this capability sets SDK max_retries to 0 unless the developer explicitly supplies another value. Adding a retrying transport underneath it would introduce another retry budget.
For transport ownership, the page supplies pip install 'pydantic-ai-slim[retries]'. It then constructs AsyncHTTPX2TenacityTransport with RetryConfig, passes it through create_async_httpx2_client() to the provider and disables SDK retries where supported. HTTP status failures require a response validator; without one, the transport examples retry network errors and timeouts rather than error statuses.
Example
The page illustrates retry multiplication with an output budget of 2 retries, an SDK budget of 2 retries and a transport limited to 2 total attempts. These allow 3 × 1 × 3 × 2 = 18 network requests for the final-answer scenario. Adding a fallback chain of two models can double that to 36.
With a 10-second timeout on each of the 18 attempts, its illustration reaches 180 seconds of request time before backoff waits. This is conditional worst-case arithmetic from the documentation, not a benchmark or an observed run.
Assessment & evidence
Limitations
Retry controls differ by provider. Bedrock and xAI do not honor the per-request max_retries setting described for other models. Google streamed long-decode requests have additional retry behavior on google-genai 2.31.0 and later that max_retries cannot fully disable.
Transport retries cannot recover a stream once response headers have arrived; RetryOnModelErrors can retry a stream that fails before any output. Retrying batch-creation requests can create duplicate batches, so the page advises excluding those creates from transport response validation. Some examples retry all HTTP error statuses and need narrower predicates when only transient failures should qualify.
Whole agent runs are not automatically restarted. Prepare-callback exceptions propagate, and ordinary tool exceptions propagate unless a capability handles them. The page also marks legacy httpx transports and RetryPromptPart as deprecated, with removal described for v3.
Reasoning
The guide’s recommendation to choose one transient-retry owner follows from its multiplication model: giving several layers independent budgets makes actual request volume larger than any single configured count. Tool and output correction budgets still serve a separate purpose because they give the model feedback after a request succeeds.
This suggests the guide fits applications needing explicit recovery budgets and failure visibility. It does not establish that retries make arbitrary failures recoverable. A rejected API key, invalid configuration or an unhandled application exception needs a different response from a temporary service outage.
Alternatives
Within Pydantic AI, the page recommends RetryOnModelErrors when the agent should own transient recovery. Provider SDK retries offer the SDK’s existing policy; a custom transport offers HTTP-level predicates and waiting strategies; a durable engine can record and schedule attempts across interruptions.
ModelFallback and FallbackModel address switching models rather than retrying the same model. Pydantic Evals is mentioned for retrying whole evaluation tasks or evaluators. The page does not establish a comparative assessment of competing agent frameworks or their retry implementations.
Evidence
The evidence is the complete captured documentation page at [https://pydantic.dev/docs/ai/core-concepts/retries/index.md], including its explanations, tables and code listings. These support an assessment of what the guide teaches.
No runtime logs, independent benchmarks or reproduced failure traces are supplied. Printed outputs inside examples are documentation examples rather than results reproduced here. Linked API, provider and integration pages are outside the assessed scope.
Access & freshness
Costs
The page supplies no provider prices, measured bills or complete operating-cost estimate. Actual cost is unknown. Additional attempts can increase model usage and latency; fallback may use a differently priced model and usually cannot reuse the preceding model’s prompt cache.
UsageLimits.request_limit, documented with a default of 50, counts model responses committed to run history rather than every underlying attempt. Token and cost limits include usage when the provider reports it, but failed requests often lack that information. A request-count limit therefore does not establish a complete spending bound.
Rights
The page does not establish a license for its prose or code examples, or permission to redistribute the captured document. Those rights remain unknown. Anyone planning to copy or redistribute material should consult the applicable documentation and software terms.
Freshness
The documentation was captured on 2026-11-24 at 14:01:19.394 UTC. That timestamp establishes the snapshot date, not the page’s publication date or last substantive update.
The text includes version-sensitive statements about google-genai 2.31.0 and later and APIs deprecated during Pydantic AI v2 for removal in v3. It does not identify one exact Pydantic AI release governing every example. Compatibility with a particular installed environment and subsequent documentation changes are unknown.
Actions
Map the application’s active retry layers before choosing settings. Select one owner for transient failures, bound durable-engine attempts where relevant and confirm whether the chosen provider actually honors max_retries. Set request deadlines alongside attempt counts.
Before relying on the configuration, exercise controlled rate limits, server failures, timeouts and correction failures in the intended environment. Inspect failed_attempts, retry parts in message history and HTTP traces to compare model-visible requests with underlying attempts. These are suggested validation steps; no such execution is established here.
