Skip to main content
Agent SDK for Go supports three execution backends. In-process is the default — pass no Temporal or Restate options. Temporal and Restate are opt-in durable backends — import pkg/agent/runtime/temporal or pkg/agent/runtime/restate and add the matching config option when you need durable, production-grade execution. Your agent code (NewAgent, tools, prompts, streaming) stays the same. Only the configuration changes.

Comparison

When to use in-process

  • Short-lived runs where crash recovery is not needed
  • Zero-infrastructure deployments (serverless, scripts, single binary)
See In-Process for details and limitations.

When to use Temporal

  • Agent runs must survive process crashes, deploys, and restarts
  • You need horizontal scaling by adding workers on a task queue
  • You want to split the agent client and worker across separate processes (NewAgentWorker)
  • Long-running agent sessions require durable orchestration on Temporal
See Temporal for cluster setup and SDK connection.

When to use Restate

  • Agent runs must survive process crashes, deploys, and restarts
  • You prefer Restate’s ingress + embedded endpoint model
  • You want durable streaming and approvals with the same public Run / Stream / reconnect APIs
  • Long-running agent sessions require durable orchestration on Restate
See Restate for server setup and SDK connection.

How runtime selection works

The SDK selects a backend from your NewAgent options. You never instantiate a runtime directly.
Provide either Temporal options or restate.WithRestateConfig, not both. For Temporal alone, provide either WithTemporalConfig or WithTemporalClient, not both.

Switching runtimes

Start in-process during development and add Temporal or Restate for production with a single config change. The agent code — tools, prompts, streaming, approvals — does not change.
  1. Develop with no Temporal or Restate options
  2. Add temporal.WithTemporalConfig (or WithTemporalClient) or restate.WithRestateConfig for production
  3. If you use conversation with a Temporal split-process deployment (agent + separate worker), switch from in-memory to Redis. See Conversation

In-Process

Default runtime — zero infrastructure

Temporal

Durable workflows, workers, and production deployment

Restate

Durable invocations with an embedded SDK endpoint