> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swarms.world/llms.txt
> Use this file to discover all available pages before exploring further.

# Protocol Overview & Architecture

> Comprehensive overview of the Swarms protocol architecture, illustrating the flow from agent classes to multi-agent structures

This document provides a comprehensive overview of the Swarms protocol architecture, illustrating the flow from agent classes to multi-agent structures, and showcasing the main components and folders within the `swarms/` package. The Swarms framework is designed for extensibility, modularity, and production-readiness, enabling the orchestration of intelligent agents, tools, memory, and complex multi-agent systems.

## Introduction

Swarms is an enterprise-grade, production-ready multi-agent orchestration framework. It enables developers and organizations to build, deploy, and manage intelligent agents that can reason, collaborate, and solve complex tasks autonomously or in groups. The architecture is inspired by the principles of modularity, composability, and scalability, ensuring that each component can be extended or replaced as needed.

The protocol is structured to support a wide range of use cases, from simple single-agent automations to sophisticated multi-agent workflows involving memory, tool use, and advanced reasoning.

## High-Level Architecture Flow

The Swarms protocol is organized into several key layers, each responsible for a specific aspect of the system:

1. **Agent Class (`swarms/agents`)**

   The core building block of the framework. Agents encapsulate logic, state, and behavior. They can be simple (stateless) or complex (stateful, with memory and reasoning capabilities).

   Agents can be specialized for different tasks (e.g., reasoning agents, tool agents, judge agents, etc.).

   * [Getting Started with Agents](/agents/creating-agents)
   * [Agent API Reference](/api/agent)

2. **Tools with Memory (`swarms/tools`, `swarms/utils`)**

   Tools are modular components that agents use to interact with the outside world, perform computations, or access resources (APIs, databases, files, etc.).

   Memory modules and utility functions allow agents to retain context, cache results, and manage state across interactions.

   * [Tools Overview](/integrations/tools)
   * [Tools API Reference](/api/tools)

3. **Reasoning & Specialized Agents (`swarms/agents`)**

   These agents build on the base agent class, adding advanced reasoning, self-consistency, and specialized logic for tasks like planning, evaluation, or multi-step workflows. Includes agents for self-reflection, iterative improvement, and domain-specific expertise.

4. **Multi-Agent Structures (`swarms/structs`)**

   Agents are composed into higher-order structures for collaboration, voting, parallelism, and workflow orchestration. Includes swarms for majority voting, round-robin execution, hierarchical delegation, and more.

   * [Multi-Agent Architectures Overview](/architectures/overview)
   * [MajorityVoting](/api/majority-voting)
   * [HierarchicalSwarm](/api/hierarchical-swarm)
   * [Sequential Workflow](/api/sequential-workflow)
   * [Concurrent Workflow](/api/concurrent-workflow)

5. **Supporting Components**

   * **Communication (`swarms/communication`)**: Wrappers for inter-agent communication, database access, message passing, and integration with external systems (e.g., Redis, DuckDB, Pulsar). See [Conversation API](/api/conversation).
   * **Artifacts (`swarms/artifacts`)**: Manages creation, storage, and retrieval of artifacts (outputs, files, logs) generated by agents and swarms.
   * **Prompts (`swarms/prompts`)**: Prompt templates, system prompts, and agent-specific prompts for LLM-based agents. See [Prompts API](/api/prompts).
   * **Telemetry (`swarms/telemetry`)**: Logging, monitoring, and bootup routines for observability and debugging.
   * **Schemas (`swarms/schemas`)**: Data schemas for agents, tools, completions, and communication protocols. See [Schemas API](/api/schemas).
   * **CLI (`swarms/cli`)**: Command-line utilities for agent creation, management, and orchestration. See [CLI Reference](/cli/overview).

## Proposing Enhancements: Swarms Improvement Proposals (SIPs)

For significant changes, new agent architectures, or radical new features, Swarms uses a formal process called **Swarms Improvement Proposals (SIPs)**. SIPs are design documents that describe new features, enhancements, or changes to the Swarms framework. They ensure that major changes are well-documented, discussed, and reviewed by the community before implementation.

**When to use a SIP:**

* Proposing new agent types, swarm patterns, or coordination mechanisms
* Core framework changes or breaking changes
* New integrations (LLM providers, tools, external services)
* Any complex or multi-component feature

**SIP Process Overview:**

