skillfed

pydantic-ai-absurd

Durable execution of Pydantic AI agents on Postgres via Absurd.

pydantic-ai-absurd v0.7.0 104.8K downloads/30d#12,735 on PyPI
Permissive license MIT Active released

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-absurd

uv

uv add pydantic-ai-absurd

poetry

poetry add pydantic-ai-absurd

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

durable agent executionpydantic ai fault toleranceagent checkpoint postgresresume agent from crashpydantic ai durabilityagent state persistenceworkflow checkpointing
agent-durabilitypostgres-backedfault-tolerance

More Artificial Intelligence packages

litellm

LiteLLM provides a unified Python interface to…

permissive · top 100 on PyPI

huggingface-hub

Client library and CLI tool for downloading,…

permissive · top 100 on PyPI

langchain

LangChain provides a framework for building…

permissive · top 1,000 on PyPI

hf-xet

hf-xet provides chunk-based deduplication and…

permissive · top 1,000 on PyPI

tokenizers

Tokenizers converts raw text into token…

permissive · top 1,000 on PyPI

transformers

Transformers provides a unified framework for…

permissive · top 1,000 on PyPI

absurd-sdk

Python SDK for Absurd, a PostgreSQL-based…

permissive · top 15,000 on PyPI

dbos

DBOS adds durable workflows and queues to…

permissive · top 5,000 on PyPI

aws-durable-execution-sdk-python

Builds long-running AWS Lambda workflows with…

permissive · top 15,000 on PyPI

pydantic-ai-todo

Adds task planning and tracking tools to…

permissive · top 15,000 on PyPI

restate-sdk

Restate SDK provides a Python interface for…

unclear · top 15,000 on PyPI

conductor-python

Build durable Conductor agents, workflows, and…

permissive · top 15,000 on PyPI

pydantic-ai

Pydantic AI is a Python framework for building…

permissive · top 5,000 on PyPI

agent-framework-durabletask

Integrates Microsoft Agent Framework agents…

permissive · top 15,000 on PyPI

agent-framework-foundry-hosting

Integrates Agent Framework agents and workflows…

permissive · top 15,000 on PyPI

agent-framework-azurefunctions

Hosts Microsoft Agent Framework agents on Azure…

permissive · top 15,000 on PyPI