Skip to main content

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

Project description

PyPI version License: MIT GitHub stars

🐝 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.1.tar.gz (10.3 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.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: swarmai-1.0.1.tar.gz
  • Upload date:
  • Size: 10.3 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.1.tar.gz
Algorithm Hash digest
SHA256 cf7b2d31286a49f7603fa54f6c730d2cdc93dcea885fffe21132d2565eca6ebe
MD5 76850091a18a72732f2486517bf7126e
BLAKE2b-256 3ec00f68241d811faa575b69b862ee76abe40205c6e25bf537897bbd14aa0cd0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swarmai-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8794a42db3d899a8ff14c0cc80af997b32fe8d6a044e400bab57fb367f7c094e
MD5 782a73fa025da119b348336fa52e6037
BLAKE2b-256 f5fd6ebcc247dc18007175a9fff4ef959b9d0f700bc755721df19fde9f87f657

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