- Explore MCP Servers
- ai-examples
Ai Examples
What is Ai Examples
ai-examples is a collection of Restate examples designed for various AI use cases, including agents, A2A (agent-to-agent), and MCP (multi-channel processing).
Use cases
Use cases for ai-examples include building reliable applications for automated tasks, coordinating multi-agent interactions, and managing complex workflows in production environments.
How to use
To use ai-examples, developers can explore the provided examples and integrate them into their applications by following the documentation available at the Restate website.
Key features
Key features of ai-examples include innate resiliency, task control, reliable multi-agent communication, full observability, and orchestration of long-running processes.
Where to use
ai-examples can be utilized in fields such as software development, AI research, and any domain requiring robust agentic workflows and stateful applications.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Ai Examples
ai-examples is a collection of Restate examples designed for various AI use cases, including agents, A2A (agent-to-agent), and MCP (multi-channel processing).
Use cases
Use cases for ai-examples include building reliable applications for automated tasks, coordinating multi-agent interactions, and managing complex workflows in production environments.
How to use
To use ai-examples, developers can explore the provided examples and integrate them into their applications by following the documentation available at the Restate website.
Key features
Key features of ai-examples include innate resiliency, task control, reliable multi-agent communication, full observability, and orchestration of long-running processes.
Where to use
ai-examples can be utilized in fields such as software development, AI research, and any domain requiring robust agentic workflows and stateful applications.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Restate: SDK-agnostic resilient agentic workflows
Restate turns brittle agents into resilient agents.
Restate is Agent-SDK-agnostic and turns your agentic workflows into reliable applications that work consistently in production.
Restate has got your back: whether you start by adding resiliency to an existing agent SDK, or decide the agent SDK not flexible enough and implement everything from scratch while keeping your resiliency guarantees.
Restate + Vercel AI SDK
Use Restate in combination with the Vercel AI SDK to turn your Vercel AI SDK-based agents into resilient agents:
Restate + OpenAI Agent SDK
Use Restate in combination with the OpenAI Agent SDK to turn your OpenAI Agent SDK-based agents into resilient agents:
Why Restate?
Restate lets you easily build reliable applications that work consistently in production.
Restate’s capabilities and programming model work very well for implementing agentic workflows.
Move beyond fragile demos by giving your agents innate resilience—persistent memory, fault-tolerant tool/LLM calls, and robust handling of long-running tasks. Focus on your agent’s intelligence, not the infrastructure complexity tax.
Restate provides the following capabilities:
- 🚀 Move fast and far - Innate resiliency and control from your first LLM-SDK-based app to low-level, customized multi-agent applications.
- 🛠️ SDK-agnostic - Use Restate with any agent SDK, such as OpenAI Agent SDK, Vercel AI SDK, or your own custom agent implementation.
- ✅ Resilience where it matters most – Automatically recover from failures in your agentic workflows and tools.
- 🎮 Task control - Cancel tasks, query status, re-subscribe to ongoing tasks, and track progress across failures, time, and processes.
- 🤖 Reliable multi-agent - Flexible and reliable communication patterns including RPC, scheduled tasks, events, human-in-the-loop and parallel execution.
- 🙂 Human-in-the-loop – Resiliently integrate human feedback into your agentic workflows.
- 👀 Full observability – Line-by-line execution tracking with a built-in audit trail and UI. Seamless integration with OpenTelemetry.
- 🔁 Orchestrate long-running processes – Coordinate durable and stateful agentic processes for millis or months.
- 🔧 Rich primitives – Leverage workflows, durable promises, communication, and persistent state.
- 🧠 Exactly-once execution - Automatic deduplication of hand-offs and tool executions via idempotency keys.
- 💾 Persistent memory - Maintain consistent agent memory across infrastructure events.
- 🌍 Deploy anywhere – Whether it’s AWS Lambda, CloudRun, Fly.io, Cloudflare, Kubernetes, Deno Deploy,…
- ☁️ Easy to self-host – Single-binary self-hosted deployments or connect to Restate Cloud.
Restate can also be used for other use cases, such as:
workflows,
microservice orchestration,
async tasks,
and event processing.
Or check out the Restate examples repository.
This repository contains examples of how to use Restate for AI / Agent use cases.
Full Example Catalog
- 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 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.
Running the examples
Clone the repository and consult the README of the example you want to run for further instructions.
git clone [email protected]:restatedev/ai-examples.git
How Restate Compares (vs. Alternatives for Agents):
- vs. DIY (Basic Loops + DB/Queue): Eliminates vast amounts of boilerplate code for retries, state management, consistency checks, and failure recovery that developers would otherwise need to build manually.
- vs. Basic Agent Frameworks (focused on prompts/reasoning): Provides the crucial missing layer of execution reliability, state persistence, and robust async operation management needed for production. Restate complements these frameworks by providing a reliable runtime beneath the agent’s reasoning logic.
- vs. Heavy Workflow Engines: Offers similar strong execution guarantees but with a lighter footprint, lower latency, simpler programming model, native serverless integration, and easier self-hosting/operational story—often a better fit for the potentially high-volume, interactive nature of agent applications.
Learn more
- 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
Disclaimers and acknowledgements
Disclaimer 1: 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.
Disclaimer 2: Many of the DIY patterns have been based on Anthropic’s agents cookbook.
Disclaimer 3: Some of the A2A examples in this repo are based on the examples included in the Google A2A repo.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










