{"id":29228365,"url":"https://github.com/restatedev/ai-examples","last_synced_at":"2026-04-24T11:13:20.087Z","repository":{"id":295632609,"uuid":"947376775","full_name":"restatedev/ai-examples","owner":"restatedev","description":"A collection of Restate examples for AI use cases: agents, A2A, MCP, ...","archived":false,"fork":false,"pushed_at":"2026-04-21T15:07:52.000Z","size":16070,"stargazers_count":69,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-21T17:05:45.645Z","etag":null,"topics":["ai","artificial-intelligence","durable-execution","resilience","restate"],"latest_commit_sha":null,"homepage":"https://ai.restate.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/restatedev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-12T15:37:05.000Z","updated_at":"2026-04-15T16:40:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"5dcf1210-3a6e-4500-bea3-a902bcfd4fc5","html_url":"https://github.com/restatedev/ai-examples","commit_stats":null,"previous_names":["restatedev/ai-examples"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/restatedev/ai-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restatedev%2Fai-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restatedev%2Fai-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restatedev%2Fai-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restatedev%2Fai-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/restatedev","download_url":"https://codeload.github.com/restatedev/ai-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restatedev%2Fai-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32220556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","durable-execution","resilience","restate"],"created_at":"2025-07-03T10:10:42.822Z","updated_at":"2026-04-24T11:13:20.082Z","avatar_url":"https://github.com/restatedev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdown-link-check-disable --\u003e\n[![Documentation](https://img.shields.io/badge/doc-reference-blue)](https://docs.restate.dev)\n[![Discord](https://img.shields.io/discord/1128210118216007792?logo=discord)](https://discord.restate.dev)\n[![Slack](https://img.shields.io/badge/Slack-4A154B?logo=slack\u0026logoColor=fff)](https://slack.restate.dev)\n[![Twitter](https://img.shields.io/twitter/follow/restatedev.svg?style=social\u0026label=Follow)](https://x.com/intent/follow?screen_name=restatedev)\n\u003c!-- markdown-link-check-enable --\u003e\n\n# Durable Agents and AI workflows with Restate\n\nThis repo contains a set of runnable examples of AI workflows and agents, using  **Durable Execution and Orchestration** via [Restate](https://restate.dev/) ([Github](https://github.com/restatedev/restate))\n\nThe 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.\n\nThe Restate approach works **independent of specific SDKs** but **integrates easily with popular SDKs**, like the [Vercel AI SDK](https://ai-sdk.dev/), the [OpenAI Agent SDK](https://openai.github.io/openai-agents-python/), [Google ADK](https://google.github.io/adk-docs/), and [Pydantic AI](https://ai.pydantic.dev/). You can also use without any Agent SDK _(roll your own loop)_ or for more traditional workflows.\n\n\n## Why Restate?\n\n| Use Case                           | What it solves                                                                                       |\n|------------------------------------|------------------------------------------------------------------------------------------------------|\n| **Durable Execution**              | Crash-safe model and tool calls, idempotent retries, agents that resume at the last successful step. |\n| **Detailed Observability**         | Auto-captured trace of every step, retry, and message for easy debugging and auditing.               |\n| **Human-in-the-loop \u0026 long waits** | Suspend while waiting for user approval or slow jobs; pay for compute, not wall-clock time.          |\n| **Stateful sessions / memory**     | Keep multi-turn conversations and other state isolated and consistent.                               |\n| **Multi-agent orchestration**      | Reliable RPC, queuing, and scheduling between agents running in separate processes.                  |\n\n\n\u003cimg src=\"/doc/img/patterns/parallel_tools.png\" alt=\"Restate UI - trace of agent with parallel tools\" width=\"900px\"/\u003e\n\u003cbr/\u003e\n\u003ccaption\u003e\u003cem\u003eRestate UI showing an agent execution with parallel tool calls\u003c/em\u003e\u003c/caption\u003e\n\n\n## Quickstart Templates\n\n| Integration                        | Quickstart                                           | Template                                                                                                             |\n|------------------------------------|------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|\n| **Vercel AI SDK**                  | [📖](https://docs.restate.dev/ai-quickstart)         | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/template/README.md)     |\n| **OpenAI Agents SDK**              | [📖](https://docs.restate.dev/ai-quickstart)         | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/template/README.md)       |\n| **Google ADK**                     | [📖](https://docs.restate.dev/ai-quickstart)         | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/template/README.md)          |\n| **Pydantic AI**                    | [📖](https://docs.restate.dev/ai-quickstart)         | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/template/README.md)         |\n| **Restate - Python - no agent SDK** | [📖](https://docs.restate.dev/ai-quickstart)         | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/template/README.md) |\n| **Restate - TS - no agent SDK**    | [📖](https://docs.restate.dev/ai-quickstart)         | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/template/README.md) |\n\n\n## Getting Started - Basic Examples\n\n| Pattern                               | Description | Docs | Restate | Vercel AI | OpenAI | ADK | Pydantic AI |\n|---------------------------------------|-------------|------|---------|-----------|--------|-----|-------------|\n| **Durable agents**                    | Build AI agents that survive crashes and recover automatically | [📖](https://docs.restate.dev/ai/patterns/durable-agents) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/template/agent.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/template/src/agent.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/template/src/app.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/template/agent.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/template/agent.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/template/agent.py) |\n| **Durable Sessions**                  | Persistent, isolated agent sessions | [📖](https://docs.restate.dev/ai/patterns/sessions) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/chat_agent.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/chat-agent.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/chat-agent.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/chat_agent.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/chat_agent.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/chat_agent.py) |\n| **Human approvals with pause/resume** | Human approval steps that suspend execution | [📖](https://docs.restate.dev/ai/patterns/human-in-the-loop) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/human_approval_agent.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/human-approval-agent.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/human-approval-agent.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/human_approval_agent.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/human_approval_agent.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/human_approval_agent.py) |\n| **Multi-agent orchestration**         | Route requests to specialized agents | [📖](https://docs.restate.dev/ai/patterns/multi-agent) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/multi_agent.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/multi-agent.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/multi-agent.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/multi_agent.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/multi_agent.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/multi_agent.py) |\n\n## Implementation Guides\n\n### Orchestration Guides\n\n| Pattern                            | Description                                                   | Docs | Restate                                                                                                                                                                                                                                                                                                                       | Vercel AI                                                                                                                                        | OpenAI | ADK                                                                                                                                                   | Pydantic AI |\n|------------------------------------|---------------------------------------------------------------|------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|\n| **Parallel tool calls**            | Run multiple tools in parallel with recovery and coordination | [📖](https://docs.restate.dev/ai/patterns/parallelization) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/workflow_parallel.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/workflow-parallel.ts)                       | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/workflow-parallel.ts)            | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/workflow_parallel.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/workflow_parallel.py)            | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/workflow_parallel.py) |\n| **Workflows: Sequential pipeline** | Chain agents in multi-step pipelines                          | [📖](https://docs.restate.dev/ai/patterns/workflow-sequential) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/workflow_sequential.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/workflow-sequential.ts)                   | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/workflow-sequential.ts)          | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/workflow_sequential.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/workflow_sequential.py)          | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/workflow_sequential.py) |\n| **Workflows: Parallel agents**     | Executing multiple agents in parallel                         | [📖](https://docs.restate.dev/ai/patterns/workflow-parallel) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/workflow_parallel.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/workflow-parallel.ts)                       | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/workflow-parallel.ts)            | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/workflow_sequential.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/workflow_parallel.py)            | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/workflow_parallel.py) |\n| **Workflows: Orchestrator-worker** | Break tasks into specialized subtasks                         | [📖](https://docs.restate.dev/ai/patterns/workflow-orchestrator) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/workflow_orchestrator.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/workflow-orchestrator.ts)               | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/workflow-orchestrator.ts)        | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/workflow_orchestrator.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/workflow_orchestrator.py)        | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/workflow_orchestrator.py) |\n| **Workflows: Evaluator-optimizer** | Generate, evaluate, improve loop                              | [📖](https://docs.restate.dev/ai/patterns/workflow-evaluator) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/workflow_evaluator_optimizer.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/workflow-evaluator-optimizer.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/workflow-evaluator-optimizer.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/workflow_evaluator_optimizer.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/workflow_evaluator_optimizer.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/workflow_evaluator_optimizer.py) |\n| **Workflows as tools**             | Complex tool logic as separate durable services               | [📖](https://docs.restate.dev/ai/patterns/tools) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/parallel_tools_agent.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/parallel-tools-agent.ts)                 | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/parallel-tools-agent.ts)         | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/parallel_tools_agent.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/parallel_tools_agent.py)         | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/parallel_tools_agent.py) |\n| **Remote agents**                  | Deploy/scale agents separately with resilient RPC and queuing | [📖](https://docs.restate.dev/ai/patterns/remote-agents) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/remote_agents.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/remote-agents.ts)                               | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/remote-agents.ts)                | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/remote_agents.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/remote_agents.py)                | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/remote_agents.py) |\n| **Competitive racing agents**      | Run parallel agents, use the fastest response, cancel others  | [📖](https://docs.restate.dev/ai/patterns/competitive-racing) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/tour-of-agents/app/racing_agents.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/tour-of-agents/src/racing-agents.ts)                               | -                                                                                                                                                | - | -                                                                                                                                                     | - |\n| **Interrupt \u0026 regenerate**         | Interrupt a running agent with new context; cancel in-flight task and restart | - | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/examples/interrupt-regenerate/agent.py) [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](typescript-restate-only/examples/interrupt-regenerate/src/agent.ts)                      | -                                                                                                                                                | - | -                                                                                                                                                     | - |\n\n### Reliability Guides\n\n| Pattern | Description | Docs | Restate | Vercel AI | OpenAI | ADK | Pydantic AI |\n|---------|-------------|------|---------|-----------|--------|-----|-------------|\n| **Error handling** | Retries and error handling for agents | [📖](https://docs.restate.dev/ai/patterns/error-handling) | - | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/errorhandling) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/tour-of-agents/app/error_handling.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/tour-of-agents/app/error_handling.py) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/tour-of-agents/app/error_handling.py) |\n| **Rollback** | Saga pattern for compensating failed operations | [📖](https://docs.restate.dev/ai/patterns/rollback) | - | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/tour-of-agents/src/rollback-agent.ts) | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/examples/rollback) | - | - |\n\n### Frontend Integration\n\n| Pattern | Description | Docs | Restate | Vercel AI | OpenAI                                                                                                                                    | ADK | Pydantic AI |\n|---------|-------------|------|---------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------|-----|-------------|\n| **Chat UI integration** | Integrate agents with chat UIs | [📖](https://docs.restate.dev/ai/patterns/chat-ui-integration) | - | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/nextjs-example-app/README.md) | -                                                                                                                                         | - | - |\n| **Streaming responses** | Stream agent responses to clients | [📖](https://docs.restate.dev/ai/patterns/streaming-responses) | - | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/nextjs-example-app/README.md) | -                                                                                                                                         | - | - |\n| **Notify when ready** | Callback when agent completes | [📖](https://docs.restate.dev/ai/patterns/notify-when-ready) | - | - | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/examples/notify_when_ready/agent.py) | - | - |\n\n\n## More Examples \u0026 Integrations\n\n| Example                | Description                                                                                     | Code                                                                                                                    |\n|------------------------|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|\n| **NextJS Template**    | Minimal example of Restate + AI SDK + NextJS                                                    | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/nextjs-template/README.md) |\n| **NextJS Example App** | Example app of Restate + AI SDK + NextJS with tools, chat, pubsub,...                           | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](vercel-ai/nextjs-example-app/README.md)        |\n| **MCP**                | Using Restate for exposing tools and resilient orchestration of tool calls                       | [\u003cimg src=\"https://skillicons.dev/icons?i=ts\u0026theme=light\" width=\"24\" height=\"24\"\u003e](mcp/README.md)                                 |\n| **A2A**                | Implement Google's Agent-to-Agent protocol with Restate as resilient, scalable task orchestrator | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](a2a/README.md)                             |\n\n### AI Observability\n\n| Integration          | Restate                                                                                                                                               | OpenAI Agents                                                                                                                                         | Google ADK                                                                                                                                       | Pydantic AI                                                                                                                                       |\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Langfuse**         | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](python-restate-only/examples/langfuse/README.md)               | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/examples/langfuse/README.md)                    | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](google-adk/examples/langfuse/README.md)                   | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/examples/langfuse/README.md)                   |\n| **Arize Phoenix**    | -                                                                                                                                                 | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](openai-agents/examples/arize_phoenix/README.md)               | -                                                                                                                                                | -                                                                                                                                                 |\n| **Pydantic LogFire** | -                                                                                                                                                      | -                                                                                                                                                     | -                                                                                                                                                | [\u003cimg src=\"https://skillicons.dev/icons?i=python\u0026theme=light\" width=\"24\" height=\"24\"\u003e](pydantic-ai/examples/logfire/README.md)                    |\n\n## Supported Languages\n\nRestate currently supports 6 languages:\n\n[![TypeScript](https://skillicons.dev/icons?i=ts)](https://docs.restate.dev/develop/ts/overview)\n[![Python](https://skillicons.dev/icons?i=python\u0026theme=light)](https://docs.restate.dev/develop/python/overview)\n[![Java](https://skillicons.dev/icons?i=java\u0026theme=light)](https://docs.restate.dev/develop/java/overview)\n[![Kotlin](https://skillicons.dev/icons?i=kotlin\u0026theme=light)](https://docs.restate.dev/develop/java/overview)\n[![Go](https://skillicons.dev/icons?i=go)](https://docs.restate.dev/develop/go/overview)\n[![Rust](https://skillicons.dev/icons?i=rust\u0026theme=light)](https://docs.rs/restate-sdk/latest/restate_sdk/)\n\nThe examples can be translated to any of the supported languages.\nJoin our [Discord](https://discord.restate.dev)/[Slack](https://slack.restate.dev) to get help with translating an examples to your language of choice.\n\n## Using AI coding tools\n\nIf you use Claude Code, Codex, or Cursor to build on Restate, we highly recommend installing the [Restate plugin](https://github.com/restatedev/skills). It bundles skills, prompts, and context that help AI coding assistants generate correct, idiomatic Restate code across all supported SDKs. Most templates in this repo install the plugin automatically — see the [skills repo](https://github.com/restatedev/skills) for setup instructions.\n\n## Learn more\n- [AI Documentation](https://docs.restate.dev/ai)\n- [Examples on workflows, microservice orchestration, async tasks, event processing](https://github.com/restatedev/examples)\n- [Restate Cloud](https://restate.dev/cloud/)\n- [Discord](https://discord.restate.dev) / [Slack](https://slack.restate.dev)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestatedev%2Fai-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frestatedev%2Fai-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestatedev%2Fai-examples/lists"}