AI/ML, AWS, Cloud Computing, Data Analytics

3 Mins Read

Building Real-Time Travel Recommendation Systems with Amazon Bedrock and OpenSearch

Voiced by Amazon Polly

Introduction

Planning travel isn’t just about destinations, it’s about personalization. Whether you’re recommending a romantic getaway or a family-friendly adventure, modern users expect their travel suggestions to match their unique preferences in real time.

This blog will show you how to build a real-time travel recommendation system using Amazon Bedrock, Amazon Bedrock Agents, Knowledge Bases, and Amazon OpenSearch Serverless. This setup allows you to combine static user preferences with live travel data (like flight prices) and personalized content generation using LLMs in a serverless, scalable AWS architecture.

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

Implementation Overview

AWS offers a powerful architecture that blends retrieval-augmented generation (RAG) with real-time orchestration. Here’s how it works:

  1. User Input: The user provides preferences (budget, date, destination type).
  2. Amazon DynamoDB Lookup: Their profile and history are fetched.
  3. Amazon OpenSearch Query via Knowledge Base: Travel package data is searched semantically.
  4. Live Flight Data Fetch: Amazon Bedrock Agent triggers AWS Lambda for real-time pricing.
  5. LLM Response Generation: Amazon Bedrock uses the combined data to generate a personalized holiday recommendation.

Why Real-Time Recommendations Matter?

Traditional travel recommendation engines often rely on preloaded static content. While helpful, this approach quickly falls short because:

  • Flight and hotel prices fluctuate every hour.
  • Travel interests evolve during conversations (users may change budget, dates, or type of trip).
  • Static search engines match keywords but often miss the context (e.g., “beach vacation” could return generic results without knowing whether the traveler wants luxury or budget-friendly stays).

By combining Retrieval-Augmented Generation (RAG) with real-time orchestration using Amazon Bedrock, businesses can solve these challenges:

  • Personalized journeys: Recommendations are unique for every user.
  • Contextual grounding: LLMs leverage curated travel data from your sources, not just generic information.
  • Live updates: Flight pricing and availability are fetched dynamically.
  • Scalable architecture: Serverless services scale traffic, making it cost-efficient.

Key Points

  • Session-based chat: Each time a user clicks the chat icon, a unique session_id is generated and tracked in DynamoDB.
  • Personalization: Preferences are fetched from Amazon DynamoDB to tailor the response.
  • Retrieval-Augmented Generation (RAG): Amazon Bedrock Knowledge Base uses OpenSearch Serverless to ground LLM responses in curated travel data.
  • Action group with AWS Lambda: Fetches real-time (mock) flight pricing based on the user query.
  • RESTful APIs: Fully integrated with Amazon API Gateway for frontend access.
  • Scalable & Serverless: No Amazon EC2 or containers; everything runs on AWS Lambda, Amazon API Gateway, Amazon Bedrock, Amazon DynamoDB, and Amazon OpenSearch.

Step-by-Step Guide

Step 1: Store Travel Data in Amazon S3

  • Upload your curated travel packages (.json, .csv, etc.) into an Amazon S3 bucket.
  • Include data like location, duration, theme, amenities, price, and accessibility features.

Step 2: Create an Amazon Bedrock Knowledge Base with OpenSearch

  • When creating your Knowledge Base, choose Amazon OpenSearch Serverless as the vector store.
  • Amazon Bedrock will:
    • Ingest data from Amazon S3.
    • Use an embedding model to convert it into vectors.
    • Store them in Amazon OpenSearch for similarity search.

Step 3: Set up Amazon DynamoDB for User Profiles

  • Table: UserPreferences
  • Sample record:

Step 4: Create an AWS Lambda for Real-Time Flight Pricing

  • Lambda: FlightPriceFetcher
  • Input: destination, dates
  • Output: Real-time price and availability (can be a mocked API)

Step 5: Define Amazon Bedrock Agent and Actions

  • Create an Amazon Bedrock Agent.
  • Add an Action Group to invoke the FlightPriceFetcher Lambda.
  • Define the schema for input/output so the agent can pass the correct parameters.

Step 6: Write Orchestrator Lambda

This AWS Lambda does:

  • Fetch user preferences from Amazon DynamoDB
  • Generate a prompt combining:
    • Static preferences
    • Retrieved documents from the Knowledge Base
    • Output from the flight API
  • Send a prompt to the Amazon Bedrock model and return the response.

Step 7: Expose via Amazon API Gateway

  • Create a REST endpoint /recommend
  • Connect it to the orchestrator AWS Lambda
  • Accept POST request with travel inputs (date, number of travelers, etc.)

bedrock

Technologies Used

table

Conclusion

This solution illustrates how developers can build scalable, real-time travel recommendation systems using Amazon Bedrock and Amazon OpenSearch Serverless. The modular architecture allows easy extension into hotel bookings, restaurant suggestions, or even weather-based planning.

Using Retrieval-Augmented Generation ensures accurate and relevant responses, while AI Agents enable live integrations without hardcoding logic.

Whether you’re building a chatbot for a travel agency or a backend engine for a travel booking portal, this architecture will scale with your needs.

Drop a query if you have any questions regarding Amazon Bedrock and we will get back to you quickly.

Empowering organizations to become ‘data driven’ enterprises with our Cloud experts.

  • Reduced infrastructure costs
  • Timely data-driven decisions
Get Started

About CloudThat

CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.

FAQs

1. What is Amazon OpenSearch Serverless used for?

ANS: – It stores vector embeddings of your travel content. This allows semantic search, where user preferences are matched with the most relevant packages, even if keywords don’t exactly align.

2. Why use Amazon Bedrock Knowledge Base?

ANS: – It enables Retrieval-Augmented Generation (RAG), improving LLM responses by grounding them in your actual documents stored in Amazon S3 and indexed in Amazon OpenSearch.

3. Can I use real flight APIs?

ANS: – Yes. You can replace the mocked AWS Lambda with calls to live flight search APIs (like Skyscanner, Amadeus, etc.) through Amazon Bedrock Agent actions.

WRITTEN BY Shantanu Singh

Shantanu Singh is a Research Associate at CloudThat with expertise in Data Analytics and Generative AI applications. Driven by a passion for technology, he has chosen data science as his career path and is committed to continuous learning. Shantanu enjoys exploring emerging technologies to enhance both his technical knowledge and interpersonal skills. His dedication to work, eagerness to embrace new advancements, and love for innovation make him a valuable asset to any team.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!