Skip to main content
Restate Harness (@restatedev/harness) is a TypeScript agent harness built on Restate’s durable execution. You define the model, instructions, and tools, then run the agent in a Restate service handler while Restate Harness manages the loop. Your agents, tools, and workflows share one runtime. They call each other reliably and suspend while they wait for work or human input, and you can inspect their execution in the Restate UI. Restate Harness is a thin layer over Durable Execution, Durable Coroutines, Virtual Objects, and durable service calls, so you can customize it or use its source to build your own.

How it works

You define an agent once, at module scope, with agent(), and a handler runs it with yield* agent.run(input):
Each request to Support/ask starts a run: a loop of model calls and the tool calls that the model requests. The handler controls everything around the run, such as where the conversation is stored, who approves tool calls, and what happens with the result. HTTP clients, SDK clients, webhooks, and Kafka send requests to the Restate Server, which invokes the handler in your service that runs agent.run(). The handler calls the LLM, tools, and a sandbox. If you interrupt the run or cancel the invocation, Restate Harness cancels the run’s unfinished tool calls.

Features

Key concepts

Build with a coding agent

The Restate plugin adds skills for Restate Harness and the Restate SDKs to your coding agent, and connects the Restate documentation MCP server.
For Codex and other agents, finish the setup in Develop with AI.

Next steps

Quickstart

Run a weather agent on a local Restate Server.

Tutorial

Follow the numbered lessons, from one agent to multi-agent workflows.

Agent reference architecture

Explore a complete TypeScript agent with human approvals, sandboxed tools, sub-agents, memory, and schedules.

Production checklist

Review the settings to change before you run agents in production.