Conversational AI Chatbot powered by FAISS for retrieval-based responses and Hugging Face embeddings. This chatbot provides human-like responses using a customer service policy knowledge base.
Retrieval-Augmented Generation (RAG)** with FAISS.
Hugging Face embeddings for similarity search.
Conversational responses** (not just raw text dumps).
Handles queries on orders, refunds, shipping, and more.**
Multi-turn conversation support.
git clone https://github.com/yourusername/AI-Chatbot.git
cd AI-Chatbotpython -m venv chatbot_env
source chatbot_env/bin/activate # On Windows: chatbot_env\Scripts\activatepip install -r requirements.txtCreate a .env file and add:
HUGGINGFACE_TOKEN=your_huggingface_api_key
Or set it as an environment variable:
export HUGGINGFACE_TOKEN=your_huggingface_api_key # On Windows: set HUGGINGFACE_TOKEN=your_huggingface_api_key📦 AI-Chatbot
┣ 📂 Company_policy.txt # Stores the company policy text
┣ 📂 faiss_index # FAISS storage
┣ 📜 config.py # Configuration settings
┣ 📜 policy_loader.py # Loads & processes company policies into FAISS
┣ 📜 rag_pipeline.py # Main RAG model handling FAISS queries
┣ 📜 main.py # Runs the chatbot in interactive mode
┣ 📜 requirements.txt # Dependencies
┣ 📜 README.md # Project Documentation
Before using the chatbot, process & store the company policies into FAISS:
python policy_loader.pypython main.pyYou'll see:
✅ FAISS Index loaded successfully!
✅ Chatbot is ready! Type 'exit' to quit.
You: When will my order arrive?
Chatbot: Your order should arrive in 5-7 business days for standard shipping. Would you like me to check your tracking details?
| Problem | Solution |
|---|---|
FAISS index not found |
Run policy_loader.py to generate the FAISS index. |
Hugging Face API key missing |
Set HUGGINGFACE_TOKEN in .env or as an environment variable. |
Chatbot gives generic responses |
Check policy_loader.py to confirm policies were indexed correctly. |
Improve Conversational Flow by integrating GPT-4 for better responses.
Add a Web UI using FastAPI & React for real-time interactions.
Log User Queries to improve responses over time.