swarms


Nameswarms JSON
Version 8.0.0 PyPI version JSON
download
home_pagehttps://github.com/kyegomez/swarms
SummarySwarms - TGSC
upload_time2025-07-18 22:14:04
maintainerNone
docs_urlNone
authorKye Gomez
requires_python<4.0,>=3.10
licenseMIT
keywords artificial intelligence deep learning optimizers prompt engineering swarms agents llms transformers multi-agent swarms of agents enterprise-grade agents production-grade agents agents multi-grade-agents swarms transformers llms prompt engineering agents generative agents generative ai agent marketplace agent store quant finance algorithmic trading portfolio optimization risk management financial modeling machine learning for finance natural language processing for finance
VCS
bugtrack_url
requirements torch transformers asyncio toml pypdf ratelimit loguru pydantic tenacity rich psutil python-dotenv PyYAML docstring_parser black ruff types-toml types-pytz types-chardet mypy-protobuf pytest networkx aiofiles httpx aiohttp mcp numpy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <a href="https://swarms.world">
    <img src="https://github.com/kyegomez/swarms/blob/master/images/swarmslogobanner.png" style="margin: 15px; max-width: 700px" width="100%" alt="Logo">
  </a>
</div>
<p align="center">
  <em>The Enterprise-Grade Production-Ready Multi-Agent Orchestration Framework </em>
</p>

<p align="center">
    <a href="https://pypi.org/project/swarms/" target="_blank">
        <img alt="Python" src="https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54" />
        <img alt="Version" src="https://img.shields.io/pypi/v/swarms?style=for-the-badge&color=3670A0">
    </a>
</p>

<p align="center">
    <a href="https://twitter.com/swarms_corp/">🐦 Twitter</a>
    <span>&nbsp;&nbsp;β€’&nbsp;&nbsp;</span>
    <a href="https://discord.gg/jM3Z6M9uMq">πŸ“’ Discord</a>
    <span>&nbsp;&nbsp;β€’&nbsp;&nbsp;</span>
    <a href="https://swarms.ai">Swarms Website</a>
    <span>&nbsp;&nbsp;β€’&nbsp;&nbsp;</span>
    <a href="https://docs.swarms.world">πŸ“™ Documentation</a>
    <span>&nbsp;&nbsp;β€’&nbsp;&nbsp;</span>
    <a href="https://swarms.world"> Swarms Marketplace</a>
</p>

<p align="center">
    <!-- Social Media -->
    <a href="https://discord.gg/jHnrkH5y">
        <img src="https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord">
    </a>
    <a href="https://www.youtube.com/@kyegomez3242">
        <img src="https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white" alt="YouTube">
    </a>
    <a href="https://www.linkedin.com/in/kye-g-38759a207/">
        <img src="https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white" alt="LinkedIn">
    </a>
    <a href="https://x.com/swarms_corp">
        <img src="https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white" alt="X.com">
    </a>
</p>

<p align="center">
    <!-- Project Stats -->
    <a href="https://github.com/kyegomez/swarms/issues">
        <img src="https://img.shields.io/github/issues/kyegomez/swarms" alt="GitHub issues">
    </a>
    <a href="https://github.com/kyegomez/swarms/network">
        <img src="https://img.shields.io/github/forks/kyegomez/swarms" alt="GitHub forks">
    </a>
    <a href="https://github.com/kyegomez/swarms/stargazers">
        <img src="https://img.shields.io/github/stars/kyegomez/swarms" alt="GitHub stars">
    </a>
    <a href="https://github.com/kyegomez/swarms/blob/main/LICENSE">
        <img src="https://img.shields.io/github/license/kyegomez/swarms" alt="GitHub license">
    </a>
    <a href="https://star-history.com/#kyegomez/swarms">
        <img src="https://img.shields.io/github/stars/kyegomez/swarms?style=social" alt="GitHub star chart">
    </a>
    <a href="https://libraries.io/github/kyegomez/swarms">
        <img src="https://img.shields.io/librariesio/github/kyegomez/swarms" alt="Dependency Status">
    </a>
    <a href="https://pepy.tech/project/swarms">
        <img src="https://static.pepy.tech/badge/swarms/month" alt="Downloads">
    </a>
</p>

<p align="center">
    <!-- Share Buttons -->
    <a href="https://twitter.com/intent/tweet?text=Check%20out%20this%20amazing%20AI%20project:%20&url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms">
        <img src="https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Share%20%40kyegomez/swarms" alt="Share on Twitter">
    </a>
    <a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms">
        <img src="https://img.shields.io/badge/Share-%20facebook-blue" alt="Share on Facebook">
    </a>
    <a href="https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&title=&summary=&source=">
        <img src="https://img.shields.io/badge/Share-%20linkedin-blue" alt="Share on LinkedIn">
    </a>
</p>

<p align="center">
    <!-- Additional Share Buttons -->
    <a href="https://www.reddit.com/submit?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&title=Swarms%20-%20the%20future%20of%20AI">
        <img src="https://img.shields.io/badge/-Share%20on%20Reddit-orange" alt="Share on Reddit">
    </a>
    <a href="https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&t=Swarms%20-%20the%20future%20of%20AI">
        <img src="https://img.shields.io/badge/-Share%20on%20Hacker%20News-orange" alt="Share on Hacker News">
    </a>
    <a href="https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&media=https%3A%2F%2Fexample.com%2Fimage.jpg&description=Swarms%20-%20the%20future%20of%20AI">
        <img src="https://img.shields.io/badge/-Share%20on%20Pinterest-red" alt="Share on Pinterest">
    </a>
    <a href="https://api.whatsapp.com/send?text=Check%20out%20Swarms%20-%20the%20future%20of%20AI%20%23swarms%20%23AI%0A%0Ahttps%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms">
        <img src="https://img.shields.io/badge/-Share%20on%20WhatsApp-green" alt="Share on WhatsApp">
    </a>
</p>

## ✨ Features

