- Restate Server: Sits in front of your agents and takes care of orchestration and resiliency
- Agent Services: Your agent logic using the Restate SDK for durability

Creating a durable agent
To run a durable agent end to end, follow the quickstart on the integration page of your SDK, such as the Vercel AI SDK or the OpenAI Agents SDK. A Restate agent has three building blocks:- The handler: An HTTP handler containing your agent logic, exposed in a Restate service
- LLM calls: Persisted so responses are not re-fetched on recovery
- Tool executions: Wrapped in durable steps so side effects are not duplicated
- Vercel AI
- OpenAI Agents
- Google ADK
- Pydantic AI
- LangChain
- Restate TS
- Restate Py
To implement a durable agent, you use the Restate SDK in combination with the Vercel AI.Here’s a weather agent that looks up the weather for a city:The agent logic lives in a handler of a Restate service (here the
agent.ts
run handler).The main difference compared to a standard Vercel AI agent is the use of the Restate Context at key points:- Restate service handler: The agent runs inside a Restate service handler, giving it a durable execution context. Restate exposes the handler as an HTTP endpoint you can call via
curl, the Restate UI, or any HTTP client. - Persisting LLM responses: Wrap the model with
durableCalls(ctx)middleware so every LLM response is saved in the Restate Server and replayed during recovery. The middleware is provided via@restatedev/vercel-ai-middleware. - Resilient tool execution: Tools use
ctx.run()to make steps durable. The result is persisted and retried until it succeeds.