1. Discuss your idea in [GitHub Discussions](https://github.com/kyegomez/swarms/discussions)
2. Submit a SIP as a GitHub Issue using the SIP template
3. Engage with the community and iterate on your proposal
4. Undergo review and, if accepted, proceed to implementation

**Learn more:** See the full [SIP Guidelines and Template](/community/sip).

## Architecture Diagram

```mermaid theme={null}
flowchart TD
    A["Agent Class<br/>(swarms/agents)"] --> B["Tools with Memory<br/>(swarms/tools, swarms/utils)"]
    B --> C["Reasoning & Specialized Agents<br/>(swarms/agents)"]
    C --> D["Multi-Agent Structures<br/>(swarms/structs)"]
    D --> E["Communication, Artifacts, Prompts, Telemetry, Schemas, CLI"]

    subgraph Folders
        A1["agents"]
        A2["tools"]
        A3["structs"]
        A4["utils"]
        A5["telemetry"]
        A6["schemas"]
        A7["prompts"]
        A8["artifacts"]
        A9["communication"]
        A10["cli"]
    end

    subgraph "swarms/"
        A1
        A2
        A3
        A4
        A5
        A6
        A7
        A8
        A9
        A10
    end

    A1 -.-> A
    A2 -.-> B
    A3 -.-> D
    A4 -.-> B
    A5 -.-> E
    A6 -.-> E
    A7 -.-> E
    A8 -.-> E
    A9 -.-> E
    A10 -.-> E
```

## Folder-by-Folder Breakdown

### `agents/`

Defines all agent classes, including base agents, reasoning agents, tool agents, judge agents, and more.

* Modular agent design for extensibility
* Support for YAML-based agent creation and configuration. See [Agent Configuration](/agents/agent-configuration).
* Specialized agents for self-consistency, evaluation, and domain-specific tasks
* Examples: `ReasoningAgent`, `ToolAgent`, `JudgeAgent`, `ConsistencyAgent`
* [Agents Concept](/concepts/agents)

### `tools/`

Houses all tool-related logic, including tool registry, function calling, tool schemas, and integration with external APIs.

* Tools can be dynamically registered and called by agents
* Support for OpenAI function calling, Cohere, and custom tool schemas
* Utilities for parsing, formatting, and executing tool calls
* [Tools API Reference](/api/tools) | [Agent Tools Guide](/agents/agent-tools)

### `structs/`

Implements multi-agent structures, workflows, routers, registries, and orchestration logic.

* Swarms for majority voting, round-robin, hierarchical delegation, spreadsheet processing, and more
* Workflow orchestration (sequential, concurrent, graph-based)
* Utilities for agent matching, rearrangement, and evaluation
* [Custom Architectures](/concepts/custom-architectures) | [SwarmRouter](/api/swarm-router) | [AgentRearrange](/api/agent-rearrange)

### `utils/`

Provides utility functions, memory management, caching, wrappers, and helpers used throughout the framework.

* Memory and caching for agents and tools. See [Agent Memory](/agents/agent-memory).
* Wrappers for concurrency, logging, and data processing
* General-purpose utilities for string, file, and data manipulation

### `telemetry/`

Handles telemetry, logging, monitoring, and bootup routines for the framework.

* Centralized logging and execution tracking
* Bootup routines for initializing the framework
* Utilities for monitoring agent and swarm performance

### `schemas/`

Defines data schemas for agents, tools, completions, and communication protocols.

* Ensures type safety and consistency across the framework
* Pydantic-based schemas for validation and serialization
* [Schemas API Reference](/api/schemas)

### `prompts/`

Contains prompt templates, system prompts, and agent-specific prompts for LLM-based agents.

* Modular prompt design for easy customization
* Support for multi-modal, collaborative, and domain-specific prompts
* [Prompts API Reference](/api/prompts)

### `artifacts/`

Manages the creation, storage, and retrieval of artifacts (outputs, files, logs) generated by agents and swarms.

* Artifact management for reproducibility and traceability
* Support for various output types and formats

### `communication/`

Provides wrappers for inter-agent communication, database access, message passing, and integration with external systems.

* Support for Redis, DuckDB, Pulsar, Supabase, and more
* Abstractions for message passing and data exchange between agents
* [Conversation API Reference](/api/conversation)

### `cli/`

Command-line utilities for agent creation, management, and orchestration.

* Scripts for onboarding, agent creation, and management
* CLI entry points for interacting with the framework
* [CLI Reference](/cli/overview)

## How the System Works Together

The Swarms protocol is designed for composability. Agents can be created and configured independently, then composed into larger structures (swarms) for collaborative or competitive workflows. Tools and memory modules are injected into agents as needed, enabling them to perform complex tasks and retain context. Multi-agent structures orchestrate the flow of information and decision-making, while supporting components (communication, telemetry, artifacts, etc.) ensure robustness, observability, and extensibility.

A typical workflow might involve:

* Creating a set of specialized agents (e.g., data analyst, summarizer, judge)
* Registering tools (e.g., LLM API, database access, web search) and memory modules
* Composing agents into a [MajorityVoting](/api/majority-voting) swarm for collaborative decision-making
* Using communication wrappers to exchange data between agents and external systems
* Logging all actions and outputs for traceability and debugging

For more advanced examples, see the [Examples Gallery](/examples/overviews/examples-index).

## Framework Philosophy

Swarms is built on the following principles:

* **Modularity:** Every component (agent, tool, prompt, schema) is a module that can be extended or replaced
* **Composability:** Agents and tools can be composed into larger structures for complex workflows
* **Observability:** Telemetry and artifact management ensure that all actions are traceable and debuggable
* **Extensibility:** New agents, tools, and workflows can be added with minimal friction
* **Production-Readiness:** The framework is designed for reliability, scalability, and real-world deployment

## Further Reading

| Resource                  | Link                                                   | Description                    |
| ------------------------- | ------------------------------------------------------ | ------------------------------ |
| Quickstart                | [Getting Started](/quickstart)                         | Get up and running fast        |
| Agent Development         | [Creating Agents](/agents/creating-agents)             | Build your first agent         |
| Agent API Reference       | [Agent API](/api/agent)                                | Complete Agent class reference |
| Tools                     | [Tools Overview](/integrations/tools)                  | Overview of available tools    |
| Multi-Agent Architectures | [Architectures](/architectures/overview)               | Multi-agent system patterns    |
| Examples                  | [Examples Gallery](/examples/overviews/examples-index) | Real-world use cases           |
| CLI                       | [CLI Reference](/cli/overview)                         | Command-line interface docs    |
| SIP Guidelines            | [SIP Process](/community/sip)                          | Propose major changes          |
