Introduction: The Vision of an Intelligent Travel Concierge
AWS recently introduced Bedrock AgentCore, a powerful new capability packed with exciting features. Before diving into development, I highly recommend watching the official AWS YouTube walkthrough on Bedrock AgentCore to gain a solid understanding of its core concepts and potential.
This is Part 1 of a series documenting my journey: from a foundational prototype to a sophisticated, multi-agent system on AWS.
In this installment, I focused on the first goal: get a foundational agent running using Amazon Bedrock AgentCore.
Phase 1: Laying the Foundation
Before booking flights or planning itineraries, I needed:
- A secure, scalable runtime to host the AI agent.
- A clean abstraction to communicate with a Large Language Model (LLM).
- A simple HTTP interface, so future systems can invoke it cleanly.
Enter Amazon Bedrock AgentCore—a serverless agent runtime that handles the scaffolding: scaling, security, endpoints, and more. This frees me to concentrate on the actual logic of the agent, not infrastructure plumbing.
The Tools of the Trade
For this phase, I’m using:
- Amazon Bedrock AgentCore – the serverless Agent runtime on AWS.
- Strands Agent framework – makes wrapping LLM calls in “agents” easy.
- Anthropic Claude – the conversational foundation model accessible via Bedrock.
- Python 3.10+ – the language for my agent code.
Getting Started: Step-by-Step
Step 1. Environment Setup
- Ensure your AWS account is provisioned for Bedrock and AgentCore in a supported region (e.g.,
us-east-1
,us-west-2
). - Run
aws configure
to set up your credentials. - In a terminal, create a Python virtual environment (optional but recommended)
- Install the required packages:
pip install bedrock-agentcore strands-agents bedrock-agentcore-starter-toolkit
Step 2. Write the Agent (my_agent.py)
Create a file named my_agent.py and paste in this code:
from bedrock_agentcore import BedrockAgentCoreApp
from strands import Agent
# Initialize the AgentCore application
app = BedrockAgentCoreApp()
# Initialize the agent to use a specific model
agent = Agent(
model="anthropic.claude-3-sonnet-20240229-v1:0" # Use a model ID you have access to
)
@app.entrypoint
def invoke(payload):
"""
Entrypoint for AgentCore: receives JSON payload, invokes LLM, returns response.
Expecting payload like: {"prompt": "Your prompt here"}
"""
user_message = payload.get("prompt", "Hello! How can I help you today?")
result = agent(user_message)
return {"result": result.message}
if __name__ == "__main__":
app.run() # Starts local server (default: http://127.0.0.1:8080)
I have hardcoded the agent here otherewise by default, the strands.Agent() in your my_agent.py uses a default LLM (Anthropic Claude 4.0) through Amazon Bedrock.
• Model access must be granted
You need to go to the AWS Management Console → Amazon Bedrock → Model access, and explicitly enable Claude 4.0 (or whichever model you want).
• Your AWS user/role must have the right permissions
You need to attach the following managed policies (as per quickstart):
AmazonBedrockFullAccess
BedrockAgentCoreFullAccess
-
Step 3. Run the Agent Locally
Start the agent:
python my_agent.py
You should see:
INFO: Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
Step 4. Test the Agent with a Prompt
Invoke-WebRequest -Uri "http://localhost:8080/invocations" `
-Method POST `
-ContentType "application/json" `
-Body '{"prompt": "Plan a 3-day trip to Goa!"}'
You should get a JSON response:
{
"result": {
"role": "assistant",
"content": [
{
"text": "Here's a suggested 3-day itinerary for a trip to Goa..."
}
]
}
}
Thats it! Your AgentCore-backed agent is up and responding to real prompts.
The AgentCore approach wraps your logic inside a server that stays alive, waits for prompts, and returns model outputs—making it production-ready and extensible for multi-agent orchestration.
What’s Next?
So far, we have:
Built a living agent service backed by an LLM.
Wrapped it in a clean, HTTP-accessible interface via AgentCore.
Next: Phase 2! I’ll introduce real-world capabilities—connecting the agent to travel APIs via Amazon Bedrock AgentCore Gateway so it can start retrieving flights, hotels, and more. Stay tuned for that in the next post of this series.
Thank you,
Harsha
Top comments (0)