Skip to the content.

Agent SDK Go

Build AI agents in Go: multiple LLM providers, function tools, MCP servers, agent handoffs, streaming and pluggable tracing.

go get github.com/pontus-devoteam/agent-sdk-go
provider := openai.NewProvider(os.Getenv("OPENAI_API_KEY"))
provider.SetDefaultModel("gpt-4o-mini")

assistant := agent.NewAgent("Assistant")
assistant.SetModelProvider(provider)
assistant.WithModel("gpt-4o-mini")
assistant.SetSystemInstructions("You are a helpful assistant.")

r := runner.NewRunner()
r.WithDefaultProvider(provider)

result, err := r.RunSync(assistant, &runner.RunOptions{Input: "Hello!"})

Documentation

Guide What it covers
Getting started Installation, your first agent, tools, streaming
Providers OpenAI, Azure OpenAI, Gemini, Anthropic, Amazon Bedrock, LM Studio
Multi-provider workflows Different LLM providers inside one multi-agent workflow
Handoffs Multi-agent workflows, agent naming rules, bidirectional flow
MCP Using Model Context Protocol servers as agent tools
Tracing The default file tracer and custom tracer implementations
Troubleshooting Common API errors and how to fix them

The API reference is published on pkg.go.dev.

Features

Source and issues

The SDK is developed on GitHub. Bug reports and feature requests are welcome in the issue tracker.