Skip to main content
The in-process runtime is the default. When you call NewAgent without Temporal options, the agent loop runs directly inside your Go process. No Temporal server, no workers, no external orchestration.

Enable

Omit all Temporal configuration:
a, err := agent.NewAgent(
    agent.WithLLMClient(llmClient),
    agent.WithSystemPrompt("You are a helpful assistant."),
)
if err != nil {
    return err
}
defer a.Close()

result, err := a.Run(ctx, "Hello", nil)
See Quickstart for a complete example.

How it works

When you call Run, RunAsync, or Stream, the SDK executes the full agent loop in your process:
  1. Load conversation history and recalled memory (when configured)
  2. Call the LLM with the merged tool list
  3. Execute tool calls and append results
  4. Repeat until the model finishes or the iteration limit is reached
  5. Return the result or stream events back to your caller
Everything happens in-process — no network hops, no external orchestration.

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
The only capabilities exclusive to Temporal are durable execution (crash recovery) and horizontal worker scaling.

Limitations

LimitationDetail
No crash recoveryIf the process exits mid-run, the run is lost — no replay, no resume
Single processNo horizontal worker scaling
In-memory conversation onlyRedis works technically, but split-process deployments require Temporal
No split client/workerDisableLocalWorker and NewAgentWorker require the Temporal runtime
These limits matter for production workloads where runs must survive deploys or scale independently. For those cases, see Temporal runtime.

When to use

ScenarioIn-process fit
Local development and unit testingIdeal
CI pipelines and integration testsIdeal
Simple API or script with short runsGood
Production chat with crash recovery requiredUse Temporal
Multi-process or horizontally scaled executionUse Temporal

Switch to Temporal

Add WithTemporalConfig — no other code changes:
a, err := agent.NewAgent(
    agent.WithTemporalConfig(&agent.TemporalConfig{
        Host: "localhost", Port: 7233,
        Namespace: "default", TaskQueue: "my-app",
    }),
    agent.WithLLMClient(llmClient),
    agent.WithSystemPrompt("You are a helpful assistant."),
)
A running Temporal server is required. See Temporal and Prerequisites.

Examples

Simple Agent

Minimal in-process agent with Run()

Stream

Streaming tokens and tool events in-process

Runtimes Overview

Compare in-process and Temporal

Quickstart

Build your first agent