Skip to main content

A framework for building multi-agent systems using AWS Bedrock

Project description

🤖 Bedrock Swarm

PyPI version Python Documentation Status Tests Coverage License: MIT Code style: black

Bedrock Swarm Logo

A powerful framework for building multi-agent systems using AWS Bedrock. Create, manage, and orchestrate AI agents powered by state-of-the-art language models.

📚 Documentation

Full documentation is available at bedrock-swarm.readthedocs.io. This includes:

  • Getting Started Guide
  • Core Concepts
  • API Reference
  • Examples
  • Contributing Guidelines

✨ Features

  • 🚀 Easy-to-use API - Create and manage AI agents with just a few lines of code
  • 🤝 Multi-Agent Support - Build complex systems with multiple cooperating agents
  • 🔧 Extensible Tool System - Create and add custom tools to enhance agent capabilities
  • 💾 Memory Management - Built-in conversation memory for persistent context
  • 🔒 Type Safety - Full type hints and runtime type checking
  • 📚 Comprehensive Documentation - Detailed guides and API reference

🛠️ Installation

# Basic installation
pip install bedrock-swarm

# With development dependencies
pip install "bedrock-swarm[dev]"

# With documentation dependencies
pip install "bedrock-swarm[docs]"

🚀 Quick Start

Here's a simple example using an agent with the built-in CurrentTimeTool:

from bedrock_swarm.agency import Agency
from bedrock_swarm.agents import BedrockAgent
from bedrock_swarm.tools.time import CurrentTimeTool

# Create a specialist agent
time_agent = BedrockAgent(
    name="time_agent",
    model_id="us.anthropic.claude-3-5-sonnet-20241022-v2:0",
    tools=[CurrentTimeTool()],
    system_prompt="You are a helpful assistant that can tell the current time in different formats and timezones."
)

# Create agency with the specialist
agency = Agency(specialists=[time_agent])

# Process time-related requests
response = agency.process_request("What time is it now?")
print(f"Response: {response}")

response = agency.process_request("What time is it in UTC?")
print(f"Response: {response}")

🎯 Examples

Check out our examples directory for ready-to-use examples:

  1. Agency Example - Basic agency setup and usage
  2. Time Example - Working with time-related tools
  3. Tool Example - Creating and using custom tools
  4. Trace Example - Event tracing and monitoring

To run the examples:

  1. Install with development dependencies:
pip install "bedrock-swarm[dev]"
  1. Set up your AWS credentials:
export AWS_PROFILE=your-profile
export AWS_REGION=your-region
  1. Run an example:
python examples/time_example.py

🛠️ Built-in Tools

CurrentTimeTool

A versatile tool for getting the current time and date in various formats and timezones:

from bedrock_swarm.tools.time import CurrentTimeTool

time_tool = CurrentTimeTool()

# Get current time in ISO format
current_time = time_tool.execute()  # Returns: "2024-03-14T15:09:26"

# Get time in specific format
formatted_time = time_tool.execute(
    format="%Y-%m-%d %H:%M:%S"
)  # Returns: "2024-03-14 15:09:26"

# Get time in specific timezone
utc_time = time_tool.execute(
    timezone="UTC",
    format="%H:%M:%S"
)  # Returns: "15:09:26"

# Get formatted date in specific timezone
tokyo_date = time_tool.execute(
    timezone="Asia/Tokyo",
    format="%A, %B %d, %Y"
)  # Returns: "Thursday, March 14, 2024"

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Check out our Contributing Guidelines
  2. Fork the repository
  3. Create a new branch (git checkout -b feature/amazing-feature)
  4. Make your changes
  5. Run the tests (pytest tests/unit -v)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

Make sure to:

  • Follow the existing code style (we use black and isort)
  • Add tests for new features
  • Update documentation as needed

🙏 Special Thanks

This project was inspired by and builds upon the excellent work of:

  • Agency Swarm - A pioneering framework for multi-agent systems
  • The AWS Bedrock team for providing powerful foundation models
  • The open-source community for their invaluable contributions

📄 License

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

MIT License

Copyright (c) 2024 Chris Sandrini

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 details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bedrock_swarm-0.4.0.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

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

bedrock_swarm-0.4.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file bedrock_swarm-0.4.0.tar.gz.

File metadata

  • Download URL: bedrock_swarm-0.4.0.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bedrock_swarm-0.4.0.tar.gz
Algorithm Hash digest
SHA256 cd39aeedd4bf9810bbacbf1c0b50dc48f47027fdbd02de93c082477a38a404ca
MD5 9ac9dcb360cf072bc5addb3f8bdaaf21
BLAKE2b-256 8213f144791c4f6873b944d6671e8701e7d2b0a06f55e7785650965c5ac7e645

See more details on using hashes here.

Provenance

The following attestation bundles were made for bedrock_swarm-0.4.0.tar.gz:

Publisher: release.yml on sandrich/bedrock-swarm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bedrock_swarm-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: bedrock_swarm-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bedrock_swarm-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a49a6d379bdf8a00951070ed97b851a8a952450aa7ef9fa6678f0026c5c2b1ee
MD5 98efa41fcc32ac129c8ccdad2ee7a1f6
BLAKE2b-256 733f9648aff585f05388dfa41621d831b7fb76468138dd43dfa833105bbfcb87

See more details on using hashes here.

Provenance

The following attestation bundles were made for bedrock_swarm-0.4.0-py3-none-any.whl:

Publisher: release.yml on sandrich/bedrock-swarm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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