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.
✨ 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.agency import Agency
from bedrock_swarm.config import AWSConfig
from bedrock_swarm.tools.time import CurrentTimeTool
# Create AWS config
aws_config = AWSConfig(region="us-east-1")
# Create agency
agency = Agency(aws_config=aws_config)
# Create an agent with the time tool
agent = agency.add_agent(
name="time_agent",
model_id="us.anthropic.claude-3-5-sonnet-20241022-v2:0",
tools=[CurrentTimeTool()],
instructions="You are a helpful assistant that can tell the current time in different formats and timezones.",
)
# Create a thread
thread = agency.create_thread("time_agent")
# Example conversation
messages = [
"What time is it now?",
"What time is it in UTC?",
"What's the current date in YYYY-MM-DD format?",
]
for message in messages:
response = agency.execute(thread.thread_id, message)
print(f"User: {message}")
print(f"Assistant: {response.content}\n")
🎯 Examples
Check out our examples directory for ready-to-use examples:
- Simple Time Example - A basic example showing how to:
- Configure AWS and create an agent
- Use the CurrentTimeTool for time-related queries
- Handle different time formats and timezones
To run the examples:
- Install with development dependencies:
pip install "bedrock-swarm[dev]"
- Set up your environment variables:
export AWS_REGION=us-west-2
export AWS_PROFILE=default
- Run an example:
python examples/simple_time.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"
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.1.8.tar.gz.
File metadata
- Download URL: bedrock_swarm-0.1.8.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d31afa545880e415b6f78ca21d6cb642e554506e528df25c92510c3f5a7514fe
|
|
| MD5 |
2930ecb6fbd3127273cd10e7cdf4b405
|
|
| BLAKE2b-256 |
bb179e87d78a63b450d707504a33d7f1b493b5e43a03d2542f798e5796391b31
|
Provenance
The following attestation bundles were made for bedrock_swarm-0.1.8.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.1.8.tar.gz -
Subject digest:
d31afa545880e415b6f78ca21d6cb642e554506e528df25c92510c3f5a7514fe - Sigstore transparency entry: 169389962
- Sigstore integration time:
-
Permalink:
sandrich/bedrock-swarm@07718f70484d8ca45f3763d9bb71682da78f46b2 -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/sandrich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@07718f70484d8ca45f3763d9bb71682da78f46b2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bedrock_swarm-0.1.8-py3-none-any.whl.
File metadata
- Download URL: bedrock_swarm-0.1.8-py3-none-any.whl
- Upload date:
- Size: 30.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f205978447251be75e9e3a21d757efd84eed90b9813ad2c4bb89851c41c918ed
|
|
| MD5 |
0ffa53dd4ecbb012f188341d41e16056
|
|
| BLAKE2b-256 |
6ab871224b58ab81153591177fef0e8dc4651df5642b37dbc3a4c40b4125c684
|
Provenance
The following attestation bundles were made for bedrock_swarm-0.1.8-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.1.8-py3-none-any.whl -
Subject digest:
f205978447251be75e9e3a21d757efd84eed90b9813ad2c4bb89851c41c918ed - Sigstore transparency entry: 169389963
- Sigstore integration time:
-
Permalink:
sandrich/bedrock-swarm@07718f70484d8ca45f3763d9bb71682da78f46b2 -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/sandrich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@07718f70484d8ca45f3763d9bb71682da78f46b2 -
Trigger Event:
push
-
Statement type: