Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
SwarmGo (agents-sdk-go) is a Go package that allows you to create AI agents capable of interacting, coordinating, and executing tasks. Inspired by OpenAI's Swarm framework, SwarmGo focuses on making agent coordination and execution lightweight, highly controllable, and easily testable.
| Date | Stars |
|---|---|
| 2026-07-31 | 363 |
| 2026-08-06 | 363 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day

# SwarmGo (agents-sdk-go)
SwarmGo is a Go package that allows you to create AI agents capable of interacting, coordinating, and executing tasks. Inspired by OpenAI's Swarm framework, SwarmGo focuses on making agent coordination and execution lightweight, highly controllable, and easily testable.
It achieves this through two primitive abstractions: Agents and handoffs. An Agent encompasses instructions and tools (functions it can execute), and can at any point choose to hand off a conversation to another Agent.
These primitives are powerful enough to express rich dynamics between tools and networks of agents, allowing you to build scalable, real-world solutions while avoiding a steep learning curve.
## Table of Contents
- [Why SwarmGo](#why-swarmgo)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Creating an Agent](#creating-an-agent)
- [Running the Agent](#running-the-agent)
- [Adding Functions (Tools)](#adding-functions-tools)
- [Using Context Variables](#using-context-variables)
- [Memory Management](#memory-management)
- [Agent Handoff](#agent-handoff)
- [Streaming Support](#streaming-support)
- [Concurrent Agent Execution](#concurrent-agent-execution)
- [LLM Interface](#llm-interface)
- [Workflows](#workflows)
- [1. Supervisor Workflow](#1-supervisor-workflow)
- [2. Hierarchical Workflow](#2-hierarchical-workflow)
- [3. Collaborative Workflow](#3-collaborative-workflow)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)
- [Acknowledgments](#acknowledgments)
## Why SwarmGo
SwarmGo explores patterns that are lightweight, scalable, and highly customizable by design. It's best suited for situations dealing with a large number of independent capabilities and instructions that are difficult to encode into a single prompt.
SwarmGo runs (almost) entirely on the client and, much like the Chat Completions API, does not store state between calls.
## Installation
```bash
go get github.com/prathyushnallamothu/swarmgo
```
## Quick Start
Here's a simple example to get you started:
```go
package main
import (
"context"
"fmt"
"log"
swarmgo "github.com/prathyushnallamothu/swarmgo"
openai "github.com/sashabaranov/go-openai"
llm "github.com/prathyushnallamothu/swarmgo/llm"
)
func main() {
client := swarmgo.NewSwarm("YOUR_OPENAI_API_KEY", llm.OpenAI)
agent := &swarmgo.Agent{
Name: "Agent",
Instructions: "You are a helpful assistant.",
Model: "gpt-3.5-turbo",
}
messages := []openai.ChatCompletionMessage{
{Role: "user", Content: "Hello!"},
}
ctx := context.Background()
response, err := client.Run(ctx, agent, messages, nil, "", false, false, 5, true)
if err != nil {
log.Fatalf("Error: %v", err)
}
fmt.Println(response.Messages[len(response.Messages)-1].Content)
}
```
## Usage
### Creating an Agent
An Agent represents an AI assistant with specific instructions and functions (tools) it can use.
```go
agent := &swarmgo.Agent{
Name: "Agent",
Instructions: "You are a helpful assistant.",
Model: "gpt-4o",
}
```
- Name: Identifier for the agent (no spaces or special characters).
- Instructions: The system prompt or instructions for the agent.
- Model: The OpenAI model to use (e.g., "gpt-4o").
### Running the Agent
To interact with the agent, use the Run method:
```go
messages := []openai.ChatCompletionMessage{
{Role: "user", Content: "Hello!"},
}
ctx := context.Background()
response, err := client.Run(ctx, agent, messages, nil, "", false, false, 5, true)
if err != nil {
log.Fatalf("Error: %v", err)
}
fmt.Println(response.Messages[len(response.Messages)-1].Content)
```
### Adding Functions (Tools)
Agents can use functions to perform specific tasks. Functions are defined and then added to an agent.
### Defining a Function
```go
func getWeather(args map[string]interface{}, contextVariables map[string]interface{}) swarmgo.Result {
location := args["locatioExcerpt of 15,485 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:367af33652e51c3b, llm:description: 'SwarmGo (agents-sdk-go) is a Go package that allows you to create AI agents capable of interacting, coordinating, and executing tasks. Inspired by OpenAI's Swarm framework, SwarmGo focuses on making agent coordination and execution lightweight, highly controllable, and easily testable.'
matched fp:367af33652e51c3b, llm:description: 'SwarmGo (agents-sdk-go) is a Go package that allows you to create AI agents capable of interacting, coordinating, and executing tasks. Inspired by OpenAI's Swarm framework, SwarmGo focuses on making agent coordination and execution lightweight, highly controllable, and easily testable.'