NewAgent per role, each with its own distinct WithName.
NewAgent and NewAgentWorker for a given agent so client and worker pair correctly.
Restate
Same process: set a distinctEndpoint.ListenAddress per agent.
WithSubAgents. Sub-agent names must differ from the root agent name.
Same process, concurrent runs
Single agent, multiple requests
A singleAgent instance handles concurrent Run and Stream calls from different goroutines. Each call gets its own unique Temporal workflow (or in-process goroutine) — no serialisation, no queuing.
Agent object is all you need.
Example: Concurrent Runs.
Multiple agents, concurrent runs
Shared vs separate resources
Distributed execution with multiple agents
When splitting client and worker:- Create one
NewAgentWorkerper agent - Pass matching options to each worker and its corresponding
NewAgent - Use Redis conversation when any agent uses remote workers
In-process runtime
Multiple in-process agents (no Temporal/Restate) are also supported — omit Temporal and Restate options on eachNewAgent. Each agent runs its loop inside your Go process. Use this for development and single-process deployments.
See In-Process runtime.
Examples
Concurrent Runs
Fan-out on a single Agent instance
Multiple Agents
Several agents in one process
Related
Sub-agents
Orchestrator + specialist pattern
Distributed Execution
Client and worker pairing