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
- Multiple LLM providers - OpenAI, Azure OpenAI, Gemini, Anthropic, Amazon Bedrock and LM Studio, mixable inside a single workflow
- Tool integration - call Go functions directly from the model
- MCP support - attach the tools of any MCP server over stdio or HTTP
- Agent handoffs - route work to specialized agents, including bidirectional delegation with task tracking
- Structured output - parse responses into Go structs
- Streaming - stream content, tool calls and handoffs as they happen
- Pluggable tracing - keep the default file trace or ship events to your own observability stack
- Workflow state management - persist and restore state between runs
Source and issues
The SDK is developed on GitHub. Bug reports and feature requests are welcome in the issue tracker.