This project is a Retrieval-Augmented Generation (RAG) Chatbot built using LangChain, Google Gemini API, and FAISS Vector Database.
The chatbot answers user queries only based on provided data, ensuring accurate and context-based responses instead of general AI knowledge.
- 🔍 RAG Architecture (Retrieval + Generation)
- 🧠 Uses Google Gemini API for intelligent responses
- 📚 FAISS Vector Database for fast similarity search
- 📄 Reads data from external file (
docs.txt) - 💬 Interactive Streamlit Chat UI
- 🔌 Flask API for backend communication
- ❌ Prevents hallucination (answers only from data)
Amazon_Chat_Bot/
│
├── rag_core.py # RAG logic (retrieval + generation)
├── api.py # Flask backend API
├── app.py # Streamlit frontend UI
├── data/
│ └── docs.txt # Knowledge base
├── requirements.txt
└── README.md
git clone <your-repo-url>
cd Amazon_Chat_Botpip install -r requirements.txtGet your Gemini API key from Google AI Studio and set it in your code:
os.environ["GOOGLE_API_KEY"] = "YOUR_API_KEY"python api.pypython -m streamlit run app.pyhttp://localhost:8501
The chatbot reads data from:
data/docs.txt
Example content:
- Amazon return policy
- Order tracking steps
- Account login instructions
- Prime membership details
- Customer support info
- User enters a query
- Query is converted into embeddings
- FAISS retrieves relevant documents
- Gemini API generates answer using context
- Response is returned to UI
- Python 🐍
- LangChain
- Google Gemini API
- FAISS
- Streamlit
- Flask
- Customer Support Chatbot
- FAQ Automation
- E-commerce Assistant
- Knowledge Base Search
- Depends on quality of input data
- Requires API key
- Limited by small dataset (can be expanded)
- 📄 PDF Upload Support
- 🎤 Voice Assistant
- 🌐 Deployment (Render / AWS)
- 🎨 Advanced UI (ChatGPT-style)
- 🔐 User Authentication
Kalavanthula Sekhar Sanskriti University
This project is for educational purposes.