Go AI SDK
Build Bedrock and MCP-powered AI workflows in Go with tool loops and streaming.
Why this project
- Bedrock provider with multiple auth modes (profile, env, static creds, custom provider)
- MCP client module with stdio, SSE, and HTTP transport helpers
- Tool loop agent that can run with tools enabled or disabled
- Streaming APIs for both direct model calls and agent flows
- Independent modules so you can
go getonly what you need
Modular Install
go get github.com/iamanishx/go-ai/agentgo get github.com/iamanishx/go-ai/provider/bedrockgo get github.com/iamanishx/go-ai/mcpQuick Example
import ( "github.com/iamanishx/go-ai/agent" "github.com/iamanishx/go-ai/provider" "github.com/iamanishx/go-ai/provider/bedrock")
bedrockProvider := bedrock.Create(bedrock.BedrockProviderSettings{ Region: "us-east-1", Profile: "myprofile",})
toolAgent := agent.CreateToolLoopAgent(agent.ToolLoopAgentSettings{ Model: bedrockProvider.Chat("anthropic.claude-3-sonnet-20240229-v1:0"), Tools: []provider.Tool{ { Name: "get_weather", Description: "Get weather for a location", Parameters: map[string]interface{}{ "type": "object", "properties": map[string]interface{}{ "location": map[string]interface{}{"type": "string"}, }, "required": []string{"location"}, }, }, }, ExecuteTools: true,})
result, err := toolAgent.Generate(ctx, agent.AgentCallOptions{ Prompt: "What's the weather in San Francisco?",})
if err != nil { panic(err)}
_ = result.Text