Skip to main content
Run commands from the examples/ directory unless noted otherwise. Complete Configuration first to set up your API key and environment.

Quick start

cd examples
go run ./simple_agent "Hello, what can you do?"

Credentials

Examples use LLM_APIKEY, LLM_PROVIDER, and LLM_MODEL from examples/.env (loaded with .env.defaults). The Quickstart uses provider-native names such as OPENAI_API_KEY in your own module. The CLI uses AGENT_LLM_* prefixes. Same SDK — different env conventions per entry point.

Local vs Temporal

ModeSettingBefore go run
Local (default)AGENT_RUNTIME=local or unsetNothing extra
TemporalAGENT_RUNTIME=temporaltask infra:temporal:up and task infra:temporal:wait

Example index

ExampleFeature guideRuntimeInfrastructure
Simple AgentQuickstartLocal, Temporal
Temporal ClientTemporalTemporalTemporal
Run AsyncApprovalsLocal, Temporal
JSON ResponseResponse formatLocal, Temporal
ReasoningReasoningLocal, Temporal
ToolsToolsLocal, Temporal
MCP ConfigMCPLocal, TemporalMCP server
MCP ClientMCPLocal, TemporalMCP server
StreamStreamingLocal, Temporal
ConversationConversationLocal, TemporalRedis
Stream + ConversationConversationLocal, TemporalRedis
AG-UIAG-UILocal, TemporalNode.js (UI)
MemoryMemoryLocal, TemporalWeaviate or pgvector
RetrievalRetrievalLocal, TemporalWeaviate or pgvector
ObservabilityTracingLocal, TemporalOTLP collector
HooksHooksLocal, Temporal
LogsLogsAll examples
A2A ServerA2ALocal, Temporal
A2A ConfigA2ALocal, TemporalA2A server
A2A ClientA2ALocal, TemporalA2A server
Sub-agentsSub-agentsLocal, Temporal
Multiple AgentsMultiple agentsTemporalTemporal
Agent WorkerWorker separationTemporalTemporal
Durable AgentTemporalTemporalTemporal

Suggested order

BasicsSimple AgentToolsStream Stateful agentsConversationMemory or Retrieval Production patternsTemporal ClientAgent WorkerDurable AgentAgent Chat IntegrationsMCP ConfigA2A ServerAG-UI

Task infrastructure

From examples/, use Taskfile.yml for Docker-backed dependencies:
TaskStarts
task infra:redis:upRedis
task infra:weaviate:upWeaviate
task infra:pgvector:upPostgres + pgvector
task infra:temporal:upTemporal dev server
task infra:lgtm:upOTLP collector (Grafana LGTM)
task infra:a2a:upSample A2A server
task infra:statusCheck running services
From the repository root: task examples:local, task examples:temporal, or task examples:all.

Logging

OutputDestination
Prompt and replystdout
SDK logsstderr (LOG_LEVEL)
SHOW_LLM_USAGE=true SHOW_TELEMETRY=true go run ./simple_agent "Hello"
See Logs.

Multi-process examples

ExampleTerminal 1Terminal 2
Agent Workergo run ./agent_with_worker/workergo run ./agent_with_worker/agent "..."
Durable Agentgo run ./durable_agent/workergo run ./durable_agent/agent
AG-UIgo run ./agent_with_agui/servercd agent_with_agui/ui && npm run dev

Configuration

Go, LLM key, env vars, Docker

Simple Agent

First example