█

AI/TLDR

Buy me a coffee
Buy me a coffee

Swarms

Prebuilt sequential, concurrent and hierarchical multi-agent architectures in one Python package

Multi-Agent SystemsOpen source
Language
Python
License
Apache-2.0
$pip3 install -U swarms
IN SHORT

What is Swarms?

Swarms is an Apache-2.0 Python framework for orchestrating several LLM agents together. It sits in the Multi-Agent Systems category of the Agents & Automation tools and is open-source, written in Python and licensed Apache-2.0. To get started: install the package.

Overview

Swarms is an Apache-2.0 Python framework for orchestrating several LLM agents together. Its base unit is an Agent — an autonomous entity built from a model, tools and memory — and on top of that it ships a suite of prebuilt multi-agent architectures, including sequential, concurrent and hierarchical arrangements, so you assemble a known topology instead of inventing a control loop each time.

The framework is deliberately unopinionated about which model you run. An agent is configured with a `model_name` string, so the same swarm can be pointed at OpenAI, Anthropic or Groq models by changing configuration and environment keys. Agents can run for a fixed number of loops or with `max_loops="auto"`, in which case the agent keeps planning, acting and reflecting until it decides the task is finished — the mode the project recommends for open-ended work whose step count isn't known in advance.

Swarms treats the Model Context Protocol as a two-way street. Setting `mcp_url` or `mcp_urls` on an agent pulls in the tools an MCP server exposes with no manual wiring, and `MCPDeployer` turns any agent or swarm into an MCP server of its own, with an auth layer in front, so other agents and MCP hosts can call it as a tool. The project also states backward compatibility with other leading agent frameworks.

What it does

  • Prebuilt multi-agent architectures — sequential, concurrent and hierarchical — rather than a single hard-coded control flow
  • Provider-agnostic agents configured by a `model_name` string, with keys supplied through the environment
  • `max_loops="auto"` lets an agent decide for itself when a task is complete instead of stopping at a fixed iteration cap
  • MCP client support: point an agent at one or many MCP server URLs and its tools become available automatically
  • `MCPDeployer` serves any agent or swarm as an MCP server, with static API-key auth and one tool per target
  • Installable from PyPI with pip, uv or poetry, or run from source

Getting started

Swarms is a PyPI package. Install it, set the provider keys you plan to use in the environment, then build a single agent before composing several into a swarm.

Install the package

pip works, and the README recommends uv. Poetry and a from-source install are also documented.

bashbash
pip3 install -U swarms
# or, recommended:
uv pip install swarms

Configure the environment

Swarms reads provider keys and a workspace directory from the environment. Set only the providers you intend to call.

bashbash
OPENAI_API_KEY=""
WORKSPACE_DIR="agent_workspace"
ANTHROPIC_API_KEY=""
GROQ_API_KEY=""

Run your first agent

An Agent is the building block of every swarm. Give it a model and a loop budget, then call run with a task.

pythonpython
from swarms import Agent

agent = Agent(
    model_name="gpt-5.4",
    max_loops="auto",
    interactive=True,
    temperature=None,
)

agent.run("What are the key benefits of using a multi-agent system?")

Give the agent MCP tools

Setting mcp_url points the agent at an MCP server; its tools are discovered and offered to the agent without further configuration.

pythonpython
from swarms import Agent

agent = Agent(
    agent_name="MCP-Agent",
    model_name="claude-sonnet-5",
    mcp_url="https://mcp.deepwiki.com/mcp",
    max_loops=1,
    temperature=None,
    max_tokens=16_000,
)

print(agent.run("Use your tools to explain what the kyegomez/swarms repository does."))

Serve an agent as an MCP server

MCPDeployer exposes an agent (or a list or dict of them) as MCP tools behind an API key, so other agents and MCP hosts can call it.

pythonpython
from swarms import Agent, MCPDeployer

researcher = Agent(
    agent_name="Researcher",
    agent_description="Answers research questions with a short summary.",
    model_name="gpt-5.4",
    max_loops=1,
)

# Serves http://127.0.0.1:8000/mcp as the tool "researcher".
MCPDeployer(researcher, api_keys=["sk-local-dev"], port=8000).run()

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Compose a fixed pipeline of specialist agents — research, then draft, then review — using the prebuilt sequential architecture instead of hand-rolled queueing
  • Fan a task out across several agents concurrently and collect the results under one hierarchical coordinator
  • Give an existing agent a catalogue of external tools by pointing it at one or more MCP servers
  • Publish an in-house agent as an MCP tool so other teams' agents and MCP hosts can call it behind an API key

How Swarms compares

Swarms alongside other open-source multi-agent systems tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Paperclip★ 118kA self-hosted control plane that runs a team of AI agents like a company, with an org chart, tasks, budgets and approvals.
Ruflo★ 82.7kAgent meta-harness that wraps Claude Code and Codex with 100+ specialized agents, swarm coordination, vector memory, background workers and cross-machine agent federation.
MetaGPT★ 71.5kA multi-agent framework that models a software company, assigning roles like product manager, architect, and engineer to generate code from a single prompt.
AutoGen★ 62kMicrosoft Research's framework for building applications where multiple agents converse with each other and with tools to solve tasks.
CrewAI★ 61.4kA framework for assembling teams ('crews') of role-playing agents that divide tasks and collaborate to complete a goal.
AgentScope★ 36.9kA framework for building multi-agent applications with message passing, visual debugging tools, and distributed execution.
OpenAI Agents SDK★ 30.9kOpenAI's lightweight Python SDK for building multi-agent workflows using explicit handoffs, tools, and guardrails.
Swarms★ 7.4kPrebuilt sequential, concurrent and hierarchical multi-agent architectures in one Python package