Agent SDK for Go
Build durable Go AI agents that resume exactly where they left off after a crash or restart.
- Source repo
- agenticenv/agent-sdk-go
- Stars
- ★ 68
- Last updated
- 1d ago
- FARS reviewed
- Nov 23, 2026
- License
- Apache-2.0
- Primary language
- Go
- FA score
- 71/100 · Some gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API · Claude API
- Cost
- Free software; you pay for model usage
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- Backend teams running long agent workflows that must not lose progress or re-pay for completed tool calls after a crash.
- Not a fit if
- Teams not building in Go
- Users who want a ready-made GUI rather than an SDK
- Website
- docs.agenticenv.ai ↗ set on GitHub
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-22
- Source review
- 71/100 · Some gaps
What does this agent do, and when should you use it?
Agent SDK for Go is an open-source SDK from agenticenv for building AI agents whose state, tool calls, and execution loops survive process crashes. By default it journals in-process through durable-go with no infrastructure at all; when you need distributed, multi-process execution you switch the same agent to a Temporal or Restate runtime. Every core component is a pluggable interface, covering LLM clients, tools, memory backends, and policy. The API revolves around Run, Stream, and GetAgentStream, with AG-UI events and offset-based stream resumption after a restart. The repository also ships the agctl CLI, runnable examples, a benchmark runner, and a Promptfoo/DeepEval eval harness, all under Apache-2.0.
You create an agent with agent.NewAgent, combining a system prompt, an LLM client such as openai.NewClient, and a runtime config. a.Run returns a handle you wait on with Done or Get; a.Stream returns an event channel carrying AgentTextMessageContentEvent, AgentToolCallStartEvent, AgentCustomEvent (including tool and delegation approvals), and RunFinished. The agent can invoke built-in or custom tools, connect MCP servers over stdio or streamable HTTP, treat remote A2A agents as tools, and delegate to sub-agents that carry their own LLM, tools, and task queue. Governance is enforced during execution: an action policy allows, denies, modifies, steps up, or defers each tool call and emits signed audit receipts, while budget caps, guardrails, lifecycle hooks, fallback LLMs, a single extra-iteration grant, and per-tool circuit breakers bound failure and spend. The local runtime journals to ./agent_data/<agent_name> and is tunable via local.WithLocalConfig (data dir, auto-purge age, timeout, or durability off). The Temporal runtime separates client triggers from workers; the Restate runtime scales through registered endpoint deployments. Runs can be rejoined with a.GetAgentStream plus agent.WithOffset.
- Backend teams running long agent workflows that must not lose progress or re-pay for completed tool calls after a crash.
- Go shops that want LLM tool calling embedded in their existing services rather than adding a Python stack.
- Business systems where sensitive tools (payments, deletions) require a human approval gate before execution.
- Teams exposing internal capabilities as an A2A server, or consuming remote A2A agents as tools.
- Developers who need AG-UI protocol events to drive a frontend chat interface.
- Engineers who want Promptfoo and DeepEval quality checks wired into CI.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Environment variables
AGCTL_LLM_APIKEY- Runtime
- Go 1.26
How do you install or deploy this agent?
Requires Go 1.26 or newer. Install the library through Go modules:
go get github.com/agenticenv/agent-sdk-go@latestThe agctl CLI is distributed as a binary on GitHub Releases; extract it and put it on your PATH:
export AGCTL_LLM_APIKEY=sk-your-key
agctl run --model gpt-4o --prompt "hello"No extra services are needed for the default in-process runtime. A Temporal or Restate server is only required for distributed execution; see temporal-setup.md and restate-setup.md in the repository.
How do you use this agent?
A minimal working agent with an OpenAI model:
import (
"context"
"fmt"
"github.com/agenticenv/agent-sdk-go/pkg/agent"
"github.com/agenticenv/agent-sdk-go/pkg/llm"
"github.com/agenticenv/agent-sdk-go/pkg/llm/openai"
)
llmClient, _ := openai.NewClient(
llm.WithAPIKey("sk-..."),
llm.WithModel("gpt-4o"),
)
a, _ := agent.NewAgent(
agent.WithSystemPrompt("You are a helpful assistant."),
agent.WithLLMClient(llmClient),
)
defer a.Close()
run, _ := a.Run(context.Background(), "Reply with a short greeting.", nil)
result, _ := run.Get(context.Background())
fmt.Println(result.Content)To move to Temporal, import pkg/agent/runtime/temporal and pass temporal.WithTemporalConfig with Host, Port, Namespace, and TaskQueue. To resume a stream after a restart, persist stream.ID() first, then call a.GetAgentStream with agent.WithOffset(savedOffset). The local runtime only supports replay from the start, not WithOffset(n>0).
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
Inherits capabilities of connected MCP servers; audit third-party servers before enabling.
FARS trust-control audit
- confirmation before acting
What are this agent's strengths and limitations?
- Durability works out of the box with zero infrastructure: the local runtime journals to ./agent_data/<agent_name>.
- Runtime portability is real: the same Run/Stream/GetAgentStream surface moves between local, Temporal, and Restate without rewriting agent code.
- Governance primitives ship in the framework itself: action policy with signed audit receipts, budget caps, guardrails, and per-tool circuit breakers.
- Broad protocol coverage is documented, with MCP, A2A, and AG-UI each backed by concrete feature descriptions and examples.
- Provider neutral: OpenAI, Anthropic, Gemini, DeepSeek, Ollama, plus custom clients via interfaces.LLMClient.
- Hard requirement on Go 1.26+, so Python or TypeScript teams cannot reuse their existing agent code.
- Local runtime is a weaker platform for stream recovery: no WithOffset(n>0), and replay coalesces completed steps into one message each instead of the token-level stream.
- Temporal and Restate are mutually exclusive, and both add server infrastructure and operational overhead compared with the default local mode.
- The project describes itself as an independent community library with no affiliation to Temporal Technologies or Restate, so vendor support is on you.
- agctl installation relies on prebuilt release binaries; the README does not show how to build it locally or list supported platforms.
How does this agent compare with similar options?
The README frames the local runtime as one of three interchangeable execution backends: local mode needs no infrastructure but has limited reconnect, Temporal decouples client triggers from worker execution across processes, and Restate scales through registered endpoint deployments. Because the agent API is identical across them, switching is a runtime-config change rather than a rewrite.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Agent SDK for Go This agent | 71 · Some gaps | Library / SDKFree + model costs | ★ 68 | 1d ago | Go | OpenAI API · Claude API |
| Deuz SDK | 76 · Good | Library / SDKFree + model costs | ★ 508 | 1mo ago | TypeScript | OpenAI API · Claude API |
| AgentLoom | 69 · Some gaps | — | ★ 168 | 10d ago | Python | OpenAI API |
| Synapse AI — Multi-Agent Orchestration Platform | 58 · Major gaps | CLIFree + model costs | ★ 343 | 2d ago | Python | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
Approval evidence is strong: default RequireAllToolApprovalPolicy, Allowlist and Auto policies, Run via Respond and Stream via Approve, with ErrApprovalAlreadyResolved handling for timeout/duplicate, so user_confirmation scores 3. least_privilege is only 2: AutoToolApprovalPolicy and the README streaming example that auto-approves weaken least privilege, and MCP stdio spawns local processes with only documentary trust guidance. data_flow_transparency and sensitive_data_handling are 2: SECURITY.md covers API keys not persisted, prompt-caching residency, and MCP trust, but there is no concrete redaction evidence for logs/telemetry. dependency_security is 2: Dependabot, govulncheck, CodeQL and a Release hard-fail exist, but the dependency surface is very broad (Temporal, Restate, Weaviate, pgvector) with no pinned audit results. external_effects and rollback are 2: local Close cancels all in-flight runs irreversibly and only kill -9 leaves runs resumable, so rollback semantics are limited. source_attribution is 1: README states it is an independent community library not affiliated with Temporal/Restate, but publisher identity is unverified and attribution is thin.
self_consistency is 2: README, quickstart and approvals docs agree on Run/Stream/Close semantics and distinguish local vs Temporal/Restate Close behavior; however Go 1.26+ in docs vs go 1.26.11 in go.mod is a minor mismatch and some API detail lives only on the external docs site. dependency_availability is 2: dependencies are public and versioned, but the list is large and includes recent majors (openai-go/v3, a2a-go/v2) not verified in-packet. failure_messages is 2: docs give ErrApprovalAlreadyResolved, ErrBudgetExceeded, LLMError classification and errors.As guidance, but the source sample does not show full error-path implementation.
audience_and_scenarios is 3: covers quickstart, tools, MCP, A2A, sub-agents, approvals, budget, observability, three runtimes and a CLI. capability_boundaries is 2: SKILL.md lists capabilities and workflows but does not systematically state unsupported cases or boundary conditions. trigger_precision is 2: the SKILL.md description trigger is broad (config, tools, runtimes) and may over-trigger. environment_fit is 2: Go 1.26+, API key, Docker/Task/Node optional deps are stated, but Go 1.26 is a high bar.
information_architecture is 3: README, docs tree, features/examples/getting-started layering and SKILL.md index are clear. install_notes is 3: go get, env vars, .env load order and optional dependency table are complete. naming_stability is 2: With* option naming is consistent, but v2/v3 dependency majors and module replace limit stability evidence. examples_and_faq is 3: many runnable examples with expected output. known_limitations is 2: docs mention local lacking WithOffset(n>0) and Close cancelling in-flight runs, but limitations are not centrally listed. license is 3: full Apache-2.0 text present and consistent with README. versioning_changelog is 2: SemVer and release notes are claimed, but no in-packet CHANGELOG. maintenance_responsibility is 1: SECURITY.md gives supported versions and response times, but the publisher is unverified and the maintaining entity is unclear.
output_usability is 3: example code is complete, copyable, with expected output and error handling. marginal_value is 2: a durable Go agent framework has clear value, but Temporal/Restate ecosystems already offer similar options and incremental value needs verification. cost_benefit is 2: broad dependencies, high Go version requirement, LLM key and optional infrastructure make adoption costly, with benefit scenario-dependent.
claim_traceability is 2: most README features map to docs and examples, but claims like crash recovery and distributed execution are documentary assertions without in-packet test evidence. cross_source_corroboration is 2: README, quickstart, approvals and configuration corroborate each other, but the source sample is only cli/main.go and eval-harness/runner/main.go, not core implementation. fact_inference_separation is 2: SECURITY.md separates SDK-provided hooks from caller responsibility, but some capability descriptions and implementation boundaries are not clearly separated.
- Publisher identity is unverified; the maintaining entity and update path are unclear, so verify provenance before production adoption.
- Default RequireAll approval is safe, but AutoToolApprovalPolicy and the README streaming auto-approve example weaken least privilege; use with care.
- Local runtime Close cancels all in-flight runs irreversibly and only kill -9 leaves runs resumable, so rollback semantics are limited.
- The dependency surface is very broad with recent majors; run govulncheck and audit the supply chain yourself.
- Go 1.26+ is a high bar, and docs vs go.mod versions show a minor mismatch.
- Core implementation is not in the packet; crash-recovery and distributed claims are documentary only and not execution-verified.
FAQ
Do I get crash recovery without running Temporal or Restate?
Can I enable Temporal and Restate at the same time?
Who pays for the model calls?
Which model providers are supported?
How do I stop a misbehaving tool from causing damage?
Is Agent SDK for Go free?
Is Agent SDK for Go open source?
Is Agent SDK for Go safe to use?
Is Agent SDK for Go still maintained?
Who makes Agent SDK for Go?
What is Agent SDK for Go's official website?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.