A framework for building multi-agent systems using AWS Bedrock
Project description
🤖 Bedrock Swarm
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:
- Agency Example - Basic agency setup and usage
- Time Example - Working with time-related tools
- Tool Example - Creating and using custom tools
- Trace Example - Event tracing and monitoring
To run the examples:
- Install with development dependencies:
pip install "bedrock-swarm[dev]"
- Set up your AWS credentials:
export AWS_PROFILE=your-profile
export AWS_REGION=your-region
- 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:
- Check out our Contributing Guidelines
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run the tests (
pytest tests/unit -v) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Make sure to:
- Follow the existing code style (we use
blackandisort) - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd39aeedd4bf9810bbacbf1c0b50dc48f47027fdbd02de93c082477a38a404ca
|
|
| MD5 |
9ac9dcb360cf072bc5addb3f8bdaaf21
|
|
| BLAKE2b-256 |
8213f144791c4f6873b944d6671e8701e7d2b0a06f55e7785650965c5ac7e645
|
Provenance
The following attestation bundles were made for bedrock_swarm-0.4.0.tar.gz:
Publisher:
release.yml on sandrich/bedrock-swarm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bedrock_swarm-0.4.0.tar.gz -
Subject digest:
cd39aeedd4bf9810bbacbf1c0b50dc48f47027fdbd02de93c082477a38a404ca - Sigstore transparency entry: 173293912
- Sigstore integration time:
-
Permalink:
sandrich/bedrock-swarm@55963373cc9d1d27a66cd7081b83e54283091cc6 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/sandrich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@55963373cc9d1d27a66cd7081b83e54283091cc6 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a49a6d379bdf8a00951070ed97b851a8a952450aa7ef9fa6678f0026c5c2b1ee
|
|
| MD5 |
98efa41fcc32ac129c8ccdad2ee7a1f6
|
|
| BLAKE2b-256 |
733f9648aff585f05388dfa41621d831b7fb76468138dd43dfa833105bbfcb87
|
Provenance
The following attestation bundles were made for bedrock_swarm-0.4.0-py3-none-any.whl:
Publisher:
release.yml on sandrich/bedrock-swarm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bedrock_swarm-0.4.0-py3-none-any.whl -
Subject digest:
a49a6d379bdf8a00951070ed97b851a8a952450aa7ef9fa6678f0026c5c2b1ee - Sigstore transparency entry: 173293913
- Sigstore integration time:
-
Permalink:
sandrich/bedrock-swarm@55963373cc9d1d27a66cd7081b83e54283091cc6 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/sandrich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@55963373cc9d1d27a66cd7081b83e54283091cc6 -
Trigger Event:
push
-
Statement type: