How siddhant1721/-llm-powered-booking-analytics-qa-system- works
Main components
• Data Storage & Sources:
• CSV files (hotel_bookings.csv & hotel_bookings_sample.csv) that serve as the raw data source.
• ChromaDB (inside the chroma_db directory with its SQLite database) used for efficient vector retrieval.
• Data Processing & Analytics:
• Jupyter Notebook (Data_preprocessing_and_analysis.ipynb) for data cleaning, preprocessing, and exploratory analytics.
• Pre-computed analytics (like revenue trends, cancellation rates, etc.) that are later served through the Analytics API.
• API Services:
• Booking_analytics_api.py – a FastAPI service that exposes endpoints to fetch various analytical reports.
• Booking_query_api.py – another FastAPI service providing a natural language query interface for retrieving booking insights.
• Interactive User Interface:
• App.py – a Streamlit-based interactive application, powered by an LLM (with RAG architecture) to provide an interactive booking query chatbot.
Relationships and interactions
• The CSV files are ingested and processed (with the help of the Jupyter Notebook) to clean data and compute necessary analytics.
• The pre-processed data feeds both the booking analytics and query API endpoints.
• The Booking_analytics_api processes scheduled analytics computations and returns structured reports (such as revenue trends, cancellation rates, etc.).
• The Booking_query_api interprets natural language queries, possibly performs lookup operations (and even invokes retrieval using the ChromaDB vector search), and sends structured answers.
• The Streamlit application (App.py) acts as a front-end, allowing users to interact with the LLM-powered chatbot that internally might coordinate with the vector database and the API endpoints to produce responses.
• Communication between components follows a RESTful API interaction pattern with JSON payloads along with internal direct file and database access.
Architectural patterns and design principles
• Microservices-like design: Even though everything resides in one repo, Booking_analytics_api and Booking_query_api are independent FastAPI services, each handling distinct responsibilities.
• Hybrid retrieval (RAG) architecture in the Streamlit app is a key element; it integrates dense and sparse retrieval strategies utilizing the ChromaDB.
• Data transformation and analytics are run independently (via a Jupyter Notebook) then consumed as a service.
Relevant technologies and frameworks
• Python 3.10+ as the primary language.
• Streamlit for the interactive LLM-powered chat interface.
• FastAPI for both the Query and Analytics APIs.
• ChromaDB (SQLite based) for vector-based retrieval.
• Jupyter Notebook for data preprocessing and analysis.
• External dependencies managed via requirements.txt.
• Deployment tools such as uvicorn (ASGI server) for running FastAPI services.