NewAgent without Temporal or Restate options, the agent loop runs directly inside your Go process — no external orchestration server.
Enable
Omit all Temporal and Restate configuration:How it works
When you callRun or Stream, the SDK executes the full agent loop in your process:
- Load conversation history and recalled memory (when configured)
- Call the LLM with the merged tool list
- Execute tool calls and append results
- Repeat until the model finishes or the iteration limit is reached
- Return the result or stream events back to your caller
Capabilities
All SDK capabilities are available on the in-process runtime:- LLM providers (OpenAI, Anthropic, Gemini, custom)
- Tools, MCP, A2A, sub-agents
- Conversation (in-memory), memory, retrieval (RAG)
- Streaming, AG-UI events, hooks
- Human-in-the-loop approvals
- OpenTelemetry observability
GetAgentRun / GetAgentStream + WithOffset) require the Temporal or Restate runtime. Temporal also offers horizontal worker scaling via NewAgentWorker; Restate scales via multiple registered endpoint deployments.
Limitations
Error handling
On in-process, errors are returned directly to the caller:Run
Stream
RUN_ERROR event / error result, with the panic message included. The run does not propagate the panic to your caller.
When to use
Switch to a durable runtime
Import a durable runtime package and add its config option — no other code changes: Temporal:Examples
Simple Agent
Minimal in-process agent with Run()
Stream
Streaming tokens and tool events in-process