Built this for a makeathon. Basically, it's a hotel search engine that lets you just type what you want in plain English (e.g., "I need a quiet, cheap hotel near the beach") instead of clicking through a dozen UI filters.
The backend uses a hybrid approach:
- LLM Extraction: We pass the query to an LLM (Azure OpenAI) to extract "hard" constraints (max price, required amenities) into JSON.
- Filtering: We strictly filter the dataset based on those numbers.
- Semantic Ranking: We take whatever hotels survive the filter and use a local
SentenceTransformerto rank them by semantic similarity (matching the "vibes" like "romantic" or "quiet").
You'll need two terminals running: one for the Flask API and one for the React frontend.
Navigate to the code/ directory. You'll probably want to set up a virtual environment. Install the dependencies (Flask, pandas, sentence-transformers, openai, etc.).
Create a .env file in the code/ folder with your Azure keys:
AZURE_OPENAI_ENDPOINT="your_endpoint_here"
AZURE_OPENAI_API_KEY="your_api_key_here"
Important: Before you start the server, you have to pre-compute the embeddings. If you try to embed the whole parquet file on the fly, the API will time out. Ensure your .parquet dataset is in the right folder (data/hotels/) and run:
python build_vector_cache.py{Sample ones are there from the Hackathon}
Once that finishes creating the .pkl cache file, start the Flask server:
python server.py(Runs on localhost:5000)
Open a second terminal and navigate to the frontend/ directory.
npm install
npm run dev(Runs on localhost:5173)
- Caching: We cache LLM responses in
llm_cache.jsonlocally so we don't burn through API credits while reloading the page, along with a few other cache and text files for testing.