This repo contains a set of runnable examples of AI workflows and agents, using Durable Execution and Orchestration via Restate (Github)
The goal is to show how you can easily add production-grade resilience, state persistence, retries, suspend/resume, human-in-the-loop, and observability to agentic workflows. So you can ship agents that stay alive and consistent without sprinkling retry-code everywhere and without building heavyweight infra yourself.
The Restate approach works independent of specific SDKs but integrates easily with popular SDKs, like the Vercel AI SDK or the OpenAI Agent SDK. You can also use without and Agent SDK (roll your own loop) or for more traditional workflows.
📄 A gentle intro is in the blog post "Durable Agents - Fault Tolerance across Frameworks and without Handcuffs"
Restate is a flexible general-purpose runtime for what we call innately resilient application. It is not limited to agentic workflow use cases and is being used for a variety of other use cases as well, including financial transactions or order processing. These examples show how to build agents directly on Restate's durable execution and state management:
Use Case | What it solves |
---|---|
Durable Execution | Crash-safe LLM/tool calls & idempotent retries—agents resume at the last successful step. |
Journal Observability | Auto-captured journal of every step, retry, and message for easy debugging and auditing. |
Human-in-the-loop & long waits | Suspend while waiting for user approval or slow jobs; pay for compute, not wall-clock time. |
Stateful sessions / memory | Virtual Objects keep multi-turn conversations and other state isolated and consistent. |
Multi-agent orchestration | Reliable RPC, queuing, and scheduling between agents running in separate processes. |
Restate UI showing an ongoing agent execution
- Restate + Vercel AI:
- Restate + OpenAI Agents Python SDK:
- Patterns for hardening custom LLM orchestration logic.
- MCP
: Using Restate for exposing tools and resilient orchestration of tool calls.
- A2A
: Implement Google's Agent-to-Agent protocol with Restate as resilient, scalable task orchestrator.
- Advanced examples:
Restate-native agent: A fully customizable agent implemented with Restate without an Agent SDK.
Interruptible agents: A customized agent with different operational modes to process new inputs: interrupting, incorporating, queueing.
Insurance claims: Filing insurance claims by parsing PDF receipts with LLMs.
Restate currently supports 6 languages:
The examples can be translated to any of the supported languages. Join our Discord/Slack to get help with translating an examples to your language of choice.
- Documentation
- Quickstart
- Tour of Restate: a tutorial including the most important features
- Examples on workflows, microservice orchestration, async tasks, event processing
- Restate Cloud
- Discord / Slack
-
The implementations of the Restate-native agent in this repo are heavily inspired by the OpenAI Agents SDK. We therefore want to give credit to the developers of this SDK for the great work they have done. This repo builds further on their work to make it benefit from Restate's programming model and capabilities.
-
The DIY patterns are largely based on Anthropic's agents cookbook.
-
Some of the A2A examples in this repo are based on the examples included in the Google A2A repo.