RAG ChatBot (Groq + LangChain)
Outline / Brief Description:
This project is a Retrieval-Augmented Generation (RAG)-based chatbot that enables interactive Q&A on uploaded PDF documents. It uses Streamlit for a stylish UI and LangChain for document chunking, vectorization with HuggingFace embeddings, and leveraging Groq’s ultra-fast LLaMA model for accurate responses. It’s deployed on Streamlit Cloud and is designed to make document analysis faster and more accessible.
- This project is a RAG-powered chatbot allowing queries on uploaded PDFs.
- It solves the problem of manually searching long documents, boosting efficiency.
- The goal is to streamline Q&A for students, professionals, and researchers.
- Python 3.11
- Streamlit — for building the web interface
- LangChain — for RAG pipeline and vectorstore management
- HuggingFace Embeddings — for embedding the document contents
- Groq API (LLaMA 3) — for super-fast LLM inference
- PyPDFLoader — for reading and splitting PDFs
- RecursiveCharacterTextSplitter — for efficient chunking of text content
- Git & GitHub — version control and source code hosting
- Streamlit Cloud — one-click deployment & hosting
- .env files — for safe environment variable handling
- 📂 PDF Upload Support — Easily upload one or multiple PDFs.
- 🧠 Context-Aware Answers — Answers derived directly from uploaded content.
- 📝 Conversation History — Keep track of queries and responses.
- ⚡ Groq LLaMA-powered Inference — Fast responses powered by Groq API.
- 🎨 Stylish UI — Modern glassmorphism interface for a polished look.
- 🔄 Reset Option — Quickly reset chat and upload new files.
- 🆕 Source References — See excerpts of source text alongside answers.
Check requirements.txt for dependencies:
streamlit
langchain
langchain-groq
langchain-huggingface
pypdf
sentence-transformers
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/RAG_ChatBot_Groq.git cd RAG_ChatBot_Groq - (Optional) Create & activate a virtual environment:
python -m venv venv venv\Scripts\activate # Windows source venv/bin/activate # Linux/MacOS - Install dependencies:
pip install -r requirements.txt - Create a
.envfile for your Groq API key:GROQ_API_KEY=your-groq-api-key-here - Run the app:
streamlit run Chatbot.py
Once up and running, you can:
- 📂 Upload a PDF file — via the upload section.
- 🤖 Ask questions — and receive instant, accurate answers.
- 🔄 Restart session — to clear data and upload new files.
✅ Completed and deployed on Streamlit Cloud — try the live app here 🎯
- Multi-File Support — Query across multiple PDFs.
- Conversation Persistence — Save sessions for future use.
- Advanced Features — Voice-based querying and highlighted source excerpts.
- Multi-File Chat Support
- Voice Input & Output
- Contextual Highlighting of Source Text
- This project was inspired by the need for smarter document Q&A tools.
- Based on tutorials and official docs from LangChain, Groq, HuggingFace, and Streamlit.
- Special thanks to the open-source community that made these tools accessible.