About this project

Swarms is a Python framework for building and orchestrating multi-agent systems. It ships a set of prebuilt orchestration architectures and a common Agent abstraction, so the same agents can be reused across different collaboration strategies. Core building blocks - Agent: an LLM-backed entity with tools and memory, configured by model name, system prompt, loop count and related options. Setting max_loops="auto" lets the agent decide when a task is complete instead of stopping after a fixed number of iterations. - Workflows: SequentialWorkflow chains agents so each output feeds the next; ConcurrentWorkflow runs agents in parallel on the same task; AgentRearrange expresses non-linear flows with a string syntax such as "a -> b, c"; GraphWorkflow models agents as nodes in a DAG with explicit edges, entry and end points, automatic topological ordering and parallel independent branches. - Higher-level patterns: MixtureOfAgents runs expert agents in parallel and synthesizes results with an aggregator; GroupChat supports conversational collaboration; ForestSwarm selects suitable agents or agent trees for a task; HierarchicalSwarm uses a director that plans and distributes work to specialized workers; HeavySwarm describes a multi-phase research and analysis workflow; SwarmRouter exposes one interface to run any supported swarm type by changing a parameter. - AutoSwarmBuilder generates agents, prompts and workflow structure from a task description, optionally returning the generated agent configurations. Interoperability Agents can consume external tools through the Model Context Protocol by setting an MCP server URL, and MCPDeployer can expose an agent, swarm or function as an MCP server with configurable authentication (static API keys, custom auth callables, or token verifiers with scopes) and HTTP, SSE or stdio transports. The README also mentions backward compatibility with other agent frameworks and protocols such as x402 and skills. Installation and usage Install via pip, uv or poetry, or from source. Configuration is primarily through environment variables such as API keys and a workspace directory. Examples in the README cover a first agent, an autonomous agent, MCP client and server setups, and several swarm architectures. The project is distributed as a PyPI package and links to documentation, a website and a marketplace for further material.