Skip to main content

A highly flexible multi-agent ReAct framework powered by Google Gemini

Project description

🐝 Swarm

Swarm is an advanced, open-source multi-agent intelligence framework designed for autonomous collaboration. Powered by Google's Gemini 3.1 Flash Lite, Swarm allows multiple agents to interact, use tools, execute code, and perform web searches in a shared environment.

🚀 Key Features

  • N-Agent Collaboration: Run any number of agents in a single session.
  • Autonomous Tool Usage: Agents can perform Google searches and execute Shell commands.
  • Agent Sandboxing: Per-agent blacklists for terminal commands and file paths.
  • Turn Management: Agents can autonomously pass turns to specific peers using pass_turn.
  • ReAct Loop: High-level reasoning before acting, supporting multi-step tool execution.
  • Files API Support: Agents can upload and analyze PDF, images, and logs via Google Files API.
  • Persistent Sessions: Save and load full agent histories and environment states.

🛠 Installation

# Clone the repository
git clone https://github.com/ProgVM/swarm
cd swarm

# Install dependencies
pip install .

Or:

pip install swarmai

💻 CLI Usage

Start a basic conversation with two agents:

swarm --keys YOUR_API_KEY --agents_count 2

Start an autonomous coding session:

swarm --first_msg "Write a web scraper in Python and test it" \
      --sys1 "You are an Expert Coder" \
      --sys2 "You are a Security Auditor" \
      --cmd_timeout 600

Advanced Configuration

Swarm supports individual parameters for every agent using aiN_ prefixes:

  • --ai1_name "Architect"
  • --ai1_model "gemini-2.0-flash"
  • --ai2_name "Tester"
  • --ai2_temp 0.2

⚙️ Configuration File

You can use a JSON config to manage complex Swarms:

{
  "agents_count": 3,
  "model": "gemini-3.1-flash-lite",
  "cmd_blacklist": ["rm -rf", "format"],
  "no_pause": true
}

Run with: swarm --config my_swarm.json

⌨️ Command Center (Interactive Menu)

Press Ctrl+C at any time to:

  • Rotate API Keys.
  • Toggle reading pauses.
  • Save the current state.
  • Change logging levels (DEBUG, INFO, WARNING).
  • Inject manual directives into agents' minds.

🤝 Contributing

Developed by ProgVM.

License: MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmai-1.0.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swarmai-1.0.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file swarmai-1.0.0.tar.gz.

File metadata

  • Download URL: swarmai-1.0.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for swarmai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3ea359994c4c00157fdeb023ca23223ece769066f24e7582673d8dd7ff91a37c
MD5 34e3c56f84b9b3c596687560f9e650f4
BLAKE2b-256 87a7e29b910e5f2a1d92f43f3e8cca767f28be34fde880298ffecdaf67e2cff1

See more details on using hashes here.

File details

Details for the file swarmai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: swarmai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for swarmai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d88ef05ec3578c47076ad21a62c0b6711177b482fa82b9cf6055ba55deb7f20e
MD5 cfa74c871b6989ff8bca79cce23b499b
BLAKE2b-256 375f815c4e12cd9bdc66555c8953096a75d00fa57ca4a4f6b510425a5df52f93

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page