Swarms delivers a comprehensive, enterprise-grade multi-agent infrastructure platform designed for production-scale deployments and seamless integration with existing systems. [Learn more about the swarms feature set here](https://docs.swarms.world/en/latest/swarms/features/)

| Category | Features | Benefits |
|----------|----------|-----------|
| 🏒 **Enterprise Architecture** | β€’ Production-Ready Infrastructure<br>β€’ High Availability Systems<br>β€’ Modular Microservices Design<br>β€’ Comprehensive Observability<br>β€’ Backwards Compatibility | β€’ 99.9%+ Uptime Guarantee<br>β€’ Reduced Operational Overhead<br>β€’ Seamless Legacy Integration<br>β€’ Enhanced System Monitoring<br>β€’ Risk-Free Migration Path |
| πŸ€– **Multi-Agent Orchestration** | β€’ Hierarchical Agent Swarms<br>β€’ Parallel Processing Pipelines<br>β€’ Sequential Workflow Orchestration<br>β€’ Graph-Based Agent Networks<br>β€’ Dynamic Agent Composition<br>β€’ Agent Registry Management | β€’ Complex Business Process Automation<br>β€’ Scalable Task Distribution<br>β€’ Flexible Workflow Adaptation<br>β€’ Optimized Resource Utilization<br>β€’ Centralized Agent Governance<br>β€’ Enterprise-Grade Agent Lifecycle Management |
| πŸ”„ **Enterprise Integration** | β€’ Multi-Model Provider Support<br>β€’ Custom Agent Development Framework<br>β€’ Extensive Enterprise Tool Library<br>β€’ Multiple Memory Systems<br>β€’ Backwards Compatibility with LangChain, AutoGen, CrewAI<br>β€’ Standardized API Interfaces | β€’ Vendor-Agnostic Architecture<br>β€’ Custom Solution Development<br>β€’ Extended Functionality Integration<br>β€’ Enhanced Knowledge Management<br>β€’ Seamless Framework Migration<br>β€’ Reduced Integration Complexity |
| πŸ“ˆ **Enterprise Scalability** | β€’ Concurrent Multi-Agent Processing<br>β€’ Intelligent Resource Management<br>β€’ Load Balancing & Auto-Scaling<br>β€’ Horizontal Scaling Capabilities<br>β€’ Performance Optimization<br>β€’ Capacity Planning Tools | β€’ High-Throughput Processing<br>β€’ Cost-Effective Resource Utilization<br>β€’ Elastic Scaling Based on Demand<br>β€’ Linear Performance Scaling<br>β€’ Optimized Response Times<br>β€’ Predictable Growth Planning |
| πŸ› οΈ **Developer Experience** | β€’ Intuitive Enterprise API<br>β€’ Comprehensive Documentation<br>β€’ Active Enterprise Community<br>β€’ CLI & SDK Tools<br>β€’ IDE Integration Support<br>β€’ Code Generation Templates | β€’ Accelerated Development Cycles<br>β€’ Reduced Learning Curve<br>β€’ Expert Community Support<br>β€’ Rapid Deployment Capabilities<br>β€’ Enhanced Developer Productivity<br>β€’ Standardized Development Patterns |


## Install πŸ’»

### Using pip
```bash
$ pip3 install -U swarms
```

### Using uv (Recommended)
[uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver, written in Rust.

```bash
# Install uv
$ curl -LsSf https://astral.sh/uv/install.sh | sh

# Install swarms using uv
$ uv pip install swarms
```

### Using poetry
```bash
# Install poetry if you haven't already
$ curl -sSL https://install.python-poetry.org | python3 -

# Add swarms to your project
$ poetry add swarms
```

### From source
```bash
# Clone the repository
$ git clone https://github.com/kyegomez/swarms.git
$ cd swarms

# Install with pip
$ pip install -e .
```

---

## Environment Configuration

[Learn more about the environment configuration here](https://docs.swarms.world/en/latest/swarms/install/env/)

```
OPENAI_API_KEY=""
WORKSPACE_DIR="agent_workspace"
ANTHROPIC_API_KEY=""
GROQ_API_KEY=""
```



### πŸ€– Your First Agent

An **Agent** is the fundamental building block of a swarmβ€”an autonomous entity powered by an LLM + Tools + Memory. [Learn more Here](https://docs.swarms.world/en/latest/swarms/structs/agent/)

```python
from swarms import Agent

# Initialize a new agent
agent = Agent(
    model_name="gpt-4o-mini", # Specify the LLM
    max_loops=1,              # Set the number of interactions
    interactive=True,         # Enable interactive mode for real-time feedback
)

# Run the agent with a task
agent.run("What are the key benefits of using a multi-agent system?")
```

### 🀝 Your First Swarm: Multi-Agent Collaboration

A **Swarm** consists of multiple agents working together. This simple example creates a two-agent workflow for researching and writing a blog post. [Learn More About SequentialWorkflow](https://docs.swarms.world/en/latest/swarms/structs/sequential_workflow/)

```python
from swarms import Agent, SequentialWorkflow

# Agent 1: The Researcher
researcher = Agent(
    agent_name="Researcher",
    system_prompt="Your job is to research the provided topic and provide a detailed summary.",
    model_name="gpt-4o-mini",
)

# Agent 2: The Writer
writer = Agent(
    agent_name="Writer",
    system_prompt="Your job is to take the research summary and write a beautiful, engaging blog post about it.",
    model_name="gpt-4o-mini",
)

# Create a sequential workflow where the researcher's output feeds into the writer's input
workflow = SequentialWorkflow(agents=[researcher, writer])

# Run the workflow on a task
final_post = workflow.run("The history and future of artificial intelligence")
print(final_post)

```

-----

## πŸ—οΈ Multi-Agent Architectures For Production Deployments

`swarms` provides a variety of powerful, pre-built multi-agent architectures enabling you to orchestrate agents in various ways. Choose the right structure for your specific problem to build efficient and reliable production systems.

| **Architecture** | **Description** | **Best For** |
|---|---|---|
| **[SequentialWorkflow](https://docs.swarms.world/en/latest/swarms/structs/sequential_workflow/)** | Agents execute tasks in a linear chain; one agent's output is the next one's input. | Step-by-step processes like data transformation pipelines, report generation. |
| **[ConcurrentWorkflow](https://docs.swarms.world/en/latest/swarms/structs/concurrent_workflow/)** | Agents run tasks simultaneously for maximum efficiency. | High-throughput tasks like batch processing, parallel data analysis. |
| **[AgentRearrange](https://docs.swarms.world/en/latest/swarms/structs/agent_rearrange/)** | Dynamically maps complex relationships (e.g., `a -> b, c`) between agents. | Flexible and adaptive workflows, task distribution, dynamic routing. |
| **[GraphWorkflow](https://docs.swarms.world/en/latest/swarms/structs/graph_workflow/)** | Orchestrates agents as nodes in a Directed Acyclic Graph (DAG). | Complex projects with intricate dependencies, like software builds. |
| **[MixtureOfAgents (MoA)](https://docs.swarms.world/en/latest/swarms/structs/moa/)** | Utilizes multiple expert agents in parallel and synthesizes their outputs. | Complex problem-solving, achieving state-of-the-art performance through collaboration. |
| **[GroupChat](https://docs.swarms.world/en/latest/swarms/structs/group_chat/)** | Agents collaborate and make decisions through a conversational interface. | Real-time collaborative decision-making, negotiations, brainstorming. |
| **[ForestSwarm](https://docs.swarms.world/en/latest/swarms/structs/forest_swarm/)** | Dynamically selects the most suitable agent or tree of agents for a given task. | Task routing, optimizing for expertise, complex decision-making trees. |
| **[SpreadSheetSwarm](https://docs.swarms.world/en/latest/swarms/structs/spreadsheet_swarm/)** | Manages thousands of agents concurrently, tracking tasks and outputs in a structured format. | Massive-scale parallel operations, large-scale data generation and analysis. |
| **[HierarchicalSwarm](https://docs.swarms.world/en/latest/swarms/structs/hiearchical_swarm/)** | Orchestrates agents with a director that creates plans and distributes tasks to specialized worker agents. | Complex project management, team coordination, hierarchical decision-making with feedback loops. |
| **[SwarmRouter](https://docs.swarms.world/en/latest/swarms/structs/swarm_router/)** | Universal orchestrator that provides a single interface to run any type of swarm with dynamic selection. | Simplifying complex workflows, switching between swarm strategies, unified multi-agent management. |

-----

### SequentialWorkflow

A `SequentialWorkflow` executes tasks in a strict order, forming a pipeline where each agent builds upon the work of the previous one. `SequentialWorkflow` is Ideal for processes that have clear, ordered steps. This ensures that tasks with dependencies are handled correctly.

```python
from swarms import Agent, SequentialWorkflow

# Agent 1: The Researcher
researcher = Agent(
    agent_name="Researcher",
    system_prompt="Your job is to research the provided topic and provide a detailed summary.",
    model_name="gpt-4o-mini",
)

# Agent 2: The Writer
writer = Agent(
    agent_name="Writer",
    system_prompt="Your job is to take the research summary and write a beautiful, engaging blog post about it.",
    model_name="gpt-4o-mini",
)

# Create a sequential workflow where the researcher's output feeds into the writer's input
workflow = SequentialWorkflow(agents=[researcher, writer])

# Run the workflow on a task
final_post = workflow.run("The history and future of artificial intelligence")
print(final_post)
```

-----


### ConcurrentWorkflow (with `SpreadSheetSwarm`)

A concurrent workflow runs multiple agents simultaneously. `SpreadSheetSwarm` is a powerful implementation that can manage thousands of concurrent agents and log their outputs to a CSV file. Use this architecture for high-throughput tasks that can be performed in parallel, drastically reducing execution time.

```python
from swarms import Agent, SpreadSheetSwarm

# Define a list of tasks (e.g., social media posts to generate)
platforms = ["Twitter", "LinkedIn", "Instagram"]

# Create an agent for each task
agents = [
    Agent(
        agent_name=f"{platform}-Marketer",
        system_prompt=f"Generate a real estate marketing post for {platform}.",
        model_name="gpt-4o-mini",
    )
    for platform in platforms
]

# Initialize the swarm to run these agents concurrently
swarm = SpreadSheetSwarm(
    agents=agents,
    autosave_on=True,
    save_file_path="marketing_posts.csv",
)

# Run the swarm with a single, shared task description
property_description = "A beautiful 3-bedroom house in sunny California."
swarm.run(task=f"Generate a post about: {property_description}")
# Check marketing_posts.csv for the results!
```

---

### AgentRearrange

Inspired by `einsum`, `AgentRearrange` lets you define complex, non-linear relationships between agents using a simple string-based syntax. [Learn more](https://docs.swarms.world/en/latest/swarms/structs/agent_rearrange/). This architecture is Perfect for orchestrating dynamic workflows where agents might work in parallel, sequence, or a combination of both.

```python
from swarms import Agent, AgentRearrange

# Define agents
researcher = Agent(agent_name="researcher", model_name="gpt-4o-mini")
writer = Agent(agent_name="writer", model_name="gpt-4o-mini")
editor = Agent(agent_name="editor", model_name="gpt-4o-mini")

# Define a flow: researcher sends work to both writer and editor simultaneously
# This is a one-to-many relationship
flow = "researcher -> writer, editor"

# Create the rearrangement system
rearrange_system = AgentRearrange(
    agents=[researcher, writer, editor],
    flow=flow,
)

# Run the swarm
outputs = rearrange_system.run("Analyze the impact of AI on modern cinema.")
print(outputs)
```


<!-- 
### GraphWorkflow

`GraphWorkflow` orchestrates tasks using a Directed Acyclic Graph (DAG), allowing you to manage complex dependencies where some tasks must wait for others to complete.

**Description:** Essential for building sophisticated pipelines, like in software development or complex project management, where task order and dependencies are critical.

```python
from swarms import Agent, GraphWorkflow, Node, Edge, NodeType

# Define agents and a simple python function as nodes
code_generator = Agent(agent_name="CodeGenerator", system_prompt="Write Python code for the given task.", model_name="gpt-4o-mini")
code_tester = Agent(agent_name="CodeTester", system_prompt="Test the given Python code and find bugs.", model_name="gpt-4o-mini")

# Create nodes for the graph
node1 = Node(id="generator", agent=code_generator)
node2 = Node(id="tester", agent=code_tester)

# Create the graph and define the dependency
graph = GraphWorkflow()
graph.add_nodes([node1, node2])
graph.add_edge(Edge(source="generator", target="tester")) # Tester runs after generator

# Set entry and end points
graph.set_entry_points(["generator"])
graph.set_end_points(["tester"])

# Run the graph workflow
results = graph.run("Create a function that calculates the factorial of a number.")
print(results)
``` -->

----

### SwarmRouter: The Universal Swarm Orchestrator

The `SwarmRouter` simplifies building complex workflows by providing a single interface to run any type of swarm. Instead of importing and managing different swarm classes, you can dynamically select the one you need just by changing the `swarm_type` parameter. [Read the full documentation](https://docs.swarms.world/en/latest/swarms/structs/swarm_router/)

This makes your code cleaner and more flexible, allowing you to switch between different multi-agent strategies with ease. Here's a complete example that shows how to define agents and then use `SwarmRouter` to execute the same task using different collaborative strategies.

```python
from swarms import Agent
from swarms.structs.swarm_router import SwarmRouter, SwarmType

# Define a few generic agents
writer = Agent(agent_name="Writer", system_prompt="You are a creative writer.", model_name="gpt-4o-mini")
editor = Agent(agent_name="Editor", system_prompt="You are an expert editor for stories.", model_name="gpt-4o-mini")
reviewer = Agent(agent_name="Reviewer", system_prompt="You are a final reviewer who gives a score.", model_name="gpt-4o-mini")

# The agents and task will be the same for all examples
agents = [writer, editor, reviewer]
task = "Write a short story about a robot who discovers music."

# --- Example 1: SequentialWorkflow ---
# Agents run one after another in a chain: Writer -> Editor -> Reviewer.
print("Running a Sequential Workflow...")
sequential_router = SwarmRouter(swarm_type=SwarmType.SequentialWorkflow, agents=agents)
sequential_output = sequential_router.run(task)
print(f"Final Sequential Output:\n{sequential_output}\n")

# --- Example 2: ConcurrentWorkflow ---
# All agents receive the same initial task and run at the same time.
print("Running a Concurrent Workflow...")
concurrent_router = SwarmRouter(swarm_type=SwarmType.ConcurrentWorkflow, agents=agents)
concurrent_outputs = concurrent_router.run(task)
# This returns a dictionary of each agent's output
for agent_name, output in concurrent_outputs.items():
    print(f"Output from {agent_name}:\n{output}\n")

# --- Example 3: MixtureOfAgents ---
# All agents run in parallel, and a special 'aggregator' agent synthesizes their outputs.
print("Running a Mixture of Agents Workflow...")
aggregator = Agent(
    agent_name="Aggregator",
    system_prompt="Combine the story, edits, and review into a final document.",
    model_name="gpt-4o-mini"
)
moa_router = SwarmRouter(
    swarm_type=SwarmType.MixtureOfAgents,
    agents=agents,
    aggregator_agent=aggregator, # MoA requires an aggregator
)
aggregated_output = moa_router.run(task)
print(f"Final Aggregated Output:\n{aggregated_output}\n")
```


The `SwarmRouter` is a powerful tool for simplifying multi-agent orchestration. It provides a consistent and flexible way to deploy different collaborative strategies, allowing you to build more sophisticated applications with less code.

-------

### MixtureOfAgents (MoA)

The `MixtureOfAgents` architecture processes tasks by feeding them to multiple "expert" agents in parallel. Their diverse outputs are then synthesized by an aggregator agent to produce a final, high-quality result. [Learn more here](https://docs.swarms.world/en/latest/swarms/examples/moa_example/)

```python
from swarms import Agent, MixtureOfAgents

# Define expert agents
financial_analyst = Agent(agent_name="FinancialAnalyst", system_prompt="Analyze financial data.", model_name="gpt-4o-mini")
market_analyst = Agent(agent_name="MarketAnalyst", system_prompt="Analyze market trends.", model_name="gpt-4o-mini")
risk_analyst = Agent(agent_name="RiskAnalyst", system_prompt="Analyze investment risks.", model_name="gpt-4o-mini")

# Define the aggregator agent
aggregator = Agent(
    agent_name="InvestmentAdvisor",
    system_prompt="Synthesize the financial, market, and risk analyses to provide a final investment recommendation.",
    model_name="gpt-4o-mini"
)

# Create the MoA swarm
moa_swarm = MixtureOfAgents(
    agents=[financial_analyst, market_analyst, risk_analyst],
    aggregator_agent=aggregator,
)

# Run the swarm
recommendation = moa_swarm.run("Should we invest in NVIDIA stock right now?")
print(recommendation)
```

----

### GroupChat

`GroupChat` creates a conversational environment where multiple agents can interact, discuss, and collaboratively solve a problem. You can define the speaking order or let it be determined dynamically. This architecture is ideal for tasks that benefit from debate and multi-perspective reasoning, such as contract negotiation, brainstorming, or complex decision-making.

```python
from swarms import Agent, GroupChat

# Define agents for a debate
tech_optimist = Agent(agent_name="TechOptimist", system_prompt="Argue for the benefits of AI in society.", model_name="gpt-4o-mini")
tech_critic = Agent(agent_name="TechCritic", system_prompt="Argue against the unchecked advancement of AI.", model_name="gpt-4o-mini")

# Create the group chat
chat = GroupChat(
    agents=[tech_optimist, tech_critic],
    max_loops=4, # Limit the number of turns in the conversation
)

# Run the chat with an initial topic
conversation_history = chat.run(
    "Let's discuss the societal impact of artificial intelligence."
)

# Print the full conversation
for message in conversation_history:
    print(f"[{message['agent_name']}]: {message['content']}")
```

----

### HierarchicalSwarm

`HierarchicalSwarm` implements a director-worker pattern where a central director agent creates comprehensive plans and distributes specific tasks to specialized worker agents. The director evaluates results and can issue new orders in feedback loops, making it ideal for complex project management and team coordination scenarios.

```python
from swarms import Agent, HierarchicalSwarm

# Define specialized worker agents
content_strategist = Agent(
    agent_name="Content-Strategist",
    system_prompt="You are a senior content strategist. Develop comprehensive content strategies, editorial calendars, and content roadmaps.",
    model_name="gpt-4o-mini"
)

creative_director = Agent(
    agent_name="Creative-Director", 
    system_prompt="You are a creative director. Develop compelling advertising concepts, visual directions, and campaign creativity.",
    model_name="gpt-4o-mini"
)

seo_specialist = Agent(
    agent_name="SEO-Specialist",
    system_prompt="You are an SEO expert. Conduct keyword research, optimize content, and develop organic growth strategies.",
    model_name="gpt-4o-mini"
)

brand_strategist = Agent(
    agent_name="Brand-Strategist",
    system_prompt="You are a brand strategist. Develop brand positioning, identity systems, and market differentiation strategies.",
    model_name="gpt-4o-mini"
)

# Create the hierarchical swarm with a director
marketing_swarm = HierarchicalSwarm(
    name="Marketing-Team-Swarm",
    description="A comprehensive marketing team with specialized agents coordinated by a director",
    agents=[content_strategist, creative_director, seo_specialist, brand_strategist],
    max_loops=2,  # Allow for feedback and refinement
    verbose=True
)

# Run the swarm on a complex marketing challenge
result = marketing_swarm.run(
    "Develop a comprehensive marketing strategy for a new SaaS product launch. "
    "The product is a project management tool targeting small to medium businesses. "
    "Coordinate the team to create content strategy, creative campaigns, SEO optimization, "
    "and brand positioning that work together cohesively."
)

print(result)
```

The `HierarchicalSwarm` excels at:
- **Complex Project Management**: Breaking down large tasks into specialized subtasks
- **Team Coordination**: Ensuring all agents work toward unified goals
- **Quality Control**: Director provides feedback and refinement loops
- **Scalable Workflows**: Easy to add new specialized agents as needed

---

## Documentation

Documentation is located here at: [docs.swarms.world](https://docs.swarms.world)


---

## Examples

Explore comprehensive examples and tutorials to learn how to use Swarms effectively.

### Basic Examples

| Example | Description | Link |
|---------|-------------|------|
| Basic Agent | Simple agent setup and usage | [Basic Agent](https://docs.swarms.world/en/latest/swarms/examples/basic_agent/) |
| Agent with Tools | Using agents with various tools | [Agent with Tools](https://docs.swarms.world/en/latest/swarms/examples/agent_with_tools/) |
| Agent with Structured Outputs | Working with structured data outputs | [Structured Outputs](https://docs.swarms.world/en/latest/swarms/examples/agent_structured_outputs/) |
| Agent with MCP Integration | Model Context Protocol integration | [MCP Integration](https://docs.swarms.world/en/latest/swarms/examples/agent_with_mcp/) |
| Vision Processing | Agents with image processing capabilities | [Vision Processing](https://docs.swarms.world/en/latest/swarms/examples/vision_processing/) |
| Multiple Images | Working with multiple images | [Multiple Images](https://docs.swarms.world/en/latest/swarms/examples/multiple_images/) |
| Vision and Tools | Combining vision with tool usage | [Vision and Tools](https://docs.swarms.world/en/latest/swarms/examples/vision_tools/) |
| Agent Streaming | Real-time agent output streaming | [Agent Streaming](https://docs.swarms.world/en/latest/examples/agent_stream/) |
| Agent Output Types | Different output formats and types | [Output Types](https://docs.swarms.world/en/latest/swarms/examples/agent_output_types/) |
| Gradio Chat Interface | Building interactive chat interfaces | [Gradio UI](https://docs.swarms.world/en/latest/swarms/ui/main/) |

### Model Provider Examples

| Provider | Description | Link |
|----------|-------------|------|
| Model Providers Overview | Complete guide to supported models | [Model Providers](https://docs.swarms.world/en/latest/swarms/examples/model_providers/) |
| OpenAI | OpenAI model integration | [OpenAI Examples](https://docs.swarms.world/en/latest/swarms/examples/openai_example/) |
| Anthropic | Claude model integration | [Anthropic Examples](https://docs.swarms.world/en/latest/swarms/examples/claude/) |
| Groq | Groq model integration | [Groq Examples](https://docs.swarms.world/en/latest/swarms/examples/groq/) |
| Cohere | Cohere model integration | [Cohere Examples](https://docs.swarms.world/en/latest/swarms/examples/cohere/) |
| DeepSeek | DeepSeek model integration | [DeepSeek Examples](https://docs.swarms.world/en/latest/swarms/examples/deepseek/) |
| Ollama | Local Ollama model integration | [Ollama Examples](https://docs.swarms.world/en/latest/swarms/examples/ollama/) |
| OpenRouter | OpenRouter model integration | [OpenRouter Examples](https://docs.swarms.world/en/latest/swarms/examples/openrouter/) |
| XAI | XAI model integration | [XAI Examples](https://docs.swarms.world/en/latest/swarms/examples/xai/) |
| VLLM | VLLM integration | [VLLM Examples](https://docs.swarms.world/en/latest/swarms/examples/vllm_integration/) |
| Llama4 | Llama4 model integration | [Llama4 Examples](https://docs.swarms.world/en/latest/swarms/examples/llama4/) |

### Multi-Agent Architecture Examples

| Architecture | Description | Link |
|--------------|-------------|------|
| HierarchicalSwarm | Hierarchical agent orchestration | [HierarchicalSwarm Examples](https://docs.swarms.world/en/latest/swarms/examples/hierarchical_swarm_example/) |
| Hybrid Hierarchical-Cluster Swarm | Advanced hierarchical patterns | [HHCS Examples](https://docs.swarms.world/en/latest/swarms/examples/hhcs_examples/) |
| GroupChat | Multi-agent conversations | [GroupChat Examples](https://docs.swarms.world/en/latest/swarms/examples/groupchat_example/) |
| Sequential Workflow | Step-by-step agent workflows | [Sequential Examples](https://docs.swarms.world/en/latest/swarms/examples/sequential_example/) |
| SwarmRouter | Universal swarm orchestration | [SwarmRouter Examples](https://docs.swarms.world/en/latest/swarms/examples/swarm_router/) |
| MultiAgentRouter | Minimal router example | [MultiAgentRouter Examples](https://docs.swarms.world/en/latest/swarms/examples/multi_agent_router_minimal/) |
| ConcurrentWorkflow | Parallel agent execution | [Concurrent Examples](https://docs.swarms.world/en/latest/swarms/examples/concurrent_workflow/) |
| Mixture of Agents | Expert agent collaboration | [MoA Examples](https://docs.swarms.world/en/latest/swarms/examples/moa_example/) |
| Unique Swarms | Specialized swarm patterns | [Unique Swarms](https://docs.swarms.world/en/latest/swarms/examples/unique_swarms/) |
| Agents as Tools | Using agents as tools in workflows | [Agents as Tools](https://docs.swarms.world/en/latest/swarms/examples/agents_as_tools/) |
| Aggregate Responses | Combining multiple agent outputs | [Aggregate Examples](https://docs.swarms.world/en/latest/swarms/examples/aggregate/) |
| Interactive GroupChat | Real-time agent interactions | [Interactive GroupChat](https://docs.swarms.world/en/latest/swarms/examples/igc_example/) |

### Application Examples

| Application | Description | Link |
|-------------|-------------|------|
| Swarms DAO | Decentralized autonomous organization | [Swarms DAO](https://docs.swarms.world/en/latest/swarms/examples/swarms_dao/) |
| Browser Agents | Web automation with agents | [Browser Agents](https://docs.swarms.world/en/latest/swarms/examples/swarms_of_browser_agents/) |
| VLLM Agents | High-performance model serving | [VLLM Agents](https://docs.swarms.world/en/latest/swarms/examples/vllm/) |
| Medical Analysis | Healthcare applications | [Medical Examples](https://docs.swarms.world/en/latest/swarms/examples/swarms_api_medical/) |
| Finance Analysis | Financial applications | [Finance Examples](https://docs.swarms.world/en/latest/swarms/examples/swarms_api_finance/) |

### Cookbook and Templates

| Resource | Description | Link |
|----------|-------------|------|
| Examples Overview | Complete examples directory | [Examples Index](https://docs.swarms.world/en/latest/examples/) |
| Cookbook Index | Curated example collection | [Cookbook](https://docs.swarms.world/en/latest/examples/cookbook_index/) |
| Paper Implementations | Research paper implementations | [Paper Implementations](https://docs.swarms.world/en/latest/examples/paper_implementations/) |
| Templates & Applications | Reusable templates | [Templates](https://docs.swarms.world/en/latest/examples/templates/) |

---

## Contribute to Swarms

Our mission is to accelerate the transition to a fully autonomous world economy by providing enterprise-grade, production-ready infrastructure that enables seamless deployment and orchestration of millions of autonomous agents. We are creating the operating system for the agent economy, and we need your help to achieve this goal.

Swarms is built by the community, for the community. We believe that collaborative development is the key to pushing the boundaries of what's possible with multi-agent AI. Your contributions are not only welcomeβ€”they are essential to our mission. [Learn more about why you should contribute to Swarms](https://docs.swarms.world/en/latest/contributors/main/)

### Why Contribute?

By joining us, you have the opportunity to:

* **Work on the Frontier of Agents:** Shape the future of autonomous agent technology and help build a production-grade, open-source framework.

* **Join a Vibrant Community:** Collaborate with a passionate and growing group of agent developers, researchers, and AI enthusiasts.

* **Make a Tangible Impact:** Whether you're fixing a bug, adding a new feature, or improving documentation, your work will be used in real-world applications.

* **Learn and Grow:** Gain hands-on experience with advanced AI concepts and strengthen your software engineering skills.

Discover more about our mission and the benefits of becoming a contributor in our official [**Contributor's Guide**](https://docs.swarms.world/en/latest/contributors/main/).

### How to Get Started

We've made it easy to start contributing. Here's how you can help:

1. **Find an Issue to Tackle:** The best way to begin is by visiting our [**contributing project board**](https://github.com/users/kyegomez/projects/1). Look for issues tagged with `good first issue`β€”these are specifically selected for new contributors.

2. **Report a Bug or Request a Feature:** Have a new idea or found something that isn't working right? We'd love to hear from you. Please [**file a Bug Report or Feature Request**](https://github.com/kyegomez/swarms/issues) on our GitHub Issues page.

3. **Understand Our Workflow and Standards:** Before submitting your work, please review our complete [**Contribution Guidelines**](https://github.com/kyegomez/swarms/blob/master/CONTRIBUTING.md). To help maintain code quality, we also encourage you to read our guide on [**Code Cleanliness**](https://docs.swarms.world/en/latest/swarms/framework/code_cleanliness/).

4. **Join the Discussion:** To participate in roadmap discussions and connect with other developers, join our community on [**Discord**](https://discord.gg/jM3Z6M9uMq).


### ✨ Our Valued Contributors

Thank you for contributing to swarms. Your work is extremely appreciated and recognized.

<a href="https://github.com/kyegomez/swarms/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=kyegomez/swarms" />
</a>

-----

## Connect With Us

Join our community of agent engineers and researchers for technical support, cutting-edge updates, and exclusive access to world-class agent engineering insights!

| Platform | Description | Link |
|----------|-------------|------|
| πŸ“š Documentation | Official documentation and guides | [docs.swarms.world](https://docs.swarms.world) |
| πŸ“ Blog | Latest updates and technical articles | [Medium](https://medium.com/@kyeg) |
| πŸ’¬ Discord | Live chat and community support | [Join Discord](https://discord.gg/jM3Z6M9uMq) |
| 🐦 Twitter | Latest news and announcements | [@kyegomez](https://twitter.com/kyegomez) |
| πŸ‘₯ LinkedIn | Professional network and updates | [The Swarm Corporation](https://www.linkedin.com/company/the-swarm-corporation) |
| πŸ“Ί YouTube | Tutorials and demos | [Swarms Channel](https://www.youtube.com/channel/UC9yXyitkbU_WSy7bd_41SqQ) |
| 🎫 Events | Join our community events | [Sign up here](https://lu.ma/5p2jnc2v) |
| πŸš€ Onboarding Session | Get onboarded with Kye Gomez, creator and lead maintainer of Swarms | [Book Session](https://cal.com/swarms/swarms-onboarding-session) |

------

## Citation

If you use **swarms** in your research, please cite the project by referencing the metadata in [CITATION.cff](./CITATION.cff).

```bibtex
@misc{SWARMS_2022,
  author  = {Gomez, Kye and Pliny and More, Harshal and Swarms Community},
  title   = {{Swarms: Production-Grade Multi-Agent Infrastructure Platform}},
  year    = {2022},
  howpublished = {\url{https://github.com/kyegomez/swarms}},
  note    = {Documentation available at \url{https://docs.swarms.world}},
  version = {latest}
}
```

# License

Swarms is licensed under the Apache License 2.0. [Learn more here](./LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kyegomez/swarms",
    "name": "swarms",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "artificial intelligence, deep learning, optimizers, Prompt Engineering, swarms, agents, llms, transformers, multi-agent, swarms of agents, Enterprise-Grade Agents, Production-Grade Agents, Agents, Multi-Grade-Agents, Swarms, Transformers, LLMs, Prompt Engineering, Agents, Generative Agents, Generative AI, Agent Marketplace, Agent Store, quant, finance, algorithmic trading, portfolio optimization, risk management, financial modeling, machine learning for finance, natural language processing for finance",
    "author": "Kye Gomez",
    "author_email": "kye@apac.ai",
    "download_url": "https://files.pythonhosted.org/packages/54/46/0b6c29ace50a213c677fa83edd1d68056e1ade2c13f5a16e6def010b2fe7/swarms-8.0.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://swarms.world\">\n    <img src=\"https://github.com/kyegomez/swarms/blob/master/images/swarmslogobanner.png\" style=\"margin: 15px; max-width: 700px\" width=\"100%\" alt=\"Logo\">\n  </a>\n</div>\n<p align=\"center\">\n  <em>The Enterprise-Grade Production-Ready Multi-Agent Orchestration Framework </em>\n</p>\n\n<p align=\"center\">\n    <a href=\"https://pypi.org/project/swarms/\" target=\"_blank\">\n        <img alt=\"Python\" src=\"https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54\" />\n        <img alt=\"Version\" src=\"https://img.shields.io/pypi/v/swarms?style=for-the-badge&color=3670A0\">\n    </a>\n</p>\n\n<p align=\"center\">\n    <a href=\"https://twitter.com/swarms_corp/\">\ud83d\udc26 Twitter</a>\n    <span>&nbsp;&nbsp;\u2022&nbsp;&nbsp;</span>\n    <a href=\"https://discord.gg/jM3Z6M9uMq\">\ud83d\udce2 Discord</a>\n    <span>&nbsp;&nbsp;\u2022&nbsp;&nbsp;</span>\n    <a href=\"https://swarms.ai\">Swarms Website</a>\n    <span>&nbsp;&nbsp;\u2022&nbsp;&nbsp;</span>\n    <a href=\"https://docs.swarms.world\">\ud83d\udcd9 Documentation</a>\n    <span>&nbsp;&nbsp;\u2022&nbsp;&nbsp;</span>\n    <a href=\"https://swarms.world\"> Swarms Marketplace</a>\n</p>\n\n<p align=\"center\">\n    <!-- Social Media -->\n    <a href=\"https://discord.gg/jHnrkH5y\">\n        <img src=\"https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white\" alt=\"Discord\">\n    </a>\n    <a href=\"https://www.youtube.com/@kyegomez3242\">\n        <img src=\"https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white\" alt=\"YouTube\">\n    </a>\n    <a href=\"https://www.linkedin.com/in/kye-g-38759a207/\">\n        <img src=\"https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white\" alt=\"LinkedIn\">\n    </a>\n    <a href=\"https://x.com/swarms_corp\">\n        <img src=\"https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white\" alt=\"X.com\">\n    </a>\n</p>\n\n<p align=\"center\">\n    <!-- Project Stats -->\n    <a href=\"https://github.com/kyegomez/swarms/issues\">\n        <img src=\"https://img.shields.io/github/issues/kyegomez/swarms\" alt=\"GitHub issues\">\n    </a>\n    <a href=\"https://github.com/kyegomez/swarms/network\">\n        <img src=\"https://img.shields.io/github/forks/kyegomez/swarms\" alt=\"GitHub forks\">\n    </a>\n    <a href=\"https://github.com/kyegomez/swarms/stargazers\">\n        <img src=\"https://img.shields.io/github/stars/kyegomez/swarms\" alt=\"GitHub stars\">\n    </a>\n    <a href=\"https://github.com/kyegomez/swarms/blob/main/LICENSE\">\n        <img src=\"https://img.shields.io/github/license/kyegomez/swarms\" alt=\"GitHub license\">\n    </a>\n    <a href=\"https://star-history.com/#kyegomez/swarms\">\n        <img src=\"https://img.shields.io/github/stars/kyegomez/swarms?style=social\" alt=\"GitHub star chart\">\n    </a>\n    <a href=\"https://libraries.io/github/kyegomez/swarms\">\n        <img src=\"https://img.shields.io/librariesio/github/kyegomez/swarms\" alt=\"Dependency Status\">\n    </a>\n    <a href=\"https://pepy.tech/project/swarms\">\n        <img src=\"https://static.pepy.tech/badge/swarms/month\" alt=\"Downloads\">\n    </a>\n</p>\n\n<p align=\"center\">\n    <!-- Share Buttons -->\n    <a href=\"https://twitter.com/intent/tweet?text=Check%20out%20this%20amazing%20AI%20project:%20&url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms\">\n        <img src=\"https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Share%20%40kyegomez/swarms\" alt=\"Share on Twitter\">\n    </a>\n    <a href=\"https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms\">\n        <img src=\"https://img.shields.io/badge/Share-%20facebook-blue\" alt=\"Share on Facebook\">\n    </a>\n    <a href=\"https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&title=&summary=&source=\">\n        <img src=\"https://img.shields.io/badge/Share-%20linkedin-blue\" alt=\"Share on LinkedIn\">\n    </a>\n</p>\n\n<p align=\"center\">\n    <!-- Additional Share Buttons -->\n    <a href=\"https://www.reddit.com/submit?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&title=Swarms%20-%20the%20future%20of%20AI\">\n        <img src=\"https://img.shields.io/badge/-Share%20on%20Reddit-orange\" alt=\"Share on Reddit\">\n    </a>\n    <a href=\"https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&t=Swarms%20-%20the%20future%20of%20AI\">\n        <img src=\"https://img.shields.io/badge/-Share%20on%20Hacker%20News-orange\" alt=\"Share on Hacker News\">\n    </a>\n    <a href=\"https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&media=https%3A%2F%2Fexample.com%2Fimage.jpg&description=Swarms%20-%20the%20future%20of%20AI\">\n        <img src=\"https://img.shields.io/badge/-Share%20on%20Pinterest-red\" alt=\"Share on Pinterest\">\n    </a>\n    <a href=\"https://api.whatsapp.com/send?text=Check%20out%20Swarms%20-%20the%20future%20of%20AI%20%23swarms%20%23AI%0A%0Ahttps%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms\">\n        <img src=\"https://img.shields.io/badge/-Share%20on%20WhatsApp-green\" alt=\"Share on WhatsApp\">\n    </a>\n</p>\n\n## \u2728 Features\n\nSwarms delivers a comprehensive, enterprise-grade multi-agent infrastructure platform designed for production-scale deployments and seamless integration with existing systems. [Learn more about the swarms feature set here](https://docs.swarms.world/en/latest/swarms/features/)\n\n| Category | Features | Benefits |\n|----------|----------|-----------|\n| \ud83c\udfe2 **Enterprise Architecture** | \u2022 Production-Ready Infrastructure<br>\u2022 High Availability Systems<br>\u2022 Modular Microservices Design<br>\u2022 Comprehensive Observability<br>\u2022 Backwards Compatibility | \u2022 99.9%+ Uptime Guarantee<br>\u2022 Reduced Operational Overhead<br>\u2022 Seamless Legacy Integration<br>\u2022 Enhanced System Monitoring<br>\u2022 Risk-Free Migration Path |\n| \ud83e\udd16 **Multi-Agent Orchestration** | \u2022 Hierarchical Agent Swarms<br>\u2022 Parallel Processing Pipelines<br>\u2022 Sequential Workflow Orchestration<br>\u2022 Graph-Based Agent Networks<br>\u2022 Dynamic Agent Composition<br>\u2022 Agent Registry Management | \u2022 Complex Business Process Automation<br>\u2022 Scalable Task Distribution<br>\u2022 Flexible Workflow Adaptation<br>\u2022 Optimized Resource Utilization<br>\u2022 Centralized Agent Governance<br>\u2022 Enterprise-Grade Agent Lifecycle Management |\n| \ud83d\udd04 **Enterprise Integration** | \u2022 Multi-Model Provider Support<br>\u2022 Custom Agent Development Framework<br>\u2022 Extensive Enterprise Tool Library<br>\u2022 Multiple Memory Systems<br>\u2022 Backwards Compatibility with LangChain, AutoGen, CrewAI<br>\u2022 Standardized API Interfaces | \u2022 Vendor-Agnostic Architecture<br>\u2022 Custom Solution Development<br>\u2022 Extended Functionality Integration<br>\u2022 Enhanced Knowledge Management<br>\u2022 Seamless Framework Migration<br>\u2022 Reduced Integration Complexity |\n| \ud83d\udcc8 **Enterprise Scalability** | \u2022 Concurrent Multi-Agent Processing<br>\u2022 Intelligent Resource Management<br>\u2022 Load Balancing & Auto-Scaling<br>\u2022 Horizontal Scaling Capabilities<br>\u2022 Performance Optimization<br>\u2022 Capacity Planning Tools | \u2022 High-Throughput Processing<br>\u2022 Cost-Effective Resource Utilization<br>\u2022 Elastic Scaling Based on Demand<br>\u2022 Linear Performance Scaling<br>\u2022 Optimized Response Times<br>\u2022 Predictable Growth Planning |\n| \ud83d\udee0\ufe0f **Developer Experience** | \u2022 Intuitive Enterprise API<br>\u2022 Comprehensive Documentation<br>\u2022 Active Enterprise Community<br>\u2022 CLI & SDK Tools<br>\u2022 IDE Integration Support<br>\u2022 Code Generation Templates | \u2022 Accelerated Development Cycles<br>\u2022 Reduced Learning Curve<br>\u2022 Expert Community Support<br>\u2022 Rapid Deployment Capabilities<br>\u2022 Enhanced Developer Productivity<br>\u2022 Standardized Development Patterns |\n\n\n## Install \ud83d\udcbb\n\n### Using pip\n```bash\n$ pip3 install -U swarms\n```\n\n### Using uv (Recommended)\n[uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver, written in Rust.\n\n```bash\n# Install uv\n$ curl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Install swarms using uv\n$ uv pip install swarms\n```\n\n### Using poetry\n```bash\n# Install poetry if you haven't already\n$ curl -sSL https://install.python-poetry.org | python3 -\n\n# Add swarms to your project\n$ poetry add swarms\n```\n\n### From source\n```bash\n# Clone the repository\n$ git clone https://github.com/kyegomez/swarms.git\n$ cd swarms\n\n# Install with pip\n$ pip install -e .\n```\n\n---\n\n## Environment Configuration\n\n[Learn more about the environment configuration here](https://docs.swarms.world/en/latest/swarms/install/env/)\n\n```\nOPENAI_API_KEY=\"\"\nWORKSPACE_DIR=\"agent_workspace\"\nANTHROPIC_API_KEY=\"\"\nGROQ_API_KEY=\"\"\n```\n\n\n\n### \ud83e\udd16 Your First Agent\n\nAn **Agent** is the fundamental building block of a swarm\u2014an autonomous entity powered by an LLM + Tools + Memory. [Learn more Here](https://docs.swarms.world/en/latest/swarms/structs/agent/)\n\n```python\nfrom swarms import Agent\n\n# Initialize a new agent\nagent = Agent(\n    model_name=\"gpt-4o-mini\", # Specify the LLM\n    max_loops=1,              # Set the number of interactions\n    interactive=True,         # Enable interactive mode for real-time feedback\n)\n\n# Run the agent with a task\nagent.run(\"What are the key benefits of using a multi-agent system?\")\n```\n\n### \ud83e\udd1d Your First Swarm: Multi-Agent Collaboration\n\nA **Swarm** consists of multiple agents working together. This simple example creates a two-agent workflow for researching and writing a blog post. [Learn More About SequentialWorkflow](https://docs.swarms.world/en/latest/swarms/structs/sequential_workflow/)\n\n```python\nfrom swarms import Agent, SequentialWorkflow\n\n# Agent 1: The Researcher\nresearcher = Agent(\n    agent_name=\"Researcher\",\n    system_prompt=\"Your job is to research the provided topic and provide a detailed summary.\",\n    model_name=\"gpt-4o-mini\",\n)\n\n# Agent 2: The Writer\nwriter = Agent(\n    agent_name=\"Writer\",\n    system_prompt=\"Your job is to take the research summary and write a beautiful, engaging blog post about it.\",\n    model_name=\"gpt-4o-mini\",\n)\n\n# Create a sequential workflow where the researcher's output feeds into the writer's input\nworkflow = SequentialWorkflow(agents=[researcher, writer])\n\n# Run the workflow on a task\nfinal_post = workflow.run(\"The history and future of artificial intelligence\")\nprint(final_post)\n\n```\n\n-----\n\n## \ud83c\udfd7\ufe0f Multi-Agent Architectures For Production Deployments\n\n`swarms` provides a variety of powerful, pre-built multi-agent architectures enabling you to orchestrate agents in various ways. Choose the right structure for your specific problem to build efficient and reliable production systems.\n\n| **Architecture** | **Description** | **Best For** |\n|---|---|---|\n| **[SequentialWorkflow](https://docs.swarms.world/en/latest/swarms/structs/sequential_workflow/)** | Agents execute tasks in a linear chain; one agent's output is the next one's input. | Step-by-step processes like data transformation pipelines, report generation. |\n| **[ConcurrentWorkflow](https://docs.swarms.world/en/latest/swarms/structs/concurrent_workflow/)** | Agents run tasks simultaneously for maximum efficiency. | High-throughput tasks like batch processing, parallel data analysis. |\n| **[AgentRearrange](https://docs.swarms.world/en/latest/swarms/structs/agent_rearrange/)** | Dynamically maps complex relationships (e.g., `a -> b, c`) between agents. | Flexible and adaptive workflows, task distribution, dynamic routing. |\n| **[GraphWorkflow](https://docs.swarms.world/en/latest/swarms/structs/graph_workflow/)** | Orchestrates agents as nodes in a Directed Acyclic Graph (DAG). | Complex projects with intricate dependencies, like software builds. |\n| **[MixtureOfAgents (MoA)](https://docs.swarms.world/en/latest/swarms/structs/moa/)** | Utilizes multiple expert agents in parallel and synthesizes their outputs. | Complex problem-solving, achieving state-of-the-art performance through collaboration. |\n| **[GroupChat](https://docs.swarms.world/en/latest/swarms/structs/group_chat/)** | Agents collaborate and make decisions through a conversational interface. | Real-time collaborative decision-making, negotiations, brainstorming. |\n| **[ForestSwarm](https://docs.swarms.world/en/latest/swarms/structs/forest_swarm/)** | Dynamically selects the most suitable agent or tree of agents for a given task. | Task routing, optimizing for expertise, complex decision-making trees. |\n| **[SpreadSheetSwarm](https://docs.swarms.world/en/latest/swarms/structs/spreadsheet_swarm/)** | Manages thousands of agents concurrently, tracking tasks and outputs in a structured format. | Massive-scale parallel operations, large-scale data generation and analysis. |\n| **[HierarchicalSwarm](https://docs.swarms.world/en/latest/swarms/structs/hiearchical_swarm/)** | Orchestrates agents with a director that creates plans and distributes tasks to specialized worker agents. | Complex project management, team coordination, hierarchical decision-making with feedback loops. |\n| **[SwarmRouter](https://docs.swarms.world/en/latest/swarms/structs/swarm_router/)** | Universal orchestrator that provides a single interface to run any type of swarm with dynamic selection. | Simplifying complex workflows, switching between swarm strategies, unified multi-agent management. |\n\n-----\n\n### SequentialWorkflow\n\nA `SequentialWorkflow` executes tasks in a strict order, forming a pipeline where each agent builds upon the work of the previous one. `SequentialWorkflow` is Ideal for processes that have clear, ordered steps. This ensures that tasks with dependencies are handled correctly.\n\n```python\nfrom swarms import Agent, SequentialWorkflow\n\n# Agent 1: The Researcher\nresearcher = Agent(\n    agent_name=\"Researcher\",\n    system_prompt=\"Your job is to research the provided topic and provide a detailed summary.\",\n    model_name=\"gpt-4o-mini\",\n)\n\n# Agent 2: The Writer\nwriter = Agent(\n    agent_name=\"Writer\",\n    system_prompt=\"Your job is to take the research summary and write a beautiful, engaging blog post about it.\",\n    model_name=\"gpt-4o-mini\",\n)\n\n# Create a sequential workflow where the researcher's output feeds into the writer's input\nworkflow = SequentialWorkflow(agents=[researcher, writer])\n\n# Run the workflow on a task\nfinal_post = workflow.run(\"The history and future of artificial intelligence\")\nprint(final_post)\n```\n\n-----\n\n\n### ConcurrentWorkflow (with `SpreadSheetSwarm`)\n\nA concurrent workflow runs multiple agents simultaneously. `SpreadSheetSwarm` is a powerful implementation that can manage thousands of concurrent agents and log their outputs to a CSV file. Use this architecture for high-throughput tasks that can be performed in parallel, drastically reducing execution time.\n\n```python\nfrom swarms import Agent, SpreadSheetSwarm\n\n# Define a list of tasks (e.g., social media posts to generate)\nplatforms = [\"Twitter\", \"LinkedIn\", \"Instagram\"]\n\n# Create an agent for each task\nagents = [\n    Agent(\n        agent_name=f\"{platform}-Marketer\",\n        system_prompt=f\"Generate a real estate marketing post for {platform}.\",\n        model_name=\"gpt-4o-mini\",\n    )\n    for platform in platforms\n]\n\n# Initialize the swarm to run these agents concurrently\nswarm = SpreadSheetSwarm(\n    agents=agents,\n    autosave_on=True,\n    save_file_path=\"marketing_posts.csv\",\n)\n\n# Run the swarm with a single, shared task description\nproperty_description = \"A beautiful 3-bedroom house in sunny California.\"\nswarm.run(task=f\"Generate a post about: {property_description}\")\n# Check marketing_posts.csv for the results!\n```\n\n---\n\n### AgentRearrange\n\nInspired by `einsum`, `AgentRearrange` lets you define complex, non-linear relationships between agents using a simple string-based syntax. [Learn more](https://docs.swarms.world/en/latest/swarms/structs/agent_rearrange/). This architecture is Perfect for orchestrating dynamic workflows where agents might work in parallel, sequence, or a combination of both.\n\n```python\nfrom swarms import Agent, AgentRearrange\n\n# Define agents\nresearcher = Agent(agent_name=\"researcher\", model_name=\"gpt-4o-mini\")\nwriter = Agent(agent_name=\"writer\", model_name=\"gpt-4o-mini\")\neditor = Agent(agent_name=\"editor\", model_name=\"gpt-4o-mini\")\n\n# Define a flow: researcher sends work to both writer and editor simultaneously\n# This is a one-to-many relationship\nflow = \"researcher -> writer, editor\"\n\n# Create the rearrangement system\nrearrange_system = AgentRearrange(\n    agents=[researcher, writer, editor],\n    flow=flow,\n)\n\n# Run the swarm\noutputs = rearrange_system.run(\"Analyze the impact of AI on modern cinema.\")\nprint(outputs)\n```\n\n\n<!-- \n### GraphWorkflow\n\n`GraphWorkflow` orchestrates tasks using a Directed Acyclic Graph (DAG), allowing you to manage complex dependencies where some tasks must wait for others to complete.\n\n**Description:** Essential for building sophisticated pipelines, like in software development or complex project management, where task order and dependencies are critical.\n\n```python\nfrom swarms import Agent, GraphWorkflow, Node, Edge, NodeType\n\n# Define agents and a simple python function as nodes\ncode_generator = Agent(agent_name=\"CodeGenerator\", system_prompt=\"Write Python code for the given task.\", model_name=\"gpt-4o-mini\")\ncode_tester = Agent(agent_name=\"CodeTester\", system_prompt=\"Test the given Python code and find bugs.\", model_name=\"gpt-4o-mini\")\n\n# Create nodes for the graph\nnode1 = Node(id=\"generator\", agent=code_generator)\nnode2 = Node(id=\"tester\", agent=code_tester)\n\n# Create the graph and define the dependency\ngraph = GraphWorkflow()\ngraph.add_nodes([node1, node2])\ngraph.add_edge(Edge(source=\"generator\", target=\"tester\")) # Tester runs after generator\n\n# Set entry and end points\ngraph.set_entry_points([\"generator\"])\ngraph.set_end_points([\"tester\"])\n\n# Run the graph workflow\nresults = graph.run(\"Create a function that calculates the factorial of a number.\")\nprint(results)\n``` -->\n\n----\n\n### SwarmRouter: The Universal Swarm Orchestrator\n\nThe `SwarmRouter` simplifies building complex workflows by providing a single interface to run any type of swarm. Instead of importing and managing different swarm classes, you can dynamically select the one you need just by changing the `swarm_type` parameter. [Read the full documentation](https://docs.swarms.world/en/latest/swarms/structs/swarm_router/)\n\nThis makes your code cleaner and more flexible, allowing you to switch between different multi-agent strategies with ease. Here's a complete example that shows how to define agents and then use `SwarmRouter` to execute the same task using different collaborative strategies.\n\n```python\nfrom swarms import Agent\nfrom swarms.structs.swarm_router import SwarmRouter, SwarmType\n\n# Define a few generic agents\nwriter = Agent(agent_name=\"Writer\", system_prompt=\"You are a creative writer.\", model_name=\"gpt-4o-mini\")\neditor = Agent(agent_name=\"Editor\", system_prompt=\"You are an expert editor for stories.\", model_name=\"gpt-4o-mini\")\nreviewer = Agent(agent_name=\"Reviewer\", system_prompt=\"You are a final reviewer who gives a score.\", model_name=\"gpt-4o-mini\")\n\n# The agents and task will be the same for all examples\nagents = [writer, editor, reviewer]\ntask = \"Write a short story about a robot who discovers music.\"\n\n# --- Example 1: SequentialWorkflow ---\n# Agents run one after another in a chain: Writer -> Editor -> Reviewer.\nprint(\"Running a Sequential Workflow...\")\nsequential_router = SwarmRouter(swarm_type=SwarmType.SequentialWorkflow, agents=agents)\nsequential_output = sequential_router.run(task)\nprint(f\"Final Sequential Output:\\n{sequential_output}\\n\")\n\n# --- Example 2: ConcurrentWorkflow ---\n# All agents receive the same initial task and run at the same time.\nprint(\"Running a Concurrent Workflow...\")\nconcurrent_router = SwarmRouter(swarm_type=SwarmType.ConcurrentWorkflow, agents=agents)\nconcurrent_outputs = concurrent_router.run(task)\n# This returns a dictionary of each agent's output\nfor agent_name, output in concurrent_outputs.items():\n    print(f\"Output from {agent_name}:\\n{output}\\n\")\n\n# --- Example 3: MixtureOfAgents ---\n# All agents run in parallel, and a special 'aggregator' agent synthesizes their outputs.\nprint(\"Running a Mixture of Agents Workflow...\")\naggregator = Agent(\n    agent_name=\"Aggregator\",\n    system_prompt=\"Combine the story, edits, and review into a final document.\",\n    model_name=\"gpt-4o-mini\"\n)\nmoa_router = SwarmRouter(\n    swarm_type=SwarmType.MixtureOfAgents,\n    agents=agents,\n    aggregator_agent=aggregator, # MoA requires an aggregator\n)\naggregated_output = moa_router.run(task)\nprint(f\"Final Aggregated Output:\\n{aggregated_output}\\n\")\n```\n\n\nThe `SwarmRouter` is a powerful tool for simplifying multi-agent orchestration. It provides a consistent and flexible way to deploy different collaborative strategies, allowing you to build more sophisticated applications with less code.\n\n-------\n\n### MixtureOfAgents (MoA)\n\nThe `MixtureOfAgents` architecture processes tasks by feeding them to multiple \"expert\" agents in parallel. Their diverse outputs are then synthesized by an aggregator agent to produce a final, high-quality result. [Learn more here](https://docs.swarms.world/en/latest/swarms/examples/moa_example/)\n\n```python\nfrom swarms import Agent, MixtureOfAgents\n\n# Define expert agents\nfinancial_analyst = Agent(agent_name=\"FinancialAnalyst\", system_prompt=\"Analyze financial data.\", model_name=\"gpt-4o-mini\")\nmarket_analyst = Agent(agent_name=\"MarketAnalyst\", system_prompt=\"Analyze market trends.\", model_name=\"gpt-4o-mini\")\nrisk_analyst = Agent(agent_name=\"RiskAnalyst\", system_prompt=\"Analyze investment risks.\", model_name=\"gpt-4o-mini\")\n\n# Define the aggregator agent\naggregator = Agent(\n    agent_name=\"InvestmentAdvisor\",\n    system_prompt=\"Synthesize the financial, market, and risk analyses to provide a final investment recommendation.\",\n    model_name=\"gpt-4o-mini\"\n)\n\n# Create the MoA swarm\nmoa_swarm = MixtureOfAgents(\n    agents=[financial_analyst, market_analyst, risk_analyst],\n    aggregator_agent=aggregator,\n)\n\n# Run the swarm\nrecommendation = moa_swarm.run(\"Should we invest in NVIDIA stock right now?\")\nprint(recommendation)\n```\n\n----\n\n### GroupChat\n\n`GroupChat` creates a conversational environment where multiple agents can interact, discuss, and collaboratively solve a problem. You can define the speaking order or let it be determined dynamically. This architecture is ideal for tasks that benefit from debate and multi-perspective reasoning, such as contract negotiation, brainstorming, or complex decision-making.\n\n```python\nfrom swarms import Agent, GroupChat\n\n# Define agents for a debate\ntech_optimist = Agent(agent_name=\"TechOptimist\", system_prompt=\"Argue for the benefits of AI in society.\", model_name=\"gpt-4o-mini\")\ntech_critic = Agent(agent_name=\"TechCritic\", system_prompt=\"Argue against the unchecked advancement of AI.\", model_name=\"gpt-4o-mini\")\n\n# Create the group chat\nchat = GroupChat(\n    agents=[tech_optimist, tech_critic],\n    max_loops=4, # Limit the number of turns in the conversation\n)\n\n# Run the chat with an initial topic\nconversation_history = chat.run(\n    \"Let's discuss the societal impact of artificial intelligence.\"\n)\n\n# Print the full conversation\nfor message in conversation_history:\n    print(f\"[{message['agent_name']}]: {message['content']}\")\n```\n\n----\n\n### HierarchicalSwarm\n\n`HierarchicalSwarm` implements a director-worker pattern where a central director agent creates comprehensive plans and distributes specific tasks to specialized worker agents. The director evaluates results and can issue new orders in feedback loops, making it ideal for complex project management and team coordination scenarios.\n\n```python\nfrom swarms import Agent, HierarchicalSwarm\n\n# Define specialized worker agents\ncontent_strategist = Agent(\n    agent_name=\"Content-Strategist\",\n    system_prompt=\"You are a senior content strategist. Develop comprehensive content strategies, editorial calendars, and content roadmaps.\",\n    model_name=\"gpt-4o-mini\"\n)\n\ncreative_director = Agent(\n    agent_name=\"Creative-Director\", \n    system_prompt=\"You are a creative director. Develop compelling advertising concepts, visual directions, and campaign creativity.\",\n    model_name=\"gpt-4o-mini\"\n)\n\nseo_specialist = Agent(\n    agent_name=\"SEO-Specialist\",\n    system_prompt=\"You are an SEO expert. Conduct keyword research, optimize content, and develop organic growth strategies.\",\n    model_name=\"gpt-4o-mini\"\n)\n\nbrand_strategist = Agent(\n    agent_name=\"Brand-Strategist\",\n    system_prompt=\"You are a brand strategist. Develop brand positioning, identity systems, and market differentiation strategies.\",\n    model_name=\"gpt-4o-mini\"\n)\n\n# Create the hierarchical swarm with a director\nmarketing_swarm = HierarchicalSwarm(\n    name=\"Marketing-Team-Swarm\",\n    description=\"A comprehensive marketing team with specialized agents coordinated by a director\",\n    agents=[content_strategist, creative_director, seo_specialist, brand_strategist],\n    max_loops=2,  # Allow for feedback and refinement\n    verbose=True\n)\n\n# Run the swarm on a complex marketing challenge\nresult = marketing_swarm.run(\n    \"Develop a comprehensive marketing strategy for a new SaaS product launch. \"\n    \"The product is a project management tool targeting small to medium businesses. \"\n    \"Coordinate the team to create content strategy, creative campaigns, SEO optimization, \"\n    \"and brand positioning that work together cohesively.\"\n)\n\nprint(result)\n```\n\nThe `HierarchicalSwarm` excels at:\n- **Complex Project Management**: Breaking down large tasks into specialized subtasks\n- **Team Coordination**: Ensuring all agents work toward unified goals\n- **Quality Control**: Director provides feedback and refinement loops\n- **Scalable Workflows**: Easy to add new specialized agents as needed\n\n---\n\n## Documentation\n\nDocumentation is located here at: [docs.swarms.world](https://docs.swarms.world)\n\n\n---\n\n## Examples\n\nExplore comprehensive examples and tutorials to learn how to use Swarms effectively.\n\n### Basic Examples\n\n| Example | Description | Link |\n|---------|-------------|------|\n| Basic Agent | Simple agent setup and usage | [Basic Agent](https://docs.swarms.world/en/latest/swarms/examples/basic_agent/) |\n| Agent with Tools | Using agents with various tools | [Agent with Tools](https://docs.swarms.world/en/latest/swarms/examples/agent_with_tools/) |\n| Agent with Structured Outputs | Working with structured data outputs | [Structured Outputs](https://docs.swarms.world/en/latest/swarms/examples/agent_structured_outputs/) |\n| Agent with MCP Integration | Model Context Protocol integration | [MCP Integration](https://docs.swarms.world/en/latest/swarms/examples/agent_with_mcp/) |\n| Vision Processing | Agents with image processing capabilities | [Vision Processing](https://docs.swarms.world/en/latest/swarms/examples/vision_processing/) |\n| Multiple Images | Working with multiple images | [Multiple Images](https://docs.swarms.world/en/latest/swarms/examples/multiple_images/) |\n| Vision and Tools | Combining vision with tool usage | [Vision and Tools](https://docs.swarms.world/en/latest/swarms/examples/vision_tools/) |\n| Agent Streaming | Real-time agent output streaming | [Agent Streaming](https://docs.swarms.world/en/latest/examples/agent_stream/) |\n| Agent Output Types | Different output formats and types | [Output Types](https://docs.swarms.world/en/latest/swarms/examples/agent_output_types/) |\n| Gradio Chat Interface | Building interactive chat interfaces | [Gradio UI](https://docs.swarms.world/en/latest/swarms/ui/main/) |\n\n### Model Provider Examples\n\n| Provider | Description | Link |\n|----------|-------------|------|\n| Model Providers Overview | Complete guide to supported models | [Model Providers](https://docs.swarms.world/en/latest/swarms/examples/model_providers/) |\n| OpenAI | OpenAI model integration | [OpenAI Examples](https://docs.swarms.world/en/latest/swarms/examples/openai_example/) |\n| Anthropic | Claude model integration | [Anthropic Examples](https://docs.swarms.world/en/latest/swarms/examples/claude/) |\n| Groq | Groq model integration | [Groq Examples](https://docs.swarms.world/en/latest/swarms/examples/groq/) |\n| Cohere | Cohere model integration | [Cohere Examples](https://docs.swarms.world/en/latest/swarms/examples/cohere/) |\n| DeepSeek | DeepSeek model integration | [DeepSeek Examples](https://docs.swarms.world/en/latest/swarms/examples/deepseek/) |\n| Ollama | Local Ollama model integration | [Ollama Examples](https://docs.swarms.world/en/latest/swarms/examples/ollama/) |\n| OpenRouter | OpenRouter model integration | [OpenRouter Examples](https://docs.swarms.world/en/latest/swarms/examples/openrouter/) |\n| XAI | XAI model integration | [XAI Examples](https://docs.swarms.world/en/latest/swarms/examples/xai/) |\n| VLLM | VLLM integration | [VLLM Examples](https://docs.swarms.world/en/latest/swarms/examples/vllm_integration/) |\n| Llama4 | Llama4 model integration | [Llama4 Examples](https://docs.swarms.world/en/latest/swarms/examples/llama4/) |\n\n### Multi-Agent Architecture Examples\n\n| Architecture | Description | Link |\n|--------------|-------------|------|\n| HierarchicalSwarm | Hierarchical agent orchestration | [HierarchicalSwarm Examples](https://docs.swarms.world/en/latest/swarms/examples/hierarchical_swarm_example/) |\n| Hybrid Hierarchical-Cluster Swarm | Advanced hierarchical patterns | [HHCS Examples](https://docs.swarms.world/en/latest/swarms/examples/hhcs_examples/) |\n| GroupChat | Multi-agent conversations | [GroupChat Examples](https://docs.swarms.world/en/latest/swarms/examples/groupchat_example/) |\n| Sequential Workflow | Step-by-step agent workflows | [Sequential Examples](https://docs.swarms.world/en/latest/swarms/examples/sequential_example/) |\n| SwarmRouter | Universal swarm orchestration | [SwarmRouter Examples](https://docs.swarms.world/en/latest/swarms/examples/swarm_router/) |\n| MultiAgentRouter | Minimal router example | [MultiAgentRouter Examples](https://docs.swarms.world/en/latest/swarms/examples/multi_agent_router_minimal/) |\n| ConcurrentWorkflow | Parallel agent execution | [Concurrent Examples](https://docs.swarms.world/en/latest/swarms/examples/concurrent_workflow/) |\n| Mixture of Agents | Expert agent collaboration | [MoA Examples](https://docs.swarms.world/en/latest/swarms/examples/moa_example/) |\n| Unique Swarms | Specialized swarm patterns | [Unique Swarms](https://docs.swarms.world/en/latest/swarms/examples/unique_swarms/) |\n| Agents as Tools | Using agents as tools in workflows | [Agents as Tools](https://docs.swarms.world/en/latest/swarms/examples/agents_as_tools/) |\n| Aggregate Responses | Combining multiple agent outputs | [Aggregate Examples](https://docs.swarms.world/en/latest/swarms/examples/aggregate/) |\n| Interactive GroupChat | Real-time agent interactions | [Interactive GroupChat](https://docs.swarms.world/en/latest/swarms/examples/igc_example/) |\n\n### Application Examples\n\n| Application | Description | Link |\n|-------------|-------------|------|\n| Swarms DAO | Decentralized autonomous organization | [Swarms DAO](https://docs.swarms.world/en/latest/swarms/examples/swarms_dao/) |\n| Browser Agents | Web automation with agents | [Browser Agents](https://docs.swarms.world/en/latest/swarms/examples/swarms_of_browser_agents/) |\n| VLLM Agents | High-performance model serving | [VLLM Agents](https://docs.swarms.world/en/latest/swarms/examples/vllm/) |\n| Medical Analysis | Healthcare applications | [Medical Examples](https://docs.swarms.world/en/latest/swarms/examples/swarms_api_medical/) |\n| Finance Analysis | Financial applications | [Finance Examples](https://docs.swarms.world/en/latest/swarms/examples/swarms_api_finance/) |\n\n### Cookbook and Templates\n\n| Resource | Description | Link |\n|----------|-------------|------|\n| Examples Overview | Complete examples directory | [Examples Index](https://docs.swarms.world/en/latest/examples/) |\n| Cookbook Index | Curated example collection | [Cookbook](https://docs.swarms.world/en/latest/examples/cookbook_index/) |\n| Paper Implementations | Research paper implementations | [Paper Implementations](https://docs.swarms.world/en/latest/examples/paper_implementations/) |\n| Templates & Applications | Reusable templates | [Templates](https://docs.swarms.world/en/latest/examples/templates/) |\n\n---\n\n## Contribute to Swarms\n\nOur mission is to accelerate the transition to a fully autonomous world economy by providing enterprise-grade, production-ready infrastructure that enables seamless deployment and orchestration of millions of autonomous agents. We are creating the operating system for the agent economy, and we need your help to achieve this goal.\n\nSwarms is built by the community, for the community. We believe that collaborative development is the key to pushing the boundaries of what's possible with multi-agent AI. Your contributions are not only welcome\u2014they are essential to our mission. [Learn more about why you should contribute to Swarms](https://docs.swarms.world/en/latest/contributors/main/)\n\n### Why Contribute?\n\nBy joining us, you have the opportunity to:\n\n* **Work on the Frontier of Agents:** Shape the future of autonomous agent technology and help build a production-grade, open-source framework.\n\n* **Join a Vibrant Community:** Collaborate with a passionate and growing group of agent developers, researchers, and AI enthusiasts.\n\n* **Make a Tangible Impact:** Whether you're fixing a bug, adding a new feature, or improving documentation, your work will be used in real-world applications.\n\n* **Learn and Grow:** Gain hands-on experience with advanced AI concepts and strengthen your software engineering skills.\n\nDiscover more about our mission and the benefits of becoming a contributor in our official [**Contributor's Guide**](https://docs.swarms.world/en/latest/contributors/main/).\n\n### How to Get Started\n\nWe've made it easy to start contributing. Here's how you can help:\n\n1. **Find an Issue to Tackle:** The best way to begin is by visiting our [**contributing project board**](https://github.com/users/kyegomez/projects/1). Look for issues tagged with `good first issue`\u2014these are specifically selected for new contributors.\n\n2. **Report a Bug or Request a Feature:** Have a new idea or found something that isn't working right? We'd love to hear from you. Please [**file a Bug Report or Feature Request**](https://github.com/kyegomez/swarms/issues) on our GitHub Issues page.\n\n3. **Understand Our Workflow and Standards:** Before submitting your work, please review our complete [**Contribution Guidelines**](https://github.com/kyegomez/swarms/blob/master/CONTRIBUTING.md). To help maintain code quality, we also encourage you to read our guide on [**Code Cleanliness**](https://docs.swarms.world/en/latest/swarms/framework/code_cleanliness/).\n\n4. **Join the Discussion:** To participate in roadmap discussions and connect with other developers, join our community on [**Discord**](https://discord.gg/jM3Z6M9uMq).\n\n\n### \u2728 Our Valued Contributors\n\nThank you for contributing to swarms. Your work is extremely appreciated and recognized.\n\n<a href=\"https://github.com/kyegomez/swarms/graphs/contributors\">\n  <img src=\"https://contrib.rocks/image?repo=kyegomez/swarms\" />\n</a>\n\n-----\n\n## Connect With Us\n\nJoin our community of agent engineers and researchers for technical support, cutting-edge updates, and exclusive access to world-class agent engineering insights!\n\n| Platform | Description | Link |\n|----------|-------------|------|\n| \ud83d\udcda Documentation | Official documentation and guides | [docs.swarms.world](https://docs.swarms.world) |\n| \ud83d\udcdd Blog | Latest updates and technical articles | [Medium](https://medium.com/@kyeg) |\n| \ud83d\udcac Discord | Live chat and community support | [Join Discord](https://discord.gg/jM3Z6M9uMq) |\n| \ud83d\udc26 Twitter | Latest news and announcements | [@kyegomez](https://twitter.com/kyegomez) |\n| \ud83d\udc65 LinkedIn | Professional network and updates | [The Swarm Corporation](https://www.linkedin.com/company/the-swarm-corporation) |\n| \ud83d\udcfa YouTube | Tutorials and demos | [Swarms Channel](https://www.youtube.com/channel/UC9yXyitkbU_WSy7bd_41SqQ) |\n| \ud83c\udfab Events | Join our community events | [Sign up here](https://lu.ma/5p2jnc2v) |\n| \ud83d\ude80 Onboarding Session | Get onboarded with Kye Gomez, creator and lead maintainer of Swarms | [Book Session](https://cal.com/swarms/swarms-onboarding-session) |\n\n------\n\n## Citation\n\nIf you use **swarms** in your research, please cite the project by referencing the metadata in [CITATION.cff](./CITATION.cff).\n\n```bibtex\n@misc{SWARMS_2022,\n  author  = {Gomez, Kye and Pliny and More, Harshal and Swarms Community},\n  title   = {{Swarms: Production-Grade Multi-Agent Infrastructure Platform}},\n  year    = {2022},\n  howpublished = {\\url{https://github.com/kyegomez/swarms}},\n  note    = {Documentation available at \\url{https://docs.swarms.world}},\n  version = {latest}\n}\n```\n\n# License\n\nSwarms is licensed under the Apache License 2.0. [Learn more here](./LICENSE)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Swarms - TGSC",
    "version": "8.0.0",
    "project_urls": {
        "Documentation": "https://docs.swarms.world",
        "Homepage": "https://github.com/kyegomez/swarms",
        "Repository": "https://github.com/kyegomez/swarms"
    },
    "split_keywords": [
        "artificial intelligence",
        " deep learning",
        " optimizers",
        " prompt engineering",
        " swarms",
        " agents",
        " llms",
        " transformers",
        " multi-agent",
        " swarms of agents",
        " enterprise-grade agents",
        " production-grade agents",
        " agents",
        " multi-grade-agents",
        " swarms",
        " transformers",
        " llms",
        " prompt engineering",
        " agents",
        " generative agents",
        " generative ai",
        " agent marketplace",
        " agent store",
        " quant",
        " finance",
        " algorithmic trading",
        " portfolio optimization",
        " risk management",
        " financial modeling",
        " machine learning for finance",
        " natural language processing for finance"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1e5e7b661640436b9f0d6b671af25b20bd457679b44a96e927713c489157794a",
                "md5": "645b4c57af1cc851f6fd70468aa180de",
                "sha256": "9bc55d154bb69752ccecbf6a0f91021015c5a15fd138fba78d8bdbaa55b4d928"
            },
            "downloads": -1,
            "filename": "swarms-8.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "645b4c57af1cc851f6fd70468aa180de",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 588301,
            "upload_time": "2025-07-18T22:14:01",
            "upload_time_iso_8601": "2025-07-18T22:14:01.587572Z",
            "url": "https://files.pythonhosted.org/packages/1e/5e/7b661640436b9f0d6b671af25b20bd457679b44a96e927713c489157794a/swarms-8.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "54460b6c29ace50a213c677fa83edd1d68056e1ade2c13f5a16e6def010b2fe7",
                "md5": "9f0ae37fbd86fc367b0e939e004836d9",
                "sha256": "8ade5710d601a01ac756afb23c2fc21f19cc8f95bcb616fce717b2312bdd75a3"
            },
            "downloads": -1,
            "filename": "swarms-8.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9f0ae37fbd86fc367b0e939e004836d9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 490233,
            "upload_time": "2025-07-18T22:14:04",
            "upload_time_iso_8601": "2025-07-18T22:14:04.612227Z",
            "url": "https://files.pythonhosted.org/packages/54/46/0b6c29ace50a213c677fa83edd1d68056e1ade2c13f5a16e6def010b2fe7/swarms-8.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-18 22:14:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kyegomez",
    "github_project": "swarms",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "torch",
            "specs": [
                [
                    ">=",
                    "2.1.1"
                ],
                [
                    "<",
                    "3.0"
                ]
            ]
        },
        {
            "name": "transformers",
            "specs": [
                [
                    ">=",
                    "4.39.0"
                ],
                [
                    "<",
                    "4.51.0"
                ]
            ]
        },
        {
            "name": "asyncio",
            "specs": [
                [
                    ">=",
                    "3.4.3"
                ],
                [
                    "<",
                    "4.0"
                ]
            ]
        },
        {
            "name": "toml",
            "specs": []
        },
        {
            "name": "pypdf",
            "specs": [
                [
                    "==",
                    "5.1.0"
                ]
            ]
        },
        {
            "name": "ratelimit",
            "specs": [
                [
                    "==",
                    "2.2.1"
                ]
            ]
        },
        {
            "name": "loguru",
            "specs": []
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    "==",
                    "2.11.4"
                ]
            ]
        },
        {
            "name": "tenacity",
            "specs": []
        },
        {
            "name": "rich",
            "specs": []
        },
        {
            "name": "psutil",
            "specs": []
        },
        {
            "name": "python-dotenv",
            "specs": []
        },
        {
            "name": "PyYAML",
            "specs": []
        },
        {
            "name": "docstring_parser",
            "specs": [
                [
                    "==",
                    "0.16"
                ]
            ]
        },
        {
            "name": "black",
            "specs": [
                [
                    ">=",
                    "23.1"
                ],
                [
                    "<",
                    "26.0"
                ]
            ]
        },
        {
            "name": "ruff",
            "specs": [
                [
                    ">=",
                    "0.0.249"
                ],
                [
                    "<",
                    "0.4.5"
                ]
            ]
        },
        {
            "name": "types-toml",
            "specs": [
                [
                    ">=",
                    "0.10.8.1"
                ]
            ]
        },
        {
            "name": "types-pytz",
            "specs": [
                [
                    "<",
                    "2026.0"
                ],
                [
                    ">=",
                    "2023.3"
                ]
            ]
        },
        {
            "name": "types-chardet",
            "specs": [
                [
                    ">=",
                    "5.0.4.6"
                ]
            ]
        },
        {
            "name": "mypy-protobuf",
            "specs": [
                [
                    ">=",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    ">=",
                    "8.1.1"
                ]
            ]
        },
        {
            "name": "networkx",
            "specs": []
        },
        {
            "name": "aiofiles",
            "specs": []
        },
        {
            "name": "httpx",
            "specs": []
        },
        {
            "name": "aiohttp",
            "specs": []
        },
        {
            "name": "mcp",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        }
    ],
    "lcname": "swarms"
}
        
Elapsed time: 1.45192s