Agent SDK for Go

July 7, 2026 ยท View on GitHub

CI Release Go Reference License Mentioned in Awesome Go

Open-source Go SDK for building production-grade AI agents โ€” extensible and pluggable by design. Run in-process with zero setup, or on Temporal for durable, crash-resilient production execution.

๐Ÿ“– Documentation ย ยทย  Quickstart ย ยทย  Examples

Versioning: Semantic versioning; releases are git tags. See the latest release.

Independent community library โ€” not affiliated with Temporal Technologies.

Install

go get github.com/agenticenv/agent-sdk-go@latest

Go 1.26+. No infrastructure required for in-process mode. A running Temporal server is required for durable execution.

Quick Start

In-process (zero setup):

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()

result, _ := a.Run(context.Background(), "Hello", nil)
fmt.Println(result.Content)

Temporal (durable, production):

a, _ := agent.NewAgent(
    agent.WithTemporalConfig(&agent.TemporalConfig{
        Host: "localhost", Port: 7233,
        Namespace: "default", TaskQueue: "my-app",
    }),
    agent.WithSystemPrompt("You are a helpful assistant."),
    agent.WithLLMClient(llmClient), // same llmClient as above
)
defer a.Close()

result, _ := a.Run(context.Background(), "Hello", nil)
fmt.Println(result.Content)

Features

  • LLM providers โ€” OpenAI, Anthropic, Gemini, DeepSeek + custom via interfaces.LLMClient
  • Tools & MCP โ€” built-in and custom tools; MCP servers over stdio or streamable HTTP
  • A2A โ€” expose agents as A2A servers or connect remote A2A agents as tools
  • Sub-agents โ€” delegate to specialist agents with independent LLMs, tools, and task queues
  • Human-in-the-loop approvals โ€” gate tool calls, MCP invocations, and delegation
  • Conversation history โ€” multi-turn sessions via in-memory or Redis backends
  • Memory & RAG โ€” long-term scoped memory and retrieval-augmented generation
  • Streaming & AG-UI โ€” partial token streaming; AG-UI protocol for frontend integration
  • Reasoning โ€” extended thinking on Anthropic, Gemini, DeepSeek, and OpenAI reasoning models
  • Token usage โ€” aggregate prompt, completion, and reasoning token counts per run
  • Hooks & guardrails โ€” middleware at LLM, tool, retrieval, and memory lifecycle points
  • Execution config โ€” per-operation timeouts and max attempts via With*ExecutionConfig
  • Durable execution โ€” crash-resilient runs via Temporal; horizontal worker scaling
  • Observability โ€” OpenTelemetry traces, metrics, and structured logs

Reference Apps

  • Agent Chat โ€” web chat demo with durable conversations; reference for wiring the SDK into an HTTP-backed app.

Examples

Runnable examples in [examples/](examples/) โ€” see [examples/README.md](examples/README.md) for setup and run instructions.

Benchmarks

Config-driven benchmark runner โ€” see benchmarks/README.md

Eval Harness

Evaluate agent quality with Promptfoo and DeepEval โ€” locally or in CI. See eval-harness/README.md

Development

See CONTRIBUTING.md for setup, workflow, and guidelines. Project policies: SECURITY.md ยท CODE_OF_CONDUCT.md

Quick commands: make check | make test | make lint | make fmt | make tidy | make test-coverage

Coverage reports (PR and default branch) are on Codecov. Run make test-coverage locally to produce coverage.out and coverage.html.

License

Apache 2.0

Disclaimer

This project is provided "as is" under the Apache License 2.0. When building AI agents that execute real-world actions, ensure appropriate safeguards, validation, and human-in-the-loop approval workflows are in place. You are responsible for compliance, access control, and operational safety in your deployment. For security issues, follow SECURITY.md.