It is a local Retrieval-Augmented Generation (RAG) chatbot built with LangChain, FAISS, and Streamlit. It uses an eCommerce FAQ dataset to answer user queries by retrieving semantically similar Q&A pairs and generating human-like responses using a locally hosted Qwen2 LLM via Ollama. Embeddings are created using the hkunlp/instructor-large model from HuggingFace. The app includes a built-in UI for interacting with the chatbot and regenerating the knowledge base on demand.
chatbot-q-and-a is an intelligent chatbot application built to answer common questions from an eCommerce FAQ dataset. It utilizes powerful LLMs and vector-based semantic search to deliver accurate and summarized responses. If the bot doesn't know the answer, it politely says so — no hallucinations here!
This app supports regenerating embeddings through a button on the UI, offering flexibility to refresh or update the knowledge base with ease.
- ⚡ Embedding-based question retrieval with FAISS
- 📚 Dataset: ecommerce_FAQ_chatbot_dataset on Kaggle
- 🔍 Uses
hkunlp/instructor-largefrom HuggingFace - 🧠 Summarizes multiple similar answers using an LLM
- 💬 Natural UI using Streamlit
- 🛠️ Local inference using Ollama + Qwen2 LLM
- 🔁 One-click embedding regeneration from UI
- ❌ Gracefully handles out-of-scope questions by responding with "I don't know."
| Tool / Package | Purpose |
|---|---|
streamlit |
Frontend web UI |
langchain |
LLM & prompt orchestration |
langchain-community |
Integrations with external tools |
faiss-cpu |
Fast similarity search on CPU |
tiktoken |
Tokenization support |
protobuf |
Serialization (LangChain & Ollama) |
sentence-transformers |
Transformer embedding utilities |
InstructorEmbedding |
HuggingFace embedding wrapper |
jq |
JSON parsing (if used in post-processing) |
We are using the ecommerce_FAQ_chatbot_dataset, which includes real-world Q&A pairs commonly asked by customers.
-
Embedding Creation
- The Q&A pairs are embedded using the
hkunlp/instructor-largemodel from HuggingFace. - These embeddings are stored using FAISS for efficient similarity search.
- The Q&A pairs are embedded using the
-
User Question Flow
- User asks a question via the Streamlit interface.
- The question is converted to an embedding using the same model.
- FAISS retrieves the closest match(es) from the dataset.
- The matched answer(s) are fed to the LLM (Qwen2 via Ollama).
- If multiple matches are returned, the LLM summarizes them.
- If no good match is found, the LLM responds: "I don't know."
-
Knowledge Base Regeneration
- A dedicated UI button allows regenerating embeddings from scratch.
Make sure you have Ollama installed.
Then pull the qwen2 model locally:
ollama pull qwen2git clone https://github.com/js-kalsi/restaurent-genai.git
cd restaurent-genaiWe recommend using a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activateThen install dependencies:
pip install -r requirements.txtLaunch the Streamlit app:
streamlit run app.pyThe app will open in your default web browser. Select a cuisine, and let the AI generate a restaurant concept for you!
