An advanced RAG (Retrieval-Augmented Generation) based Bengali FAQ chatbot that uses GitHub-hosted OpenAI models and FAISS vector database. Bangla FAQ Chatbot is an advanced AI-powered web application designed to answer user queries in Bengali. It is dynamic animated frontend, and context-aware responses using vector-based retrieval for accurate and natural answers.
- Bengali Language Support: Complete question-answer system in Bengali
- RAG System: Accurate information retrieval through FAISS vector database
- Topic Filtering: 5 categories - Education, Health, Travel, Technology, Sports
- Difficulty Levels: Separate filters for easy and difficult questions
- Modern UI: Beautiful and user-friendly interface built with Tailwind CSS
- Bengali Embeddings: Uses
l3cube-pune/bengali-sentence-similarity-sbertmodel
- Python 3.8+
pip(Python package manager)
# 1. Clone the repository git clone https://github.com/Aronno1920/FAQ-Chatbot.git cd BanglaChatbot # 2. Create a virtual environment python -m venv venv # 3. Activate the environment # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate # 4. Install dependencies pip install -r [requirements.txt] # 5. Configure API keys cp [config.example.py] [config.py] # Edit [config.py](http://_vscodecontentref_/4) and replace GITHUB_TOKEN with your personal token # 6. Start the Flask app python [app.py]
To test if all system components are working correctly:
python test_models.py
This script will test:
- GitHub Model API connection
- HuggingFace embedding model
- FAISS vector database
- RAG system integration
BanglaChatbot/
βββ app.py # Main Flask application
βββ rag_core.py # RAG system and FAQ data
βββ utils.py # Utility functions
βββ test_models.py # Testing script
βββ requirements.txt # Python dependencies
βββ templates/
β βββ index.html # Frontend UI
βββ README.md # This file
- Go to GitHub and create a Personal Access Token
- Update the token in
app.py - The following model is used:
openai/gpt-4.1-nano
Add new question-answer pairs in the FAQ_DATA list in rag_core.py:
FAQ_DATA = [ { 'topic': 'ΰ¦Άΰ¦Ώΰ¦ΰ§ΰ¦·ΰ¦Ύ', 'difficulty': 'ΰ¦Έΰ¦Ήΰ¦', 'question': 'Your question', 'answer': 'Answer' }, # More questions... ]
- Select Topic: Choose desired subject from the top menu
- Set Difficulty: Filter for easy or difficult questions
- Ask Questions: Type your question in Bengali in the text box below
- Get Answers: Receive relevant answers from the RAG system
- Backend: Flask (Python)
- AI/ML:
- GitHub-hosted OpenAI GPT-4.1-nano
- HuggingFace Transformers
- FAISS (Facebook AI Similarity Search)
- LangChain
- Frontend: HTML5, Tailwind CSS, JavaScript
- Vector Database: FAISS
- Embeddings: Bengali Sentence-BERT
- Data Preparation: Create documents from FAQ data
- Embedding: Generate vectors using Bengali Sentence-BERT
- Indexing: Create vector database with FAISS
- Retrieval: Find documents matching user queries
- Generation: Generate relevant answers using OpenAI model
GET /- Main chat interfacePOST /chat- Process chat messagesPOST /filter- Update topic/difficulty filter
- GitHub API Error: Check if token is correct
- Model Loading Error: Check internet connection
- FAISS Error: Reinstall with
pip install faiss-cpu
You can see detailed logs in the console while running the application.
- Fork this repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Create an issue for questions or suggestions.
Bangla FAQ Chatbot - Smart Q&A service in Bengali using AI π€