You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-48Lines changed: 37 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,65 +13,56 @@ The goal is to show how you can easily add production-grade _resilience_, _state
13
13
14
14
The Restate approach works **independent of specific SDKs** but **integrates easily with popular SDKs**, like the [Vercel AI SDK](https://ai-sdk.dev/) or the [OpenAI Agent SDK](https://openai.github.io/openai-agents-python/). You can also use without and Agent SDK _(roll your own loop)_ or for more traditional workflows.
15
15
16
-
📄 A gentle intro is in [the blog post "Durable Agents - Fault Tolerance across Frameworks and without Handcuffs"](https://restate.dev/blog/durable-ai-loops-fault-tolerance-across-frameworks-and-without-handcuffs/)
17
16
18
-
### Restate + Vercel AI SDK
17
+
## Why Restate?
18
+
📄 For a gentle intro, read [the blog post "Durable Agents - Fault Tolerance across Frameworks and without Handcuffs"](https://restate.dev/blog/durable-ai-loops-fault-tolerance-across-frameworks-and-without-handcuffs/)
-[Tour of Agents: Restate + Vercel AI SDK](vercel-ai/tour-of-agents): A step-by-step tutorial showing how to build resilient agents with Restate and the Vercel AI SDK.
-[Tour of Agents: Restate + OpenAI Agents SDK](openai-agents/tour-of-agents): A step-by-step tutorial showing how to build resilient agents with Restate and the Vercel AI SDK.
28
-
29
-
### Roll your own Loop? AI-enriched workflows?
30
-
31
-
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:
32
-
33
-
-**[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Python Patterns](python-patterns/README.md)** for hardening custom LLM orchestration logic.
<imgsrc="/doc/img/patterns/parallel_tools.png"alt="Restate UI - trace of agent with parallel tools"width="900px"/>
31
+
<br/>
32
+
<caption><em>Restate UI showing an agent execution with parallel tool calls</em></caption>
51
33
52
34
53
35
## Full Example Catalog
54
36
55
-
1.[**Restate + Vercel AI**](vercel-ai):
56
-
-[<imgsrc="https://skillicons.dev/icons?i=ts"width="24"height="24"> Template](vercel-ai/template): A minimal example of how to use Restate with the Vercel AI SDK.
57
-
-[<imgsrc="https://skillicons.dev/icons?i=ts"width="24"height="24"> Tour of Agents: Restate + Vercel AI SDK](vercel-ai/tour-of-agents): A step-by-step tutorial showing how to build resilient agents with Restate and the Vercel AI SDK.
58
-
-[<imgsrc="https://skillicons.dev/icons?i=ts"width="24"height="24"> Examples](vercel-ai/examples): A more advanced example of how to use Restate with the Vercel AI SDK that can be deployed as a Next.js app on Vercel.
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Template](openai-agents/template): A minimal example of how to use Restate with the OpenAI Agents SDK.
61
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Tour of Agents: Restate + OpenAI Agents SDK.](openai-agents/tour-of-agents): A step-by-step tutorial showing how to build resilient agents with Restate and the OpenAI Agents SDK.
62
-
2.[**Restate + any AI SDK**](python-patterns): patterns for hardening custom LLM orchestration logic.
63
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Chaining LLM calls](python-patterns/app/chaining.py): Build fault-tolerant processing pipelines where each step transforms the previous step's output.
64
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Tool routing](python-patterns/app/routing_to_tool.py): Automatically route requests to tools based on LLM outputs.
65
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Parallel tool execution](python-patterns/app/parallel_tools.py): Execute multiple tools in parallel with durable results that persist across failures.
66
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Multi-agent routing](python-patterns/app/routing_to_agent.py): Route requests to specialized agents based on LLM outputs.
67
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Remote agent routing](python-patterns/app/routing_to_remote_agent.py): Route requests to remote agents with resilient communication.
68
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Parallel agent processing](python-patterns/app/parallel_agents.py): Run multiple, specialized agents in parallel and aggregate their results.
69
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Orchestrator-worker pattern](python-patterns/app/orchestrator_workers.py): Break down complex tasks into specialized subtasks and execute them in parallel.
70
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Evaluator-optimizer pattern](python-patterns/app/evaluator_optimizer.py): Generate → Evaluate → Improve loop until quality criteria are met.
71
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Human-in-the-loop pattern](python-patterns/app/human_in_the_loop.py): Implement resilient human approval steps that suspend execution until feedback is received.
72
-
-[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> Chat sessions](python-patterns/app/chat.py): Long-lived, stateful chat sessions that maintain conversation state across multiple requests.
73
-
3.[**MCP** <imgsrc="https://skillicons.dev/icons?i=ts"width="24"height="24">](mcp): Using Restate for exposing tools and resilient orchestration of tool calls.
74
-
4.[**A2A** <imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="24"height="24"> ](a2a): Implement Google's Agent-to-Agent protocol with Restate as resilient, scalable task orchestrator.
|**Vercel AI SDK**|**Template**| A minimal example of how to use Restate with the Vercel AI SDK |[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](vercel-ai/template)|[📖](https://docs.restate.dev/ai-quickstart)|
41
+
||**Tour of Agents**| A step-by-step tutorial showing how to build resilient agents |[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](vercel-ai/tour-of-agents)|[📖](https://docs.restate.dev/tour/vercel-ai-agents)|
42
+
||**Examples**| More advanced examples that can be deployed as a Next.js app on Vercel |[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](vercel-ai/examples)| - |
43
+
|**OpenAI Agents SDK**|**Template**| A minimal example of how to use Restate with the OpenAI Agents SDK |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](openai-agents/template)|[📖](https://docs.restate.dev/ai-quickstart)|
44
+
||**Tour of Agents**| A step-by-step tutorial showing how to build resilient agents |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](openai-agents/tour-of-agents)|[📖](https://docs.restate.dev/tour/openai-agents)|
|**Chaining LLM calls**| Build fault-tolerant processing pipelines where each step transforms the previous step's output |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/chaining.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/chaining.ts)|[📖](https://docs.restate.dev/ai/patterns/prompt-chaining)|
50
+
|**Tool routing**| Automatically route requests to tools based on LLM outputs |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/routing_to_tool.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/routing-to-tools.ts)|[📖](https://docs.restate.dev/ai/patterns/tools)|
51
+
|**Parallel tool execution**| Execute multiple tools in parallel with durable results that persist across failures |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/parallel_tools.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/parallel-tools.ts)|[📖](https://docs.restate.dev/ai/patterns/parallelization)|
52
+
|**Multi-agent routing**| Route requests to specialized agents based on LLM outputs |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/routing_to_agent.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/routing-to-agent.ts)|[📖](https://docs.restate.dev/ai/patterns/multi-agent)|
53
+
|**Remote agent routing**| Deploy/scale agents separately and route requests with resilient communication |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/routing_to_remote_agent.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/routing-to-remote-agent.ts)|[📖](https://docs.restate.dev/ai/patterns/multi-agent)|
54
+
|**Parallel agent processing**| Run multiple, specialized agents in parallel and aggregate their results |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/parallel_agents.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/parallel-agents.ts)|[📖](https://docs.restate.dev/ai/patterns/parallelization)|
55
+
|**Racing agents**| Race multiple agents against each other and use the fastest response |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/racing_agents.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/racing-agents.ts)|[📖](https://docs.restate.dev/ai/patterns/competitive-racing)|
56
+
|**Human-in-the-loop pattern**| Implement resilient human approval steps that suspend execution until feedback is received |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/human_in_the_loop.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/human-in-the-loop.ts)|[📖](https://docs.restate.dev/ai/patterns/human-in-the-loop)|
57
+
|**Chat sessions**| Long-lived, stateful chat sessions that maintain conversation state across multiple requests |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/chat.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/chat.ts)|[📖](https://docs.restate.dev/ai/patterns/sessions-and-chat)|
58
+
|**Orchestrator-worker pattern**| Break down complex tasks into specialized subtasks and execute them in parallel |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/orchestrator_workers.py)| - |
59
+
|**Evaluator-optimizer pattern**| Generate → Evaluate → Improve loop until quality criteria are met |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](python-patterns/app/evaluator_optimizer.py)[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](typescript-patterns/src/evaluator-optimizer.ts)| - |
60
+
61
+
### Other Examples
62
+
| Example | Description | Code |
63
+
|------------------------|-------------|------|
64
+
|**MCP**| Using Restate for exposing tools and resilient orchestration of tool calls |[<imgsrc="https://skillicons.dev/icons?i=ts&theme=light"width="20"height="20">](mcp)|
65
+
|**A2A**| Implement Google's Agent-to-Agent protocol with Restate as resilient, scalable task orchestrator |[<imgsrc="https://skillicons.dev/icons?i=python&theme=light"width="20"height="20">](a2a)|
75
66
76
67
Restate currently supports 6 languages:
77
68
@@ -86,9 +77,7 @@ The examples can be translated to any of the supported languages.
86
77
Join our [Discord](https://discord.gg/skW3AZ6uGd)/[Slack](https://join.slack.com/t/restatecommunity/shared_invite/zt-2v9gl005c-WBpr167o5XJZI1l7HWKImA) to get help with translating an examples to your language of choice.
- Tour of Agents: a tutorial including the most important features: [Vercel AI SDK](https://docs.restate.dev/tour/vercel-ai-agents), [OpenAI Agents SDK](https://docs.restate.dev/tour/openai-agents)
80
+
-[Documentation](https://docs.restate.dev/ai)
92
81
-[Examples on workflows, microservice orchestration, async tasks, event processing](https://github.com/restatedev/examples)
0 commit comments