Skip to content

Examples

The examples/ module contains six small, runnable harnesses. Each isolates one pattern; each has its own README; most accept -scripted and run a deterministic fake client so you can watch the machinery without an API key.

ExampleWhat it demonstrates
healthcheckA world-verifying goal: the agent probes a fake server farm until every endpoint reports healthy. Schema + fan-out guardrails policing the calls.
releasegatePre/post guardrails around a workflow: the agent may only publish after every required check is green, and the goal confirms the publish actually happened.
hnupvoteBrowser automation under pursue: a real chromedp session where the oracle is verified world state and a login wall forces the re-drive path.
spawn_workerHierarchical decomposition: a coordinator delegates to researcher / reviewer / coder sub-agents with per-mode tool gating and a depth cap.
stuck_recoveryThe decompose guardrail’s graduated response — pass, advisory, fatal — as an agent repeats a failing search, then recovers by delegating.
long_conversationCompactor integration: a pressure-gated compactor keeps a long exploration inside the context window without orphaning tool calls.
Terminal window
# deterministic, no LLM
go run ./examples/healthcheck -scripted
# real provider — flags are uniform across examples
go run ./examples/healthcheck -provider anthropic -model claude-sonnet-4-6
go run ./examples/releasegate -provider llamacpp

Provider selection goes through the same backends registry as everything else: -provider names a builtin, keys come from the standard env vars, -base-url (or LLAMACPP_BASE_URL etc.) overrides endpoints.

Start with healthcheck — it’s the smallest complete loop with a real goal. Then releasegate for guardrails as policy, and stuck_recovery for what graduated advisories look like in practice. hnupvote is the one to read when you want to see pursue driving something genuinely flaky (a browser) to a verified outcome.

Each example’s README walks through its harness construction; examples/patterns.md in the repo collects the recurring shapes — scripted clients, fake filesystems, oracle design — you’ll reuse in your own harnesses.