A highly flexible multi-agent ReAct framework powered by Google Gemini
Project description
🐝 Swarm Intelligence Framework
Swarm is a professional, highly flexible multi-agent intelligence framework powered by Google's Gemini 3.1 Flash Lite. It allows an arbitrary number of autonomous agents to collaborate, use system tools, execute code, and perform web searches in a shared environmental context.
🚀 Key Features
- N-Agent Support: Run as many agents as your tasks require.
- Autonomous Toolchain: Agents use
web_searchandshell_execto solve complex problems. - Dynamic Configuration: Configure any agent parameter (name, model, temperature, system prompt) directly via CLI flags.
- Handover Logic: Agents can autonomously pass control to specific peers using the
pass_turntool. - Shared Environment: Tool execution outputs are shared with all agents via automatic System Reports.
- Files API Integration: Agents can upload and analyze local files (PDFs, images, logs) on the fly.
- Smart Sandboxing: Per-agent regex blacklists for terminal commands and file system paths.
- Persistent Sessions: Save and load complete Swarm states, including histories and turn orders.
🛠 Installation
pip install swarmai
Requires Python 3.9+ and a Google Gemini API Key.
💻 Quick Start
Basic Two-Agent Discussion
swarm --keys YOUR_API_KEY --agents_count 2
Autonomous Developer & Auditor
swarm --keys YOUR_API_KEY \
--first_msg "Write a secure Python data scraper" \
--ai1_name "Dev" --ai1_sys "You are a senior coder." \
--ai2_name "Security" --ai2_sys "You look for vulnerabilities."
⚙️ Advanced CLI Configuration
Swarm uses a dynamic argument system. You can prefix any standard parameter with aiN_ to target a specific agent:
--ai1_model "gemini-1.5-pro"(Use a heavier model for the lead agent)--ai2_temp 0.1(Make the auditor more deterministic)--ai3_name "Researcher"(Set a custom name for the 3rd agent)--cmd_blacklist "rm" "sudo"(Global security policy)
Global Parameters:
--agents_count: Number of agents in session (default: 2).--log_level: DEBUG, INFO, or WARNING.--no_pause: Disable "Press Enter" delays for fully autonomous runs.--config: Path to a JSON file containing all these parameters.
⌨️ Command Center (Ctrl+C)
Press Ctrl+C during execution to pause the Swarm and access the interactive menu:
- Change Keys: Rotate or update API keys on the fly.
- Toggle Pauses: Switch between manual and autonomous modes.
- Save State: Export the entire session to a JSON file.
- Inject Directive: Manually "whisper" a command to one or all agents.
- Log Level: Adjust verbosity without restarting.
📄 Tool Documentation
- web_search: Browses the web for real-time data.
- shell_exec: Runs bash commands. Supports complex multi-line scripts.
- upload_file: Uploads local assets to the AI context.
- pass_turn: Moves the turn to a specific agent by name.
🤝 Contributing
Swarm is maintained by ProgVM.
- GitHub: https://github.com/ProgVM
- Email: progvminc@gmail.com
Feel free to open issues or submit pull requests for new features!
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmai-1.0.2.tar.gz.
File metadata
- Download URL: swarmai-1.0.2.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c355bc58cf31a5769ea74fa0aa27e6fbab271e1e5327257587ea41e5e0361501
|
|
| MD5 |
b916ab77404aa7dfc6f887098c764a05
|
|
| BLAKE2b-256 |
4bf5d0a541e39c4b1e472369febbcd9f132d1c687ed95d11eb8c36b02ab64fab
|
File details
Details for the file swarmai-1.0.2-py3-none-any.whl.
File metadata
- Download URL: swarmai-1.0.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1755235f67b876dcf0de1143d49c7dbaa71bd3587e31c54f8ff0c6c341e0822f
|
|
| MD5 |
1af65a597675628c2f020f199976f27c
|
|
| BLAKE2b-256 |
3cc12450cf9a480c16c151660e85dcdf500f714ddd79069325d0e3fabdb4416d
|