DEV Community

Cover image for Hands-On with Amazon Bedrock Agents: Hotel Booking Assistant with Action Groups and Knowledge Bases
Mohsin Sheikhani
Mohsin Sheikhani

Posted on

Hands-On with Amazon Bedrock Agents: Hotel Booking Assistant with Action Groups and Knowledge Bases

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:

Hotel Booking Amazon Bedrock Agent Architecture

  • 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:

Amazon Bedrock Agent Console

Start by creating a new agent, give it a name and a short description , like so:

Creating an Amazon Bedrock Agent

Once the agent is created, it's time to choose the foundation model it will use to generate responses. Click on Select Model

Agent Builder

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.

Claude 3.5 Sonnet model selection

You should now see the selected model listed in the Agent Builder:

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:

Instruction for Amazon Bedrock Agent

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.

User Input enable for Amazon Bedrock Agent

Now scroll back to the top, click Save, and then Prepare:

Edit in Agent Builder

Time for a quick test:

Initial test for Amazon Bedrock Agent

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

To verify, go to the DynamoDB Console, open the HotelRoomAvailabilityTable, and click Explore Items:

Explore Items on HotelRoomAvailabilityTable DynamoDB Table

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.

Uploaded file on S3 bucket for Amazon Bedrock Knowledge Bases

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.

Knowledge Bases on Amazon Bedrock console

Click Create and choose the Knowledge base with vector store option:

Knowledge Base with vector store, Amazon Bedrock Agent

Fill up the Knowledge Base details with a name, and choose S3 as the Data Source

Knowledge Base Details

Next step, is to configure the Data Source and point to the S3 path where your PDF lives:

Configure Knowledge Base Data Source for Amazon Bedrock Agent

For Embeddings, select Amazon Titan. For Vector Store, choose Amazon OpenSearch Serverless

This setup gives you serverless RAG with native AWS services:

Configure data storage and processing, using Amazon Titan as the embedding model and Amazon OpenSearch Serverless as the vector data store

Click Next, review your configuration, then click Create.

Amazon Bedrock Knowledge Base creation in-progress

Once it’s created, open your Knowledge Base and click Sync to begin parsing the document and storing the chunks for semantic search:

Syncing Knowledge Base with Amazon S3 Data source

Return to the Agent Builder, scroll down to the Knowledge bases section:

Knowledge Bases, Agent Builder

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.
Enter fullscreen mode Exit fullscreen mode

Add Knowledge Base

Click Add, and you’ll see it appear in the list:

Added Knowledge Base to Amazon Bedrock Agent

Then, click Save, and Prepare your agent:

Edit in Agent Builder

Now give the agent a prompt like:

What amenities are included in Embassy Suites by Hilton?
Enter fullscreen mode Exit fullscreen mode

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:

Orchestration and Knowledge Base

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:

  1. Go back to Agent Builder and remove the Knowledge Base from your agent.
  2. Then, head to Builder Tools → Knowledge Bases and delete the Knowledge Base itself.
  3. 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.

Action Group, Amazon Bedrock Agent

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

Create Action Group, Amazon Bedrock Agent

For the API Schema, choose Define via in-line schema editor.
Then paste the OpenAPI schema from this GitHub Link

Action Group Schema, Amazon Bedrock Agent

Click Create, and you’ll see it appear in your Action Groups list:

Action Group List, Amazon Bedrock Agent

Give the Agent Permission to Call the Lambda

By default, the agent can't invoke your Lambda function, we need to explicitly allow it.

  1. Go to the RoomAvailabilityHandler function in Lambda console.
  2. In the Configuration tab, scroll to Permissions > Resource-based policy statements
  3. Click Add permissions

Fill it out like so:

Assigning Permissions to Amazon Bedrock Agents to invoke a lambda function

Head back to Agent Builder, and click Save and then Prepare:

Edit in Agent Builder

Try testing it out:

Can you check the room availability for 2025-12-25?
Enter fullscreen mode Exit fullscreen mode

You’ll see the agent reason through the prompt and call your Lambda:

Testing Amazon Bedrock Agent

And in the tracing panel, you'll notice that the agent invoked your Action Group exactly when it needed to:

Orchestration and Knowledge Base

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

Action Group Schema, Amazon Bedrock Agent

Action Group Schema, Amazon Bedrock Agent

Click Create, and you’ll see it appear in your Action Groups list:

Action Group List, Amazon Bedrock Agent

Give the Agent Permission to Call the Lambda

Your agent can’t call this function until you give it explicit permission.

  1. Go to the HotelRoomBookingHandler function in Lambda console.
  2. In the Configuration tab, scroll to Permissions > Resource-based policy statements
  3. Click Add permissions

Lambda Resource-based policy statements

Lambda Resource-based policy statements

Use the same settings as shown:

Assigning Permissions to Amazon Bedrock Agents to invoke a lambda function

Lambda Resource-based policy statements

Back in Agent Builder, click Save and then Prepare to update the agent.

Test the Full Booking Flow

Amazon Bedrock Agents Demo

Amazon Bedrock Agents Demo

Amazon Bedrock Agents Demo

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.

DynamoDB table for booking made by Amazon 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)

Collapse
 
iamaashishpatel profile image
Ashish Patel

Awesome! Thanks a lot for the detailed article!

Collapse
 
mohsinsheikhani profile image
Mohsin Sheikhani

Thanks so much! Glad you found it helpful