A full-stack hotel recommendation system that leverages a React Native frontend with a voice agent and a Python backend. The backend processes user queries through a multi-step pipeline to return the most relevant hotel recommendations.
Finding the perfect hotel can be challenging when travelers have specific preferences, such as pet-friendliness, free parking, or proximity to city attractions. The challenge is to build an AI-based hotel recommendation system that takes a user's natural language prompt describing their preferences and returns a sorted list of the most relevant hotels.
Our solution consists of:
-
Frontend:
A React Native application with a voice agent that allows users to speak their hotel preferences. The app sends the transcribed prompt to the backend and displays the recommended hotels. -
Backend:
A Python API (FastAPI/Uvicorn) that processes hotel data and user prompts through a multi-step pipeline:- Query Improvement: Optionally refines the user query.
- Validation: Checks if the request is valid and relevant.
- Unrestricted Request Handling: If the request is broad, returns the top 10 pre-ranked hotels.
- Relevant Feature Extraction: Identifies which hotel features are relevant to the query.
- Constraint Creation: Builds search constraints based on the query.
- Scoring: Calculates a relevance score for each hotel.
- Ranking: Returns the top 10 hotels ranked by score.
The backend pipeline is visualized below:
- React (for frontend)
- npm (comes with React)
- Python 3.12 (for backend)
- pip (for Python dependencies)
git clone https://github.com/your-username/your-repo.git
cd your-repocd backend
python3.12 -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate
pip install -r requirements.txt
pre-commit installuvicorn app:app --reloadOpen a new terminal window/tab, then:
cd frontend
npm installnpm run dev