explaingit

auctorai/durable_agents

Analysis updated 2026-05-18

17PythonAudience · developerComplexity · 5/5Setup · moderate

TLDR

A runnable demo showing how to make AI agent tool calls durable and retryable by running them as Temporal workflow activities.

Mindmap

mindmap
  root((durable_agents))
    What it does
      Durable agent tool calls
      Temporal-backed workflows
    Tech stack
      Python
      Pydantic AI
      Temporal
    Use cases
      Resilient agent tools
      Subagent spawning
      Programmatic tool calling
    Audience
      Developers
      AI agent builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Learn how to make AI agent tool calls resilient to crashes by running them as Temporal activities.

USE CASE 2

Explore spawning subagents as child workflows for bounded subtasks.

USE CASE 3

Prototype programmatic tool calling where the model writes a script that orchestrates multiple tools.

What is it built with?

PythonPydantic AITemporalOpenAI APIAnthropic API

How does it compare?

auctorai/durable_agents0petru/sentimoalingalingling/akasha-wechat
Stars171717
LanguagePythonPythonPython
Setup difficultymoderatemoderatehard
Complexity5/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires the Temporal CLI on PATH to start a local dev server, no LLM API key needed for the default scripted mode.

In plain English

Durable Agents is a runnable demo project that accompanies a blog post exploring how AI agents can be built as self writing workflows. It shows how to connect Pydantic AI, a Python framework for building AI powered applications, with Temporal, a workflow orchestration system that makes long running processes resilient and restartable, so that every step an AI agent takes becomes a durable, retryable unit of work. The core idea is that when an AI model decides to use a tool, that tool call is automatically converted into a Temporal activity, which is a tracked unit of work that Temporal can retry on failure and resume after a crash. The project also supports spawning subagents, where the model starts a child workflow for a subtask, and programmatic tool calling, where the model writes a short script that orchestrates multiple tools in parallel or in sequence. The demo runs without any AI API key by default. A scripted model replaces a real language model and emits pre defined tool calls, making it easy to explore workflow behavior deterministically. You can switch to a live model by providing an OpenAI or Anthropic API key instead. A built in REPL lets you type prompts and watch the resulting Temporal workflow graph, and it leaves any file side effects in a local sandbox folder for inspection. Error handling is deliberate. Validation errors are fed back to the model as correctable feedback, known execution failures come back as terminal errors, retryable infrastructure failures are retried according to Temporal's policy, and parent cancellation stops all child work in progress without triggering another model turn. The test suite covers all these scenarios using Temporal's in-process test environment, checking that tool calls, subagent spawning, and programmatic tool calling all produce the expected workflow shape.

Copy-paste prompts

Prompt 1
Walk me through running this demo's REPL and explain the Temporal workflow graph it shows.
Prompt 2
Help me switch this demo from the scripted model to a live OpenAI or Anthropic model.
Prompt 3
Explain how spawn and run_ptc differ from normal tool calls in this project's execution model.
Prompt 4
Show me how to add a new activity-backed capability tool to this agent.

Frequently asked questions

What is durable_agents?

A runnable demo showing how to make AI agent tool calls durable and retryable by running them as Temporal workflow activities.

What language is durable_agents written in?

Mainly Python. The stack also includes Python, Pydantic AI, Temporal.

How hard is durable_agents to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is durable_agents for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.