> ## Documentation Index
> Fetch the complete documentation index at: https://hastekit.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Runtime

> Pick where each agent executes — in-process for speed, or durable on Temporal / Restate for production reliability

The **Runtime** field on the Agent Info tab decides where the agent loop executes. The same agent definition can run on any of three runtimes; you change it from a dropdown.

<Frame>
  <img src="https://mintcdn.com/hastekit/890s5wy2NHvxQLSN/images/agent-builder/runtime.png?fit=max&auto=format&n=890s5wy2NHvxQLSN&q=85&s=5497c0edb28f9b2f56cf93c0c5a72090" alt="Runtime selector on Agent Info" width="1444" height="1130" data-path="images/agent-builder/runtime.png" />
</Frame>

## Local

The agent loop runs in the same process as the request handler.

* **Latency** — lowest (no broker hops).
* **Durability** — none. If the process crashes mid-run, the run is lost.
* **Concurrency** — limited by the process.
* **Best for** — development, short interactive chats, low-risk operations.

## Temporal

Each agent loop runs as a Temporal workflow; each IO operation (LLM call, tool call) is a Temporal **activity**.

* **Durability** — workflows survive process restarts, replay deterministically from history.
* **Retries** — per-activity retry policy with exponential backoff.
* **Long-running** — workflows can run for hours or days; the agent can sleep on Delay nodes or wait for [approvals](/docs/gateway/agent-builder/human-in-the-loop) without holding compute.
* **Streaming** — handled via a sidecar Redis stream so the client still sees token-by-token output.
* **Best for** — production agents, anything that calls expensive tools, anything you can't afford to lose.

## Restate

Each agent loop runs as a Restate workflow; each IO operation is a durable Restate step.

* **Durability** — IO results are memoized by Restate. On recovery the workflow replays the recorded results instead of re-issuing the calls.
* **Streaming** — also Redis-sidecar based.
* **Best for** — teams already running Restate, agents with idempotency requirements around external side effects.

## Same agent, any runtime

The agent definition (prompt, tools, schema, etc.) is identical across runtimes. You can develop on **Local**, switch to **Temporal** for production, and the agent's behavior is unchanged — only its durability characteristics differ.

[Workflows](/docs/gateway/agent-builder/workflows) have the same Local-vs-Temporal choice, with the same trade-offs.
