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.
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
Runs without cloud APIs using Ollama.
Top 5 relevant reviews fetched using vector similarity.
Chroma saves embeddings & reloads instantly.
Answers directly grounded in CSV data.
Perfect for learning + portfolio projects.
- Load CSV (Pandas)
- Convert rows β LangChain Documents
- Generate embeddings using mxbai-embed-large
- Store vectors in ChromaDB
- User asks a question
- Retriever gets top 5 relevant reviews
- Llama 3.2 generates the final answer
Models required:
ollama pull llama3.2
ollama pull mxbai-embed-largeuv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windowspip install -r requirements.txtpython main.pyYou will see:
====================================
Ask your question (q to quit):
====================================
- 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?
| Component | Purpose |
|---|---|
| π Python | Application logic |
| π§ Ollama | Local LLM + embeddings |
| π LangChain | RAG chain |
| π ChromaDB | Vector storage |
| π Pandas | CSV processing |
Columns included:
- Title
- Date
- Rating
- Review
Used for retrieval + summarization.
- Streamlit UI version
- Sentiment Analysis
- Multi-query reasoning (Agentic RAG)
- Summary Dashboard