multi-swarm


Namemulti-swarm JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryA framework for creating collaborative AI agent swarms
upload_time2025-01-31 20:35:41
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Bart Van Spitaels Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ai agents llm claude gemini multi-agent rag docker
VCS
bugtrack_url
requirements anthropic google-generativeai python-dotenv pydantic docker sentence-transformers faiss-cpu transformers torch numpy pytest pytest-asyncio pytest-cov black isort mypy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Multi-Swarm Framework

[![PyPI version](https://badge.fury.io/py/multi-swarm.svg)](https://badge.fury.io/py/multi-swarm)
[![CI](https://github.com/bartvanspitaels99/multi-swarm/actions/workflows/ci.yml/badge.svg)](https://github.com/bartvanspitaels99/multi-swarm/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/bartvanspitaels99/multi-swarm/branch/main/graph/badge.svg)](https://codecov.io/gh/bartvanspitaels99/multi-swarm)
[![Python Versions](https://img.shields.io/pypi/pyversions/multi-swarm.svg)](https://pypi.org/project/multi-swarm/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A powerful framework for creating collaborative AI agent swarms, enabling complex task completion through coordinated agent interactions.

## Features

- Create specialized AI agents with distinct roles and capabilities
- Configure communication flows between agents
- Manage shared resources and knowledge
- Support for multiple LLM providers (Claude and Gemini)
- Built-in security and resource management

## Installation

Basic installation:
```bash
pip install multi-swarm
```

For development installation with testing tools:
```bash
pip install multi-swarm[dev]
```

## Environment Setup

1. Set up your environment variables:
```bash
# .env
ANTHROPIC_API_KEY=your_claude_api_key
GOOGLE_API_KEY=your_gemini_api_key
```

2. If using Cursor AI (recommended):
   - Copy the `.cursorrules` file to your project's root directory
   - This file contains essential instructions for Cursor's Claude agent to better assist with Multi-Swarm development
   - The `.cursorrules` file helps maintain consistent agent behavior and framework best practices

## Quick Start

1. Create a custom agent:
```python
from multi_swarm import Agent

class MyAgent(Agent):
    def __init__(self):
        super().__init__(
            name="MyAgent",
            description="A custom agent for specific tasks",
            instructions="path/to/instructions.md",
            tools_folder="path/to/tools",
            llm_provider="claude",  # or "gemini" - framework automatically selects best model
            provider_config={
                "model": "claude-3-5-sonnet-latest",  # Latest Claude model
                "max_tokens": 4096,
                "api_version": "2024-03"
            },
            temperature=0.7
        )
```

2. Create and run your agency:
```python
from multi_swarm import Agency

# 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()
```

## LLM Provider Configuration

The framework automatically selects the most appropriate LLM model based on the agent's role:

### Claude Models (Anthropic)
- Default model: `claude-3-5-sonnet-latest`
- API version: `2024-03`
- Used for: Complex reasoning, code generation, and detailed analysis
- Best for agents handling: Research, documentation, code review, planning

### Gemini Models (Google)
- Default model: `gemini-2.0-flash-exp`
- API version: `2024-01`
- Used for: Quick responses, data processing, and technical tasks
- Best for agents handling: Data analysis, API integration, system operations

The framework intelligently switches between providers based on:
- Task complexity
- Required capabilities
- Response time needs
- Cost considerations

## Examples

Check out the `examples` directory for complete implementations:
- Research Assistant Agency
- Development Agency
- Trends Analysis Agency

## Documentation

Full documentation is available at [docs/](docs/).

## Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "multi-swarm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "ai, agents, llm, claude, gemini, multi-agent, rag, docker",
    "author": null,
    "author_email": "Bart Van Spitaels <bart.vanspitaels@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b8/98/3471fff89ed7df3d601e45e4ac51f82887d4104d74034883c77fc30dbd9f/multi_swarm-1.0.1.tar.gz",
    "platform": null,
    "description": "# Multi-Swarm Framework\r\n\r\n[![PyPI version](https://badge.fury.io/py/multi-swarm.svg)](https://badge.fury.io/py/multi-swarm)\r\n[![CI](https://github.com/bartvanspitaels99/multi-swarm/actions/workflows/ci.yml/badge.svg)](https://github.com/bartvanspitaels99/multi-swarm/actions/workflows/ci.yml)\r\n[![codecov](https://codecov.io/gh/bartvanspitaels99/multi-swarm/branch/main/graph/badge.svg)](https://codecov.io/gh/bartvanspitaels99/multi-swarm)\r\n[![Python Versions](https://img.shields.io/pypi/pyversions/multi-swarm.svg)](https://pypi.org/project/multi-swarm/)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\nA powerful framework for creating collaborative AI agent swarms, enabling complex task completion through coordinated agent interactions.\r\n\r\n## Features\r\n\r\n- Create specialized AI agents with distinct roles and capabilities\r\n- Configure communication flows between agents\r\n- Manage shared resources and knowledge\r\n- Support for multiple LLM providers (Claude and Gemini)\r\n- Built-in security and resource management\r\n\r\n## Installation\r\n\r\nBasic installation:\r\n```bash\r\npip install multi-swarm\r\n```\r\n\r\nFor development installation with testing tools:\r\n```bash\r\npip install multi-swarm[dev]\r\n```\r\n\r\n## Environment Setup\r\n\r\n1. Set up your environment variables:\r\n```bash\r\n# .env\r\nANTHROPIC_API_KEY=your_claude_api_key\r\nGOOGLE_API_KEY=your_gemini_api_key\r\n```\r\n\r\n2. If using Cursor AI (recommended):\r\n   - Copy the `.cursorrules` file to your project's root directory\r\n   - This file contains essential instructions for Cursor's Claude agent to better assist with Multi-Swarm development\r\n   - The `.cursorrules` file helps maintain consistent agent behavior and framework best practices\r\n\r\n## Quick Start\r\n\r\n1. Create a custom agent:\r\n```python\r\nfrom multi_swarm import Agent\r\n\r\nclass MyAgent(Agent):\r\n    def __init__(self):\r\n        super().__init__(\r\n            name=\"MyAgent\",\r\n            description=\"A custom agent for specific tasks\",\r\n            instructions=\"path/to/instructions.md\",\r\n            tools_folder=\"path/to/tools\",\r\n            llm_provider=\"claude\",  # or \"gemini\" - framework automatically selects best model\r\n            provider_config={\r\n                \"model\": \"claude-3-5-sonnet-latest\",  # Latest Claude model\r\n                \"max_tokens\": 4096,\r\n                \"api_version\": \"2024-03\"\r\n            },\r\n            temperature=0.7\r\n        )\r\n```\r\n\r\n2. Create and run your agency:\r\n```python\r\nfrom multi_swarm import Agency\r\n\r\n# Initialize agents\r\nagent1 = MyAgent()\r\nagent2 = MyAgent()\r\n\r\n# Create agency with communication flows\r\nagency = Agency(\r\n    agents=[\r\n        agent1,  # Entry point for user communication\r\n        [agent1, agent2],  # agent1 can communicate with agent2\r\n    ],\r\n    shared_instructions=\"agency_manifesto.md\"\r\n)\r\n\r\n# Run the agency\r\nagency.run_demo()\r\n```\r\n\r\n## LLM Provider Configuration\r\n\r\nThe framework automatically selects the most appropriate LLM model based on the agent's role:\r\n\r\n### Claude Models (Anthropic)\r\n- Default model: `claude-3-5-sonnet-latest`\r\n- API version: `2024-03`\r\n- Used for: Complex reasoning, code generation, and detailed analysis\r\n- Best for agents handling: Research, documentation, code review, planning\r\n\r\n### Gemini Models (Google)\r\n- Default model: `gemini-2.0-flash-exp`\r\n- API version: `2024-01`\r\n- Used for: Quick responses, data processing, and technical tasks\r\n- Best for agents handling: Data analysis, API integration, system operations\r\n\r\nThe framework intelligently switches between providers based on:\r\n- Task complexity\r\n- Required capabilities\r\n- Response time needs\r\n- Cost considerations\r\n\r\n## Examples\r\n\r\nCheck out the `examples` directory for complete implementations:\r\n- Research Assistant Agency\r\n- Development Agency\r\n- Trends Analysis Agency\r\n\r\n## Documentation\r\n\r\nFull documentation is available at [docs/](docs/).\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\r\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\r\n4. Push to the branch (`git push origin feature/amazing-feature`)\r\n5. Open a Pull Request\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. \r\n",
    "bugtrack_url": null,
    "license": "MIT License\r\n        \r\n        Copyright (c) 2024 Bart Van Spitaels\r\n        \r\n        Permission is hereby granted, free of charge, to any person obtaining a copy\r\n        of this software and associated documentation files (the \"Software\"), to deal\r\n        in the Software without restriction, including without limitation the rights\r\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n        copies of the Software, and to permit persons to whom the Software is\r\n        furnished to do so, subject to the following conditions:\r\n        \r\n        The above copyright notice and this permission notice shall be included in all\r\n        copies or substantial portions of the Software.\r\n        \r\n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n        SOFTWARE. ",
    "summary": "A framework for creating collaborative AI agent swarms",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://github.com/bartvanspitaels99/multi-swarm/docs",
        "Issues": "https://github.com/bartvanspitaels99/multi-swarm/issues",
        "Source": "https://github.com/bartvanspitaels99/multi-swarm/"
    },
    "split_keywords": [
        "ai",
        " agents",
        " llm",
        " claude",
        " gemini",
        " multi-agent",
        " rag",
        " docker"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "793abe6e36c75f0dd5196ffc8ecd1bfa6de937e711901d1ec42ebaf6641a4baf",
                "md5": "f2a8117ef639254f2c29d068eacbcd74",
                "sha256": "4c95e4979818ed0100e999ff84cf10bae21207ebbc038bb3e1c810dd516de1be"
            },
            "downloads": -1,
            "filename": "multi_swarm-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f2a8117ef639254f2c29d068eacbcd74",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 23624,
            "upload_time": "2025-01-31T20:35:40",
            "upload_time_iso_8601": "2025-01-31T20:35:40.209229Z",
            "url": "https://files.pythonhosted.org/packages/79/3a/be6e36c75f0dd5196ffc8ecd1bfa6de937e711901d1ec42ebaf6641a4baf/multi_swarm-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b8983471fff89ed7df3d601e45e4ac51f82887d4104d74034883c77fc30dbd9f",
                "md5": "8a134f95aa0e95080ead0c3197d94ba0",
                "sha256": "caebc632cb2b03c2691fccfb0c8737c5bdcaf33769897cc97be46a55fa529cb3"
            },
            "downloads": -1,
            "filename": "multi_swarm-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8a134f95aa0e95080ead0c3197d94ba0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 66430,
            "upload_time": "2025-01-31T20:35:41",
            "upload_time_iso_8601": "2025-01-31T20:35:41.413997Z",
            "url": "https://files.pythonhosted.org/packages/b8/98/3471fff89ed7df3d601e45e4ac51f82887d4104d74034883c77fc30dbd9f/multi_swarm-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-31 20:35:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bartvanspitaels99",
    "github_project": "multi-swarm",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "anthropic",
            "specs": [
                [
                    ">=",
                    "0.18.1"
                ]
            ]
        },
        {
            "name": "google-generativeai",
            "specs": [
                [
                    ">=",
                    "0.3.2"
                ]
            ]
        },
        {
            "name": "python-dotenv",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "docker",
            "specs": [
                [
                    ">=",
                    "6.1.0"
                ]
            ]
        },
        {
            "name": "sentence-transformers",
            "specs": [
                [
                    ">=",
                    "2.2.0"
                ]
            ]
        },
        {
            "name": "faiss-cpu",
            "specs": [
                [
                    ">=",
                    "1.7.4"
                ]
            ]
        },
        {
            "name": "transformers",
            "specs": [
                [
                    ">=",
                    "4.38.0"
                ]
            ]
        },
        {
            "name": "torch",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.24.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    ">=",
                    "8.0.0"
                ]
            ]
        },
        {
            "name": "pytest-asyncio",
            "specs": [
                [
                    ">=",
                    "0.25.0"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    ">=",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "black",
            "specs": [
                [
                    ">=",
                    "24.0.0"
                ]
            ]
        },
        {
            "name": "isort",
            "specs": [
                [
                    ">=",
                    "5.0.0"
                ]
            ]
        },
        {
            "name": "mypy",
            "specs": [
                [
                    ">=",
                    "1.8.0"
                ]
            ]
        }
    ],
    "lcname": "multi-swarm"
}
        
Elapsed time: 1.43877s