Skip to main content

Overview

Durable Execution provides fault-tolerant execution for AI agents by automatically saving state at each step. Agents can recover from failures, resume from interruptions, and maintain consistency across restarts.

Key Features

  • Automatic Checkpoints: State saved after each pipeline step
  • Multiple Storage Backends: File, SQLite, Redis, or in-memory storage
  • Automatic Recovery: Resume from failure point
  • Error Tracking: Debug information preserved in checkpoints
  • Execution History: Analytics and monitoring
  • Auto Cleanup: Automatic cleanup of old execution data

Example

from upsonic import Agent, Task, DurableExecution
from upsonic.durable import FileDurableStorage

# Create storage
storage = FileDurableStorage("./checkpoints")

# Create durable execution
durable = DurableExecution(storage=storage)

# Create agent and task
agent = Agent("openai/gpt-4o")
task = Task(
    description="Analyze quarterly financial reports",
    durable_execution=durable
)

# Execute with automatic checkpointing
try:
    result = agent.do(task)
    print(result)
except Exception as e:
    # Resume from checkpoint
    result = agent.continue_durable(
        durable_execution_id=task.durable_execution_id,
        storage=storage
    )
    print(result)

Made with Love 💚

We believe that AI agents should be reliable and resilient in production. Failures shouldn’t mean starting over or losing valuable progress. With Durable Execution, we’ve crafted a system that respects your time and resources by automatically preserving every step of your agent’s journey. When things go wrong, you can pick up right where you left off - because we understand that reliability isn’t a luxury, it’s a necessity.