A minimal Python project using Strands Agents framework deployed on Amazon Bedrock AgentCore Runtime.
- Python 3.10+
- AWS account with appropriate permissions
- AWS credentials configured
pip install -r requirements.txtpython agent.pyTest with curl:
curl -X POST http://localhost:8080/invocations \
-H "Content-Type: application/json" \
-d '{"prompt": "Hello world!"}'# Install the toolkit
pip install bedrock-agentcore-starter-toolkit
# Configure your agent
agentcore configure --entrypoint agent.py
# Optional: Test locally (requires Docker/Finch/Podman)
agentcore launch --local
# Deploy to AWS
agentcore launch
# Test your deployed agent
agentcore invoke '{"prompt": "Hello from AgentCore!"}'See the custom deployment section in the Strands documentation for building and pushing Docker images to ECR.
.
├── agent.py # Main agent code with AgentCore integration
├── requirements.txt # Python dependencies
└── README.md # This file
from strands import Agent, tool
@tool
def get_weather(location: str) -> str:
"""Get weather for a location."""
return f"Weather in {location}: Sunny, 72°F"
agent = Agent(tools=[get_weather])@app.entrypoint
async def invoke(payload):
user_message = payload.get("prompt", "Hello")
stream = agent.stream_async(user_message)
async for event in stream:
yield event