Swarm Go banner
feiskyer feiskyer

Swarm Go

Development community

Description

An ergonomic, lightweight multi-agent orchestration in Go

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Swarm

An **ergonomic** and **lightweight** multi-agent orchestration framework inspired by [OpenAI's Swarm](https://github.com/openai/swarm). Designed for simplicity and efficiency, this framework empowers developers to build scalable and flexible multi-agent systems in Go.

**Features:**

  • 🚀 Lightweight Orchestration: Efficiently manage multi-agent systems with a minimalistic and performant design. Perfect for applications where simplicity and speed are critical.
  • 🛠️ Native Function Calls: Seamlessly integrate with your existing tools and services using native Go function calls. No complex wrappers or unnecessary abstractions—just straightforward integration.
  • Event-Driven Workflows: Build extensible and dynamic workflows driven by events. This approach ensures flexibility and adaptability for automating complex processes.
  • 🧩 Composable Architecture: Create sophisticated systems by combining simple, reusable components. The framework’s modular design encourages clean and maintainable code.

Getting Started

Add swarm to go mod by:

go get -u github.com/feiskyer/swarm-go

Examples

Setup environment variables first:

  • For OpenAI, set OPENAI_API_KEY and optional OPENAI_API_BASE for OpenAI API compatible AI service.
  • For Azure OpenAI, set AZURE_OPENAI_API_KE and AZURE_OPENAI_API_BASE.
Basic Agent

A [basic agent](demo/basic/) with function calls:

package main

import (
    "fmt"
    "reflect"

    "github.com/feiskyer/swarm-go"
)

func main() {
    // Create a new agent
    agent := swarm.NewAgent("Assistant")
    agent.WithModel("gpt-4o").
        WithInstructions("You are a helpful assistant.")

    // Example function that the agent can call
    weatherFunc := swarm.NewAgentFunction(
        "getWeather",
        "Get the current weather for a given location. Requires a location parameter.",
        func(args map[string]interface{}) (interface{}, error) {
            location, ok