pydantic-ai-absurd
Durable execution of Pydantic AI agents on Postgres via Absurd.
What it is and what it does
Pydantic AI Absurd wraps Pydantic AI agents with durable execution backed by Postgres. When an agent runs inside an Absurd task, every model call and tool invocation is checkpointed to the database. If the worker process crashes mid-execution, a new worker can resume from the last completed step without restarting the entire run or re-spending tokens on already-completed API calls.
The package integrates Absurd's task queue and durability layer directly into Pydantic AI's agent runtime, eliminating the need for external infrastructure like Temporal or Redis. You define tasks using decorators, spawn them with parameters, and call agent.run() inside the task—Absurd handles checkpointing and recovery transparently. It's designed for scenarios where agent runs are long, expensive, or prone to interruption.
Use it for:
- Long-running analysis agents that call LLMs multiple times and must survive worker restarts without token waste.
- Multi-step agentic workflows with tool calls that need to resume from the last completed step after crashes.
- Production deployments where Postgres is already present and external orchestration services are not available.
- Cost-sensitive agent applications where re-running expensive model calls after a failure is unacceptable.
- Batch processing of agent tasks with guaranteed completion despite transient worker failures.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds durable execution to Pydantic AI agents by checkpointing model and tool calls to Postgres, allowing crashed workers to resume from the last completed step without token loss.
Yes, if you run Pydantic AI agents in production and want durability without external infrastructure. The low install friction, permissive license, and active maintenance make it a practical choice for teams already using Postgres. Verify that Postgres schema setup and performance overhead align with your deployment model before committing.
Install
pydantic-ai-absurd on PyPI
pip
pip install pydantic-ai-absurduv
uv add pydantic-ai-absurdpoetry
poetry add pydantic-ai-absurdInstalling pydantic-ai-absurd
Before you install
Low friction: pure Python wheel with only three runtime dependencies (pydantic-ai, absurd-sdk, typing-extensions). Active maintenance status and recent release suggest ongoing support.
License in practice
MIT license permits commercial use, modification, and distribution with minimal restrictions—suitable for most production deployments.
Quickstart
pip install pydantic-ai-absurd
from absurd_sdk import AsyncAbsurd
from pydantic_ai import Agent
from pydantic_ai_absurd import AbsurdDurability
absurd = AsyncAbsurd("postgresql://localhost/absurd", queue_name="agents")
agent = Agent("openai:gpt-5.2", capabilities=[AbsurdDurability()])
@absurd.register_task(name="analyse")
async def analyse(params, ctx):
result = await agent.run(params["prompt"])
return {"output": result.output}
Requires Postgres instance and supports Python 3.10 or later; agent must be run inside an Absurd task context.
Verify before relying
- Whether Postgres schema is auto-created or requires manual setup.
- Performance overhead of checkpointing on latency-sensitive agent workloads.
- Compatibility with all Pydantic AI model providers and tool types.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — absurd-sdk, pydantic-ai, typing-extensions |
| Maintenance | actively maintained — 17 days since the last release |
| First released | |
| Downloads | 104,826/month — #12,735 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pydantic_ai_absurd-0.7.0-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
absurd-sdkPython SDK for Absurd, a PostgreSQL-based…
permissive · top 15,000 on PyPI
dbosDBOS adds durable workflows and queues to…
permissive · top 5,000 on PyPI
aws-durable-execution-sdk-pythonBuilds long-running AWS Lambda workflows with…
permissive · top 15,000 on PyPI
pydantic-ai-todoAdds task planning and tracking tools to…
permissive · top 15,000 on PyPI
restate-sdkRestate SDK provides a Python interface for…
unclear · top 15,000 on PyPI
conductor-pythonBuild durable Conductor agents, workflows, and…
permissive · top 15,000 on PyPI
pydantic-aiPydantic AI is a Python framework for building…
permissive · top 5,000 on PyPI
agent-framework-durabletaskIntegrates Microsoft Agent Framework agents…
permissive · top 15,000 on PyPI
agent-framework-foundry-hostingIntegrates Agent Framework agents and workflows…
permissive · top 15,000 on PyPI
agent-framework-azurefunctionsHosts Microsoft Agent Framework agents on Azure…
permissive · top 15,000 on PyPI