go version.
Step 1 — Create a Go module
Step 2 — Set your API key
Step 3 — Write the agent
Createmain.go:
Step 4 — Run
result.Content.
What happened
Switch to Temporal (optional)
Importpkg/agent/runtime/temporal and add temporal.WithTemporalConfig to run the same agent durably. A running Temporal cluster is required — see Temporal runtime.
Switch to Restate (optional)
Importpkg/agent/runtime/restate and add restate.WithRestateConfig to run the same agent durably. A running Restate server is required — see Restate runtime and restate-setup.md.
Try the repository example
The same pattern is in the Simple Agent example. From the repository root:What’s next
LLM Providers
Configure OpenAI, Anthropic, Gemini, or a custom client
Run
AgentRun — Get, Done, Status, Cancel, non-blocking
Streaming
Stream partial tokens and lifecycle events