Skip to main content

A framework for creating collaborative AI agent swarms

Project description

Multi-Swarm Framework

PyPI version CI codecov Python Versions License: MIT

A powerful framework for creating collaborative AI agent swarms, leveraging multiple LLM providers including Claude and Gemini.

Features

  • Create collaborative agent swarms with distinct roles and capabilities
  • Support for multiple LLM providers (Claude and Gemini)
  • Easy-to-use agent template creation
  • Flexible agency configuration
  • Built-in tools system
  • Asynchronous communication between agents

Installation

pip install multi-swarm

For development installation with testing tools:

pip install multi-swarm[dev]

Quick Start

  1. Set up your environment variables:
# .env
ANTHROPIC_API_KEY=your_claude_api_key
GOOGLE_API_KEY=your_gemini_api_key
  1. Create a simple agency:
from multi_swarm import Agency, BaseAgent

# Create custom agents
class MyAgent(BaseAgent):
    def __init__(self):
        super().__init__(
            name="MyAgent",
            description="A custom agent for specific tasks",
            instructions="path/to/instructions.md",
            tools_folder="path/to/tools",
            model="claude-3-sonnet",
            temperature=0.7
        )

# Initialize agents
agent1 = MyAgent()
agent2 = MyAgent()

# Create agency with communication flows
agency = Agency(
    agents=[
        agent1,  # Entry point for user communication
        [agent1, agent2],  # agent1 can communicate with agent2
    ],
    shared_instructions="agency_manifesto.md"
)

# Run the agency
agency.run_demo()

Examples

Check out our example implementations in the examples directory:

  1. Google Trends Analysis Agency: Shows how to create a specialized agency for analyzing Google Trends data. This example demonstrates:
    • Custom agent creation (CEO and TrendsAnalyst)
    • Communication flow setup
    • Agent instructions and tools structure
    • Basic agency configuration

Documentation

For detailed documentation, please visit our GitHub repository.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. Here are some ways you can contribute:

  • Add new agent types
  • Implement useful tools
  • Improve documentation
  • Add tests
  • Report bugs
  • Suggest features

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

multi_swarm-1.0.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

multi_swarm-1.0.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: multi_swarm-1.0.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for multi_swarm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 57bd07d588109cc67c2902e99efdc87dd4193f6ad9d3d42819cb1565bd013b11
MD5 5b17826f896a916c885b38902438e023
BLAKE2b-256 e627f1efc31e61a4eb12f61b264fb60f46e6a32d66144168c03e727a1dc5ce2c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: multi_swarm-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for multi_swarm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b10318694a323fd6f94ea6ad12b13e2af5968ea9f8b90d2474e8080cbda9e9a
MD5 0feb7452d77fdc378c0db2b30eea72f8
BLAKE2b-256 9b679dfd7ca2ec00d34e0d0293f208588eebdaced47be3398e7eecafd8c4fbe1

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