Skip to main content
The benchmarks directory contains a standalone performance utility for Agent SDK for Go. It runs real agent.NewAgent execution loops under configurable load — mock LLM and tools by default — so you can measure latency, memory, CPU, token counts, and success rate without external API keys. Use it to stress-test orchestration behavior (multi-turn runs, tool batches, sub-agents, local vs Temporal runtime) before pointing the same harness at real LLMs and tools.

Prerequisites

Clone the SDK repository and run from the repository root:
Requires Go 1.26+. No LLM API key for default mock runs. Temporal scenarios need a running Temporal server.

What it measures

Most agent benchmarks focus on token throughput alone. Production workloads also depend on orchestration scaling: concurrent runs, multi-turn tool loops, sub-agent delegation, durable Temporal workflows, and stable memory use over hundreds of executions. Each benchmark session reports: Reports are written to benchmarks/reports/ (JSON or text). Optional SDK logs go to benchmarks/logs/.

Quick start

From the repository root:
Uses benchmarks/config.yaml by default — 100 sequential runs, local runtime, 3 tools, 2 sub-agents. Custom config:

How each run works

Each run calls agent.Run() once on a shared root agent. The mock LLM follows a fixed two-turn script:
  1. Turn 1 — returns tool calls for all registered tools (and sub-agent tools when configured)
  2. Turn 2 — returns final text after tool results are applied
Mock components apply configurable latency and jitter: Concurrency: one root agent is reused. When concurrent: true, runs execute in batches of concurrent_count goroutines.

Example scenarios

Fast local smoke test:
Concurrent batches:
Temporal runtime — requires a running Temporal server:
External root workers (workers_count: 1+) — spawns separate worker processes that also poll the root agent’s task queue:
Manual worker:

Configuration reference

All paths in config are relative to the repository root unless absolute.

runtime

agent

llm / tool

memory

In-process inmem backend — no Docker required. Disabled by default.

output

logger

Sample output

A default run (100 sequential runs, 3 tools, 2 sub-agents, local runtime) produces a text report like:
JSON format (output.format: json) emits the same data as a structured object — suitable for CI assertion scripts and trend dashboards. Good results: success_rate: 100%, p99 latency within your SLO, heap stable across the run (not growing linearly with run count).

Real LLM and tools

LLM and tool calls are mocked by default for reproducible, zero-cost runs. To benchmark with real providers, replace the mock client and tool registry in benchmarks/setup/ — the harness structure (runs, concurrency, reporting, Temporal workers) stays the same. Latency, token counts, and cost will follow your provider; configure pricing separately for est_cost_usd.

Eval Harness

Behavioral regression without live LLM

Telemetry

Per-run metrics in benchmark telemetry