Skip to main content

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

Metadata

Release files for bedrock-swarm 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bedrock-swarm 0.4.0
File Size Uploaded Provenance
bedrock_swarm-0.4.0.tar.gz 28.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bedrock-swarm 0.4.0
File Interpreter ABI Platform
bedrock_swarm-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.3 kB

Release files / bedrock_swarm-0.4.0.tar.gz

Download URL bedrock_swarm-0.4.0.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cd39aeedd4bf9810bbacbf1c0b50dc48f47027fdbd02de93c082477a38a404ca
BLAKE2b-256 checksum
How to use checksums
8213f144791c4f6873b944d6671e8701e7d2b0a06f55e7785650965c5ac7e645
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 21, 2025.

Transparency log

Release files / bedrock_swarm-0.4.0-py3-none-any.whl

Download URL bedrock_swarm-0.4.0-py3-none-any.whl
Size 34.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a49a6d379bdf8a00951070ed97b851a8a952450aa7ef9fa6678f0026c5c2b1ee
BLAKE2b-256 checksum
How to use checksums
733f9648aff585f05388dfa41621d831b7fb76468138dd43dfa833105bbfcb87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 21, 2025.

Transparency log

Security for bedrock-swarm 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bedrock_swarm-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 21, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page