A lightweight, production-ready FAQ chatbot built with Flask, FAISS, and Sentence Transformers, packaged in Docker with a modern web UI.
- 🔍 Semantic search over FAQs using
sentence-transformers+ FAISS - 🎨 Modern chat UI with stickers, typing indicator, and timestamps
- 🖥 Flask backend with REST API (
/chat,/health) - 🐳 Dockerized for easy deployment (Gunicorn included)
- 📊 Logging for conversations and errors
- 📱 Responsive design for desktop & mobile
- 🛡️ Input sanitization (prevents HTML/JS injection)
- Backend: Flask, Gunicorn
- ML/NLP: SentenceTransformers (
all-MiniLM-L6-v2), FAISS - Frontend: HTML, CSS (Glassmorphism style), jQuery
- Containerization: Docker, multi-stage builds
- Data: CSV-based FAQ storage
.
├── app.py # Flask app entrypoint
├── utils/
│ └── chatbot_utils.py # Embeddings + FAISS + response logic
├── templates/
│ └── index.html # Frontend UI
├── static/
│ ├── style.css # Chat UI styles
│ ├── chatbot_avatar.webp
│ ├── sticker.webp
│ └── background.jpg
├── data/
│ └── faq_data.csv # FAQ dataset
├── requirements.txt
├── Dockerfile
├── .gitignore
└── README.md # ← (this file)
git clone https://github.com/yourusername/customer-service-chatbot.git
cd customer-service-chatbotCreate a virtual environment and install requirements:
python -m venv venv
source venv/bin/activate # (Linux/Mac)
venv\Scripts\activate # (Windows)
pip install -r requirements.txtpython app.pyOpen http://localhost:5000 in your browser.
docker build -t chatbot .docker run -p 5000:5000 chatbotNow visit http://localhost:5000.
Send a message to the chatbot:
{
"message": "How can I reset my password?"
}Response:
{
"response": "You can reset your password by clicking on 'Forgot Password' on the login page."
}Health check (includes FAISS index info):
{
"status": "ok",
"faq_loaded": true,
"faiss_index_size": 42
}All FAQs are stored in data/faq_data.csv.
It must have two columns:
question,answer
"What are your business hours?","We are open from 9 AM to 5 PM, Monday to Friday."
"How can I reset my password?","Click 'Forgot Password' on the login page."
To update the bot, just edit the CSV and restart the server.
- Conversation memory
- Admin panel for FAQ management
- Analytics dashboard (track top queries)
- Multilingual support
- Optional fallback to GPT models
Made with ❤️ by Sagarika. GitHub: Sagarika311