Skip to content

This project is a Local Retrieval-Augmented Generation (RAG) system that answers questions about a restaurant based on realistic customer reviews.

Notifications You must be signed in to change notification settings

AshutoshRajGupta/Pizza-restaurant-analysis-rag-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ• Local RAG β€” Restaurant Review Analyzer

Retrieve & Analyze Restaurant Reviews Using Ollama Model + LangChain + ChromaDB

This project is a Local Retrieval-Augmented Generation (RAG) system that answers questions about a restaurant based on realistic customer reviews.

It runs completely offline, powered by:

  • 🧠 Ollama LLMs
  • πŸ”— LangChain
  • πŸ—‚ ChromaDB
  • πŸ“Š CSV-based dataset

Ask any question like:

"What do customers think about the pizza crust?" "What are the top complaints?" "Which pizzas are most praised?"

The model answers using actual retrieved reviews.


πŸ“ Project Structure

local-rag/
│── main.py                      # RAG pipeline & chatbot loop  
│── vector.py                    # Vector DB creation + retriever  
│── realistic_restaurant_reviews.csv   # Dataset  
│── requirements.txt             # Dependencies  
│── chrome_langchain_db/         # Auto-created vector DB  
│── venv/                        # Virtual environment  

πŸ–ΌοΈ Screenshots

πŸ“Œ 1. Dataset Preview (CSV File)

image

πŸ“Œ 2. Project Folder Structure (VS Code)

image

πŸ“Œ 3. CLI RAG Chatbot Running

image image

πŸ“Œ 4. Streamlit RAG Chatbot Running

image image

πŸš€ Features

πŸ”Ή Local RAG Pipeline

Runs without cloud APIs using Ollama.

πŸ”Ή Smart Retrieval

Top 5 relevant reviews fetched using vector similarity.

πŸ”Ή Persistent Vector DB

Chroma saves embeddings & reloads instantly.

πŸ”Ή Uses Real Reviews

Answers directly grounded in CSV data.

πŸ”Ή Lightweight & Fast

Perfect for learning + portfolio projects.


🧠 How the RAG System Works

  1. Load CSV (Pandas)
  2. Convert rows β†’ LangChain Documents
  3. Generate embeddings using mxbai-embed-large
  4. Store vectors in ChromaDB
  5. User asks a question
  6. Retriever gets top 5 relevant reviews
  7. Llama 3.2 generates the final answer

πŸ› οΈ Installation

1️⃣ Install Ollama

https://ollama.com/download

Models required:

ollama pull llama3.2
ollama pull mxbai-embed-large

2️⃣ Setup Environment

uv venv
source venv/bin/activate    # macOS/Linux
venv\Scripts\activate       # Windows

3️⃣ Install Python Packages

pip install -r requirements.txt

▢️ Run the Project

python main.py

You will see:

====================================
Ask your question (q to quit):
====================================

πŸ’¬ Example Questions

  • What do customers think about the service?
  • Summarize the positive reviews.
  • What complaints are mentioned most?
  • Give feedback about thin crust pizza.
  • Are there gluten-free options mentioned?

🧰 Tech Stack

Component Purpose
🐍 Python Application logic
🧠 Ollama Local LLM + embeddings
πŸ”— LangChain RAG chain
πŸ—‚ ChromaDB Vector storage
πŸ“Š Pandas CSV processing

πŸ“„ Dataset

Columns included:

  • Title
  • Date
  • Rating
  • Review

Used for retrieval + summarization.


⭐ Future Enhancements

  • Streamlit UI version
  • Sentiment Analysis
  • Multi-query reasoning (Agentic RAG)
  • Summary Dashboard

❀️ If this helped, give it a ⭐ on GitHub!


About

This project is a Local Retrieval-Augmented Generation (RAG) system that answers questions about a restaurant based on realistic customer reviews.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages