In this guide, I’ll walk through how I built a hotel room booking assistant using Amazon Bedrock Agents and AWS Lambda, combining large language models with real business logic.
The goal? Let customers ask questions about hotel rooms, check availability, and book a room, all through natural conversation.
This isn’t just another chatbot. Behind the scenes, it:
- Pulls room descriptions from a knowledge base (S3 PDF)
- Checks real-time room availability via DynamoDB
- Books reservations using a serverless API
- And coordinates all of this using Bedrock Agents + Action Groups
Why this project matters
If you're working with hotels, resorts, or any customer-facing business, conversational interfaces are becoming more than a nice-to-have, they're a competitive advantage. Instead of just answering FAQs, this agent can actually act: check, query, and write to your backend systems.
This project is meant to show exactly how that’s possible, and how far Bedrock Agents have come.
We’ll create:
- An Amazon Bedrock Agent powered by Claude 3.5 Sonnet
- A Knowledge Base (PDF stored in S3) describing room types
- Two Action Groups (backed by Lambda + OpenAPI):
- One to check room availability
- Another to book a reservation
- A couple of DynamoDB tables for storing room and booking data
- And a simple walkthrough to connect it all together
Let’s get into the build.
Head over to the Amazon Bedrock console:
Start by creating a new agent, give it a name and a short description , like so:
Once the agent is created, it's time to choose the foundation model it will use to generate responses. Click on Select Model
Choose Anthropic
as the provider and select the Claude 3.5 Sonnet
model, then click Apply.
If you don’t have access to this model yet, go to Model Access in the Bedrock console and request access for Claude 3.5 Sonnet.
You should now see the selected model listed in the Agent Builder:
Now, time for us to fill the Instruction for Agent
input box. Scroll down to the Instruction for Agent section. copy the instruction from this GitHub Link, and paste it into the instruction input box:
Next, expand Additional Settings
and make sure User Input
is enabled, this way the agent can ask clarification question from user to make a correct decision when needed.
Now scroll back to the top, click Save
, and then Prepare
:
Time for a quick test:
Notice how the agent uses the instructions to guide its answers.
Clone the CDK Repository
Now let’s set up the backend infrastructure:
git clone https://github.com/mohsinsheikhani/bedrock-hotel-agent
cd bedrock-hotel-agent
npm install
cdk deploy
This will provision:
- 2 Lambda functions (check & book availability)
- 2 DynamoDB tables
- 1 S3 bucket (to store the knowledge base PDF)
To add sample room availability to the HotelRoomAvailabilityTable
, run the following scriptL
python3 ./scripts/insert-to-room-availability.py
To verify, go to the DynamoDB Console, open the HotelRoomAvailabilityTable
, and click Explore Items:
Add Domain Knowledge Using Bedrock Knowledge Base
Right now, the agent knows how to help, thanks to the instructions we gave it, but it still doesn’t know what types of rooms exist or what amenities each offers.
Let’s fix that.
We’ll give the agent real hotel knowledge using Amazon Bedrock Knowledge Bases, backed by an S3-hosted PDF.
This is where Retrieval-Augmented Generation (RAG) comes into play. Instead of stuffing everything into the prompt, the model can now pull specific answers directly from documents, structured or unstructured, at runtime.
Start by uploading the Hilton-Portfolio.pdf
file (included in the repo) to the S3 bucket we provisioned with CDK: agent-kb-assets
.
Next, we’ll create a knowledge base and wire it to our agent so it can pull context from this PDF when answering questions.
Head to the Amazon Bedrock Console, Look for Knowledge Bases
underneath Builder tools
, click on it.
Click Create
and choose the Knowledge base with vector store
option:
Fill up the Knowledge Base details with a name, and choose S3 as the Data Source
Next step, is to configure the Data Source and point to the S3 path where your PDF lives:
For Embeddings, select Amazon Titan
. For Vector Store, choose Amazon OpenSearch Serverless
This setup gives you serverless RAG with native AWS services:
Click Next, review your configuration, then click Create
.
Once it’s created, open your Knowledge Base and click Sync
to begin parsing the document and storing the chunks for semantic search:
Return to the Agent Builder
, scroll down to the Knowledge bases
section:
Click Add knowledge base, select the one you just created, and fill in the Instruction box with:
As an agent route any question by the user related to room type, room amenities, room description, hotel location to the knowledge bases.
Click Add
, and you’ll see it appear in the list:
Then, click Save, and Prepare your agent:
Now give the agent a prompt like:
What amenities are included in Embassy Suites by Hilton?
The response should include real answers from the document you uploaded.
But what’s even cooler?
Scroll down and open the Orchestration trace. You’ll see the agent actively calling the Knowledge Base behind the scenes:
This confirms our RAG setup is working, the agent is now retrieval-aware and can ground its responses in real business content.
Clean Up the Knowledge Base (To Avoid Charges)
Amazon Bedrock Knowledge Bases can incur ongoing charges, especially due to the underlying OpenSearch collection.
At this point, if you're just experimenting or done testing:
- Go back to Agent Builder and remove the Knowledge Base from your agent.
- Then, head to Builder Tools → Knowledge Bases and delete the Knowledge Base itself.
- Finally, check the OpenSearch Service dashboard. If there's a collection still running, delete it too.
This will ensure you’re not billed unnecessarily going forward.
Action Group 01 - Room Availability Checks
Now let’s move beyond answering questions and into actions.
Action Groups are just backend utilities which the Bedrock Agent uses to call external code on our behalf.
We'll start with a simple but critical one:
Checking if a specific room is available for a customer’s requested dates.
Go to your Agent Builder and scroll to Action groups.
Click Add, give your Action Group a name, and configure it as follows:
- Action group type: Define with API schema
- Lambda function: Select the existing one:
RoomAvailabilityHandler
For the API Schema, choose Define via in-line schema editor
.
Then paste the OpenAPI schema from this GitHub Link
Click Create, and you’ll see it appear in your Action Groups list:
Give the Agent Permission to Call the Lambda
By default, the agent can't invoke your Lambda function, we need to explicitly allow it.
- Go to the
RoomAvailabilityHandler
function in Lambda console. - In the Configuration tab, scroll to Permissions > Resource-based policy statements
- Click Add permissions
Fill it out like so:
Head back to Agent Builder, and click Save and then Prepare:
Try testing it out:
Can you check the room availability for 2025-12-25?
You’ll see the agent reason through the prompt and call your Lambda:
And in the tracing panel, you'll notice that the agent invoked your Action Group exactly when it needed to:
That wraps up our first Action Group i.e. Room availability.
Action Group 02 - Room Booking
Now that our agent can check availability, it’s time to let it book a room when the user is ready.
We’ll create a second Action Group that invokes a Lambda function to store booking details in DynamoDB.
Create another Action Group choosing the same steps i.e.:
Just like before, go to Agent Builder > Action groups and click Add.
Configure it with:
- Action group type: Define with API schema
- Lambda function:
HotelRoomBookingHandler
- API Schema: Select in-line schema editor and paste the OpenAPI schema from this GitHub Link
Click Create, and you’ll see it appear in your Action Groups list:
Give the Agent Permission to Call the Lambda
Your agent can’t call this function until you give it explicit permission.
- Go to the
HotelRoomBookingHandler
function in Lambda console. - In the Configuration tab, scroll to Permissions > Resource-based policy statements
- Click Add permissions
Use the same settings as shown:
Back in Agent Builder, click Save and then Prepare to update the agent.
Test the Full Booking Flow
Once the Booking is successful, verify it by going to DynamoDB, click on Explore Items and choose the HotelRoomBookingTable
and you should see the entry created via the Bedrock Agent.
And that's it, you’ve now wired up an LLM agent that can check room availability and book hotel stays, powered by real APIs.
Top comments (2)
Awesome! Thanks a lot for the detailed article!
Thanks so much! Glad you found it helpful