Observed since 20 Oct, 23:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
AWS Bedrock AgentCore implementation for ai-agentswarm.
An implementation of the AWS Bedrock AgentCore SDK for the ai-agentswarm framework.
This library eliminates boilerplate to create and execute agents in the Bedrock infrastructure.
pip install agentswarm-bedrock-agentcore
Extend BedrockAgent to create your agent. You can then use the .serve() method to start a Bedrock AgentCore compatible WebSocket server.
from agentswarm.bedrock_agentcore import BedrockAgent
from agentswarm.datamodels import Context
from agentswarm.llms import GoogleGenAI
# Initialize your LLM
llm = GoogleGenAI(model_name="gemini-1.5-pro")
class MyBedrockAgent(BedrockAgent):
def id(self) -> str:
return "my-awesome-agent"
async def execute(self, user_id: str, context: Context, input: str = None):
# Your custom agent logic here
# The context will have the default_llm if passed to .serve()
return f"Bedrock Agent says: I processed '{input}'"
if __name__ == "__main__":
# Start the server and pass the default_llm
MyBedrockAgent().serve(port=8000, default_llm=llm)
Use BedrockRemoteAgent to call an agent that is already running. It supports both local WebSocket endpoints and AWS Bedrock ARNs.
from agentswarm.bedrock_agentcore import BedrockRemoteAgent
from agentswarm.datamodels import Context
# Use an ARN for cloud invocation (after deployment)
# or "http://localhost:8000" for local testing
AGENT_ENDPOINT = "arn:aws:bedrock-agentcore:us-west-2:123456789012:runtime/my-agent-abc"
# Create a proxy for the remote agent
remote_agent = BedrockRemoteAgent(
endpoint_url=AGENT_ENDPOINT,
remote_agent_id="my-awesome-agent"
)
# Use it like any other AgentSwarm agent
# Note: Provide required context arguments for initialization
result = await remote_agent.execute(
user_id="user-123",
context=Context(trace_id="trace-1", messages=[], store=None, tracing=None),
input="Hello Bedrock!"
)
print(result)
To deploy your agent natively to the Amazon Bedrock AgentCore Runtime, use the official Bedrock AgentCore Starter Toolkit.
pip install bedrock-agentcore-starter-toolkit
Run the interactive configuration tool to set up your deployment (entrypoint, region, runtime, etc.).
agentcore configure
This will create or update a .bedrock_agentcore.yaml file with your settings.
The launch command packages your code, installs dependencies from requirements.txt, and deploys it to the managed Bedrock runtime.
# Recommended: Cloud-based deployment (Direct Code Deploy)
agentcore launch
This command will return an Agent ARN which you can then use to invoke your agent via BedrockRemoteAgent.
Ensure your requirements.txt includes the necessary libraries for the remote runtime:
ai-agentswarm>=0.5.1
agentswarm-bedrock-agentcore>=0.1.0
You can configure the model via environment variables in your .bedrock_agentcore.yaml:
env:
DEFAULT_LLM_MODEL: gemini-2.5-flash
# Core logic and Bedrock implementation
pip install ai-agentswarm agentswarm-bedrock-agentcore
# Deployment Toolkit
pip install bedrock-agentcore-starter-toolkit
Verify the bridge before deploying.
Server:
export RUN_SERVER=true
python examples/bedrock_demo.py
Client (Proxy):
# In another terminal
python examples/bedrock_demo.py
export UV_CACHE_DIR=./.uv_cache (optional, for permissions fix)agentcore configureagentcore launchContributions are welcome! Please feel free to submit a Pull Request.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.2 | 23 Feb 2026 | 10 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 23:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:eab06add518ee4c6bc5160cbaaa9f41a93aefecd9aa603b9102a93ceca3f5dda