A production-ready Retrieval-Augmented Generation (RAG) chatbot that allows users to upload multiple PDFs and ask questions based on their content.
Built using LangChain, Groq LLM, HuggingFace embeddings, and Streamlit, this app provides fast, accurate, and context-aware answers with source attribution.
🔗 https://shivamgravity-rag-chatbot.streamlit.app/
- 📂 Multi-PDF Upload — Query multiple documents at once
- 🧠 RAG Pipeline — Context-aware answers using retrieved document chunks
- ⚡ Fast LLM Inference — Powered by Groq (LLaMA 3)
- 🔍 Source Attribution — See which documents were used for answers
- 💬 Conversational Memory — Supports follow-up questions
- 🎨 ChatGPT-style UI — Clean and interactive interface
- ☁️ Deployed on Streamlit Cloud
- Frontend: Streamlit
- LLM: Groq (LLaMA 3)
- Framework: LangChain (modular)
- Embeddings: HuggingFace (sentence-transformers)
- Vector Database: ChromaDB
- Document Loader: PyPDF
User Query
↓
Retriever (ChromaDB)
↓
Relevant Chunks
↓
Prompt + Context
↓
Groq LLM
↓
Answer + Sources
git clone https://github.com/shivamgravity/langchain-rag-chatbot.git
cd rag-chatbotpython -m venv venv
venv\Scripts\activate # Windows
# or
source venv/bin/activate # Mac/Linuxpip install -r requirements.txtCreate a .env file:
GROQ_API_KEY=your_api_key_here
streamlit run app.pyThe app is deployed using Streamlit Community Cloud.
To deploy:
- Push code to GitHub
- Connect repo to Streamlit Cloud
- Add
GROQ_API_KEYin Secrets - Deploy 🚀
rag-chatbot/
│
├── app.py # Streamlit UI
├── rag_pipeline.py # RAG logic
├── requirements.txt # Dependencies
├── .env # API keys (not committed)
└── temp_docs/ # Uploaded PDFs (ignored)
- Implemented Retrieval-Augmented Generation (RAG) from scratch
- Worked with LangChain’s modular architecture
- Integrated Groq LLM for fast inference
- Built multi-document querying system
- Designed chat-based UI with memory and sources
- 🔍 Highlight exact text used for answers (Explainability)
- 📊 Confidence scoring
- ⚡ Faster retrieval optimization
- 👤 User authentication
- 🌐 Full-stack deployment (FastAPI + React)
Shivam
- GitHub: https://github.com/shivamgravity
- LinkedIn: https://www.linkedin.com/in/shivam-gravity
Give it a star ⭐ on GitHub!