examples/ directory unless noted otherwise. Complete Configuration first to set up your API key and environment.
Quick start
Credentials
Examples useLLM_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
| Mode | Setting | Before go run |
|---|---|---|
| Local (default) | AGENT_RUNTIME=local or unset | Nothing extra |
| Temporal | AGENT_RUNTIME=temporal | task infra:temporal:up and task infra:temporal:wait |
Example index
| Example | Feature guide | Runtime | Infrastructure |
|---|---|---|---|
| Simple Agent | Quickstart | Local, Temporal | — |
| Temporal Client | Temporal | Temporal | Temporal |
| Run Async | Approvals | Local, Temporal | — |
| JSON Response | Response format | Local, Temporal | — |
| Reasoning | Reasoning | Local, Temporal | — |
| Tools | Tools | Local, Temporal | — |
| MCP Config | MCP | Local, Temporal | MCP server |
| MCP Client | MCP | Local, Temporal | MCP server |
| Stream | Streaming | Local, Temporal | — |
| Conversation | Conversation | Local, Temporal | Redis |
| Stream + Conversation | Conversation | Local, Temporal | Redis |
| AG-UI | AG-UI | Local, Temporal | Node.js (UI) |
| Memory | Memory | Local, Temporal | Weaviate or pgvector |
| Retrieval | Retrieval | Local, Temporal | Weaviate or pgvector |
| Observability | Tracing | Local, Temporal | OTLP collector |
| Hooks | Hooks | Local, Temporal | — |
| Logs | Logs | All examples | — |
| A2A Server | A2A | Local, Temporal | — |
| A2A Config | A2A | Local, Temporal | A2A server |
| A2A Client | A2A | Local, Temporal | A2A server |
| Sub-agents | Sub-agents | Local, Temporal | — |
| Multiple Agents | Multiple agents | Temporal | Temporal |
| Agent Worker | Worker separation | Temporal | Temporal |
| Durable Agent | Temporal | Temporal | Temporal |
Suggested order
Basics — Simple Agent → Tools → Stream Stateful agents — Conversation → Memory or Retrieval Production patterns — Temporal Client → Agent Worker → Durable Agent → Agent Chat Integrations — MCP Config → A2A Server → AG-UITask infrastructure
Fromexamples/, use Taskfile.yml for Docker-backed dependencies:
| Task | Starts |
|---|---|
task infra:redis:up | Redis |
task infra:weaviate:up | Weaviate |
task infra:pgvector:up | Postgres + pgvector |
task infra:temporal:up | Temporal dev server |
task infra:lgtm:up | OTLP collector (Grafana LGTM) |
task infra:a2a:up | Sample A2A server |
task infra:status | Check running services |
task examples:local, task examples:temporal, or task examples:all.
Logging
| Output | Destination |
|---|---|
| Prompt and reply | stdout |
| SDK logs | stderr (LOG_LEVEL) |
Multi-process examples
| Example | Terminal 1 | Terminal 2 |
|---|---|---|
| Agent Worker | go run ./agent_with_worker/worker | go run ./agent_with_worker/agent "..." |
| Durable Agent | go run ./durable_agent/worker | go run ./durable_agent/agent |
| AG-UI | go run ./agent_with_agui/server | cd agent_with_agui/ui && npm run dev |
Related
Configuration
Go, LLM key, env vars, Docker
Simple Agent
First example