Swarms
Swarms is an enterprise-grade, production-ready multi-agent orchestration framework for Python. It provides prebuilt architectures like sequential, concurrent, and hierarchical systems to coordinate AI agents. It is for developers building scalable, reliable multi-agent applications.
✨ Key features
- Prebuilt multi-agent architectures: sequential, concurrent, hierarchical, graph, and more.
- Backward compatible with leading agent frameworks and protocols like MCP and x402.
- Agents with LLM, tools, memory, and autonomous max_loops='auto' mode.
- MCP integration: connect to external tools via URL with no manual config.
- 60+ multi-agent structures available.
- Supports dynamic flows with AgentRearrange and DAG-based GraphWorkflow.
🎯 Use cases
- Build research pipelines with sequential agents for research and writing.
- Run parallel analysis tasks with concurrent workflows.
- Orchestrate complex projects with graph-based dependencies.
- Create dynamic agent flows using string-based rearrangement.
- Integrate external tools via MCP servers for enhanced agent capabilities.
📦 Installation
🧰 Requirements: Python 3, pip or uv, and API keys for LLM providers (e.g., OPENAI_API_KEY) as needed.
Using pip
$ pip3 install -U swarms
Using uv (Recommended)
uv is a fast Python package installer and resolver, written in Rust.
$ uv pip install swarms
Using poetry
$ poetry add swarms
From source
# Clone the repository
$ git clone https://github.com/kyegomez/swarms.git
$ cd swarms
$ pip install -r requirements.txt
🚀 Usage
from swarms import Agent
# Initialize a new agent
agent = Agent(
model_name="gpt-5.4", # Specify the LLM
max_loops="auto", # Set the number of interactions
interactive=True, # Enable interactive mode for real-time feedback
temperature=None,
)
# Run the agent with a task
agent.run("What are the key benefits of using a multi-agent system?")
❓ FAQ
What is the recommended way to install Swarms?
The README recommends using uv (uv pip install swarms) as it is fast, but pip3 install -U swarms also works.
How do I enable MCP integration for an agent?
Set the mcp_url or mcp_urls parameter on the Agent to point to an MCP server URL, and the agent will automatically use tools from that server.
What is the difference between max_loops='auto' and a fixed value?
With 'auto', the agent decides when the task is complete, which is good for open-ended tasks. A fixed value is better for latency-sensitive or cost-sensitive pipelines with a known number of steps.
Can I run multiple agents in parallel?
Yes, use the ConcurrentWorkflow architecture to run agents simultaneously on the same task.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.