AGNT5 Go SDK

Build typed AGNT5 workers, durable workflows, and runtime clients in Go. The
SDK supports push and pull workers, checkpointed workflow steps, streaming,
batches, tools, agents, MCP, evaluation, sandbox interfaces, and structured
runtime events.
Requirements
- Go 1.26.5 or newer
- An AGNT5 runtime for deployed execution
Installation
The module path is github.com/agnt5dev/sdk-go:
go get github.com/agnt5dev/sdk-go@latest
Quick start
Register typed functions and workflows with a worker:
package main
import (
"context"
"log"
"github.com/agnt5dev/sdk-go/agnt5"
)
type GreetInput struct {
Name string `json:"name"`
}
type GreetOutput struct {
Message string `json:"message"`
}
func main() {
worker := agnt5.NewWorker("hello-go")
err := agnt5.RegisterFunction(
worker,
"greet",
func(ctx *agnt5.Context, input GreetInput) (GreetOutput, error) {
ctx.Logger().Info("greeting user", "name", input.Name)
return GreetOutput{Message: "Hello, " + input.Name + "!"}, nil
},
)
if err != nil {
log.Fatal(err)
}
if err := worker.Run(context.Background()); err != nil {
log.Fatal(err)
}
}
See examples/quickstart for a runnable function and a
workflow with a durable step.
Invoke a deployed component
client, err := agnt5.NewClient(
"https://gw.agnt5.com",
agnt5.WithAPIKey("agnt5_sk_..."),
agnt5.WithClientDeploymentID("deployment-id"),
)
if err != nil {
log.Fatal(err)
}
response, err := client.Run(
context.Background(),
"greet",
GreetInput{Name: "Ada"},
)
if err != nil {
log.Fatal(err)
}
var output GreetOutput
if err := response.DecodeOutput(&output); err != nil {
log.Fatal(err)
}
The client also supports submission and polling, SSE streams, batches,
cancellation, workflow resume, chat, and evaluation.
Worker configuration
| Variable |
Purpose |
AGNT5_COORDINATOR_ENDPOINT |
Worker coordinator endpoint |
AGNT5_ENGINE_URL |
Direct engine endpoint for checkpoints and events |
AGNT5_PROJECT_ID |
Project identity used by workers |
AGNT5_DEPLOYMENT_ID |
Deployment routing identity |
AGNT5_WORKER_MODE |
push or pull dispatch mode |
AGNT5_MAX_CONCURRENCY |
Maximum concurrent work |
AGNT5_API_KEY |
Service key used by the client |
AGNT5_GATEWAY_URL |
Gateway base URL used by the client |
See the package configuration types for retry, slot, lease, queue, and
streaming controls.
Examples
The shared Rust foundation and cross-SDK conformance contracts live in
agnt5dev/sdk-core.
Development
gofmt -w .
go vet ./...
go test ./...
Contributing
See CONTRIBUTING.md. Report security issues according to
SECURITY.md.
License
Licensed under the Apache License 2.0.