Inspiration: As a student at Berkeley majoring in computer science and Math, I've always been fascinated by the intersection of data science and artificial intelligence. During my studies, I often found myself exploring various AI applications and their potential to revolutionize different industries. This curiosity led me to embark on a project combining my passion for technology and real-world problem-solving. I am driven by the desire to contribute to cutting-edge research in this field and explore novel approaches to enhancing natural language understanding and generation
What it does: Our project is a conversational AI system called "Hotel RAGbot" dedicated to assisting users with hotel bookings. Utilizing advanced natural language processing techniques, Ragbot comprehends user queries and provides tailored responses focused on hotel-related information. Integrating with databases and external APIs retrieves relevant data on hotels, delivering personalized and informative assistance to users. Hotel RAGbot is designed to streamline the hotel booking process and enhance the overall user experience in hotel accommodations.
How we built it: Below are the steps taken for building the Hotel RAGbot
Synthetic Data Generation: The code generates synthetic hotel data, encompassing hotel names, brands, addresses, amenities, and descriptions. Database Setup: We created a PostgreSQL database with the pgvector extension to store hotel information and vector embeddings. Data Processing: We mapped abbreviations of amenities to their full names and formatted the data for insertion into the database. Embedding Generation: Utilizing the Google Vertex AI embeddings model, we generated vector embeddings for the hotel data and stored them in the pgvector extension. Conversational AI Setup: We established a conversational AI system using the Langchain and Vertex AI llm (Gemini-Pro). Conversational Retrieval Chain: We constructed a conversation chain to retrieve the most relevant vector documents based on user queries and embeddings associated with each document from the pgvector database of vector embeddings, including processing follow-up questions and managing conversation history and context. App Engine: To deploy the Hotel RAGbot, we developed a Flask web application with a single POST endpoint where users can send a JSON object with a question field to receive a response from the Hotel RAGbot.
Challenges we ran into :
Cloudsql PostgreSQL database setup was faulty due to a network issue with public IP. Langchain retreival chain set up needed to deep think on which modules to import for postgre pgvector. Langchain updated their requirements for Pydantic midway through our project implementation, therefore our code was having trouble running until we imported the correct version of Pydantic.
Accomplishments that we're proud of:
Utilization of only Google Cloud Services: We are proud to have leveraged a comprehensive suite of Google Cloud services to develop and deploy our solution. By utilizing services such as the embeddings model, gemini-pro llm, VertexAI notebook, GCP project infrastructure, Cloud SQL with pgvector extension, and App Engine, we ensured robust security and integrity throughout our application architecture. This strategic utilization of Google Cloud services not only provided us with powerful tools for development but also ensured seamless scalability, reliability, and performance for our solution Scalability and Flexibility: One of our major achievements is the scalability of our solution. We have designed the Conversational Retrieval Chain to be easily scalable, allowing for the addition of various document types such as restaurants, FAQs, flights, and more. This flexibility enables us to expand the application scope and provide users with comprehensive assistance across diverse domains, making our solution highly adaptable to evolving user needs. Reduced Cost, Faster Responses: Our embedding retrieval system significantly lowers query costs compared to traditional LLM calls. This is achieved by pre-computing and storing document representations (embeddings) for efficient retrieval. This translates to faster response times and a more cost-effective hotel booking experience for users.
What we learned:
Resource Optimization: Throughout the project, we delved into resource optimization techniques to make our system efficient while keeping costs in check. This involved learning about pre-computing embeddings, which significantly reduced query costs compared to traditional language model (LLM) calls. Integration Challenges: Integrating various components like database setup, embedding generation, and conversational AI posed some challenges. However, tackling these hurdles taught us valuable lessons in system integration and troubleshooting, essential skills for any aspiring developer. User Experience Design: Developing the Hotel RAGbot taught us the importance of user-centric design. We learned to prioritize user experience by creating an intuitive interface and ensuring that the bot delivers relevant and helpful responses to users' queries. Cost-Performance Tradeoffs: Balancing performance with cost efficiency was a key aspect of our project. We learned to weigh the tradeoffs between computational resources and user experience, striving to optimize both within the constraints of the hackathon timeframe.
What's next for Hotel RAGbot :
Expansion to Multiple Document Types: We aim to broaden the capabilities of Hotel RAGbot by incorporating various document types, including flights, restaurants, and hotels. This expansion will allow users to access comprehensive travel information and services through a single platform. Cross-Sell Feature and Personalized Recommendations: We plan to introduce a cross-sell feature that offers users personalized travel packages based on their preferences and past interactions. By leveraging user vectors and personalization techniques, we aim to enhance the overall travel experience and provide tailored recommendations to each user. Optimization Techniques Evaluation: As part of our ongoing efforts to improve performance and efficiency, we will evaluate further optimization techniques. This includes exploring methods to enhance query processing speed, reduce resource usage, and optimize cost-performance tradeoffs. By continuously refining our system, we aim to provide users with seamless and responsive service while maintaining cost-effectiveness. Integrate an observability mechanism: for deeper insights into the application's performance. With traces or spans, we can track various metrics such as application latency, token usage, runtime exceptions, retrieved documents, embeddings, LLM parameters, prompt templates, and LLM function calls, providing comprehensive visibility into the inner workings of hotel RAGbot.
Log in or sign up for Devpost to join the conversation.