Metadata-Version: 2.2
Name: multi-swarm
Version: 1.0.1
Summary: A framework for creating collaborative AI agent swarms
Author-email: Bart Van Spitaels <bart.vanspitaels@gmail.com>
License: MIT 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. 
Project-URL: Documentation, https://github.com/bartvanspitaels99/multi-swarm/docs
Project-URL: Source, https://github.com/bartvanspitaels99/multi-swarm/
Project-URL: Issues, https://github.com/bartvanspitaels99/multi-swarm/issues
Keywords: ai,agents,llm,claude,gemini,multi-agent,rag,docker
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anthropic>=0.18.1
Requires-Dist: google-generativeai>=0.3.2
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: docker>=6.1.0
Requires-Dist: sentence-transformers>=2.2.0
Requires-Dist: faiss-cpu>=1.7.4
Requires-Dist: transformers>=4.38.0
Requires-Dist: torch>=2.0.0
Requires-Dist: numpy>=1.24.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.25.0; extra == "dev"
Requires-Dist: pytest-cov>=6.0.0; extra == "dev"
Requires-Dist: black>=24.0.0; extra == "dev"
Requires-Dist: isort>=5.0.0; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Provides-Extra: gpu
Requires-Dist: faiss-gpu>=1.7.4; extra == "gpu"
Requires-Dist: torch>=2.0.0; extra == "gpu"

# 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. 
