A local Retrieval-Augmented Generation (RAG) application that uses cafe customer reviews to answer questions about restaurants and customer experiences.
The application combines LangChain, ChromaDB, Ollama embeddings, and Llama 3.2 to retrieve relevant customer reviews and generate responses based on the retrieved context.
This project explores the fundamentals of building a local Retrieval-Augmented Generation (RAG) system using a cafe review dataset containing restaurant information and customer review text.
The application uses 775 review entries from cafes across multiple cities in India. Users can ask questions about restaurants or customer experiences, and the system retrieves semantically relevant reviews before passing them to a locally hosted LLM for response generation.
The dataset describes its review entries as "genuine customer reviews." However, the available dataset documentation does not provide detailed information about the original data collection methodology or independent verification of the review provenance.
This repository serves as the baseline implementation for a local RAG application. More advanced retrieval, grounding, filtering, and response-generation techniques will be explored in a separate project.
Cafe Review Dataset
↓
Pandas DataFrame
↓
Document Creation
↓
Ollama Embeddings
(mxbai-embed-large)
↓
ChromaDB
↓
Semantic Retriever
(k = 5)
↓
Retrieved Context
↓
Prompt
↓
Llama 3.2
↓
Generated Answer
- Python
- Pandas
- LangChain
- ChromaDB
- Ollama
- Llama 3.2
- mxbai-embed-large
- Jupyter Notebook
- Git / GitHub
This project uses the CafeCritic: A Flavorful Dataset of Cafe Reviews dataset from Kaggle.
Source: CafeCritic: A Flavorful Dataset of Cafe Reviews
According to the dataset author:
"Uncover the essence of cafe experiences with CafeCritic, a comprehensive dataset that captures the aroma and ambiance of cafes through genuine customer reviews."
The dataset contains cafe information and customer reviews, including:
- Cafe name
- Overall rating
- Cuisine
- Average cost for two people
- City
- Customer-written review
| Column | Description |
|---|---|
Index |
Unique identifier for each review entry |
Name |
Name of the cafe being reviewed |
Overall_Rating |
Overall rating of the cafe |
Cuisine |
Types of cuisine offered by the cafe |
Rate for two |
Average cost for two people |
City |
City where the cafe is located |
Review |
Customer-written review describing their experience |
The dataset used in this project contains:
- 775 reviews
- 299 unique cafes
- 10 cities
The Index column was excluded from the document content and metadata because it does not provide useful semantic information for the retrieval task.
Each review is converted into a LangChain Document containing both review content and structured metadata.
The following information is included in the document content:
Restaurant
City
Rating
Cuisine
Rate for Two
Review
The following structured fields are stored as metadata:
restaurant
city
rating
cuisine
rate_for_two
This approach preserves both the natural-language review and relevant restaurant attributes, allowing the retrieved documents to provide richer context to the language model.
The application uses ChromaDB as its local vector database.
The mxbai-embed-large embedding model converts each review document into a vector representation. These vectors are stored locally in ChromaDB.
For each user question, the retriever returns the 5 most semantically relevant documents.
The retrieved documents are then passed to Llama 3.2 as context for response generation.
The vector database is generated locally and is not included in the repository.
The retrieval pipeline was tested independently before connecting it to the language model.
What do customers say about The Chocolate Room?
The retriever successfully returned relevant reviews for The Chocolate Room across multiple cities.
What do customers say about the food quality?
The retriever returned reviews from multiple cafes discussing food quality, taste, preparation, and related customer experiences.
These tests were used to verify that the semantic retrieval layer was returning relevant context before evaluating the generated LLM responses.
What do customers say about The Chocolate Room?
Based on the provided context, here's what customers say about The Chocolate Room:
- Some customers liked the ambiance and certain dishes.
- Some reviewers reported issues with shakes, cheesecake, and other food items.
- One reviewer reported problems with food packaging.
- Other customers described their experience positively.
Overall, the available reviews suggest mixed customer experiences.
local-rag-cafe-reviews/
│
├── .gitignore
├── main.py
├── vector.py
├── reviews.ipynb
└── README.md
Handles:
- Local LLM initialization
- Prompt construction
- User interaction
- Review retrieval
- LLM response generation
Handles:
- Dataset loading
- Document creation
- Embedding initialization
- ChromaDB initialization
- Document vectorization
- Retriever initialization
Used for dataset inspection and exploratory analysis before integrating the dataset into the RAG pipeline.
This repository represents the baseline version of the local RAG application.
Current limitations include:
- Retrieval is currently limited to the top 5 documents.
- Cafe branches across different cities are not explicitly separated during retrieval.
- The LLM may occasionally make minor interpretation or counting errors when synthesizing reviews.
- The application does not currently provide source citations for individual claims.
- There is no conversational memory between questions.
Further improvements to:
- Retrieval quality
- Restaurant and location filtering
- Context grounding
- Response accuracy
- Source attribution
- Conversational capabilities
will be explored in a separate project.
This repository will remain as the baseline implementation and reference point for future experimentation.
The dataset used for this project is included in the repository as:
reviews.csv
The expected structure is:
local-rag-cafe-reviews/
│
├── main.py
├── vector.py
├── reviews.ipynb
├── reviews.csv
├── .gitignore
└── README.md
git clone <repository-url>
cd local-rag-cafe-reviewspython -m venv .venvWindows:
.venv\Scripts\activatepip install -r requirements.txtThe application uses the following local models:
llama3.2mxbai-embed-large
Make sure both models are available through Ollama before running the application.
Run:
python .\vector.pyThis creates the local ChromaDB vector database from reviews.csv.
Run:
python .\main.pyThe terminal will display:
==================================================
🍽️ RESTAURANT REVIEW ASSISTANT
==================================================
Type a question... (press 'q' to quit):
Type q to exit the application.
This project is a learning and portfolio project focused on understanding the fundamentals of local Retrieval-Augmented Generation (RAG), including:
- Document processing
- Text embeddings
- Vector databases
- Semantic retrieval
- Prompt construction
- Context-based generation
- Local LLM inference
The project demonstrates an end-to-end RAG workflow while keeping the system lightweight and fully local.