# Swarms Agents

Builds agents and multi-agent workflows with the Swarms framework.

- Repository: https://github.com/kyegomez/swarms (7341 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add kyegomez/swarms --skill swarms -g -a claude-code -y`
Codex: `npx skills add kyegomez/swarms --skill swarms -g -a codex -y`
Cursor: `npx skills add kyegomez/swarms --skill swarms -g -a cursor -y`
Gemini CLI: `npx skills add kyegomez/swarms --skill swarms -g -a gemini-cli -y`

## Description

Build agents and multi-agent systems with the Swarms framework, the Agent class, tools, autonomous loops, memory, and the 15+ multi-agent architectures (SequentialWorkflow, ConcurrentWorkflow, GraphWorkflow, HierarchicalSwarm, SwarmRouter, and more). Use whenever writing, reviewing, or debugging code that imports `swarms`.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Swarms

Swarms is a multi-agent orchestration framework. Everything is built from one primitive, `Agent`, which multi-agent structures compose. This document is verified against **swarms v14.0.0**.

## Live documentation

This skill can lag the library. When a signature here disagrees with the installed version, check the current docs:

- Docs MCP server, no key: `https://docs.swarms.world/mcp` (`claude mcp add --transport http swarms-docs https://docs.swarms.world/mcp`)
- Marketplace MCP server, Swarms API key for calls: `https://swarms.world/mcp`
- Plain-text docs: [llms.txt](https://docs.swarms.world/llms.txt) (index), [llms-full.txt](https://docs.swarms.world/llms-full.txt) (every page)

## Golden rules

1. **Import from the top level**: `from swarms import Agent`, never `from swarms.structs.agent import Agent`. The one common exception is `PlannerWorkerSwarm` (see below).
2. **Every agent needs a unique `agent_name`**, memory files and swarm routing key on it.
3. **Default to `max_loops=1`.** Use a specific integer for production. Use `"auto"` only for genuinely open-ended work.
4. **Pass `tools=None`, not `tools=[]`.** An empty list breaks schema generation.
5. **Check `examples/`**, 586 runnable examples live there. One is probably close to what you need.
6. **Never set `streaming_on=True` and `streaming_callback` together.** Pick one.

## Setup

```bash
pip install -U swarms
```

Set the key for whichever provider you use, any [LiteLLM](https://docs.litellm.ai/docs/providers) model string works:

```bash
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GROQ_API_KEY="..."
export WORKSPACE_DIR="agent_workspace"   # where agent state and memory land
```

---

# Part 1, The Agent

```python
from swarms import Agent

agent = Agent(
    agent_name="Analyst",
    agent_description="Analyzes market data and produces summaries.",
    system_prompt="You are a precise financial analyst.",
    model_name="gpt-5.4",
    max_loops=1,
)

The rest: https://github.com/kyegomez/swarms/blob/HEAD//SKILL.md
