https://github.com/anandvai/ai_rag_chatbot_multi_pdf_support
RAG (Retrieval-Augmented Generation) Chatbot built with Streamlit and LangChain, powered by Groq's blazing-fast LLaMA3-8B. It allows you to upload multiple PDFs, ask questions, and get precise, context-aware answers in a conversational format.
https://github.com/anandvai/ai_rag_chatbot_multi_pdf_support
ai data data-science data-visualization data-visualizations dataengineering fastapi langchain langgraph python sql streamlit
Last synced: 6 months ago
JSON representation
RAG (Retrieval-Augmented Generation) Chatbot built with Streamlit and LangChain, powered by Groq's blazing-fast LLaMA3-8B. It allows you to upload multiple PDFs, ask questions, and get precise, context-aware answers in a conversational format.
- Host: GitHub
- URL: https://github.com/anandvai/ai_rag_chatbot_multi_pdf_support
- Owner: anandvai
- Created: 2025-08-12T08:40:24.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-08-12T08:44:13.000Z (6 months ago)
- Last Synced: 2025-08-12T10:27:22.869Z (6 months ago)
- Topics: ai, data, data-science, data-visualization, data-visualizations, dataengineering, fastapi, langchain, langgraph, python, sql, streamlit
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π€RAG_AI_Chatbot_Multi_PDF_Support[Streamlit + Groq (LLaMA3)]
This project is a fully interactive **RAG (Retrieval-Augmented Generation) Chatbot** built with **Streamlit** and **LangChain**, powered by **Groq's blazing-fast LLaMA3-8B**. It allows you to upload **multiple PDFs**, ask questions, and get precise, context-aware answers in a conversational format.
---
## π Features
- π€ Upload **multiple PDF documents**
- π€ LLM-powered answers via **Groq LLaMA3-8B**
- π **Document viewer** in sidebar (first 3 pages per PDF)
- π **Loading spinner** while processing queries
- π¬ Chat-style history and interface
- π§ Uses **HuggingFace sentence-transformers** for embeddings
---
## πΈ Demo
> Upload PDFs β Ask Questions β Get Context-Aware Answers

---
## π§± Tech Stack
| Layer | Tool/Library |
|--------------|-----------------------------------|
| UI | [Streamlit](https://streamlit.io) |
| Backend | [LangChain](https://www.langchain.com) |
| LLM Host | [Groq](https://console.groq.com/) (LLaMA3) |
| Embeddings | `sentence-transformers/all-MiniLM-L6-v2` |
| PDF Handling | PyPDF2, LangChain PDF Loader |
---
---
## ποΈ Project Structure
```bash
rag_chatbot/
βββ app.py # Streamlit frontend
βββ rag_engine.py # Core RAG logic (PDF loading, LLM response)
βββ .env # API key for Groq
βββ temp/ # Temporary file storage
βββ requirements.txt # Project dependencies
βββ README.md # Project documentation
---
---
## βοΈ Setup Instructions
### β
Step 1: Clone the Repository
```bash
git clone https://github.com/your-username/rag-chatbot.git
cd rag-chatbot
### β
Step 2: Create Virtual Environment
python -m venv venv
# Activate it
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On Windows
### β
Step 3: Install Dependencies
pip install -r requirements.txt
### requirements.txt
streamlit
python-dotenv
langchain
langchain-community
langchain-core
langchain-groq
PyPDF2
sentence-transformers
### β
Step 4: Set Environment Variables
GROQ_API_KEY=your_actual_groq_api_key
### βΆοΈ Run the Application
streamlit run app.py
## π‘ How It Works
- PDF files are uploaded and stored temporarily in a `/temp/` directory.
- Text is extracted using `PyPDF2` and `LangChain`βs `PyPDFLoader`.
- Text chunks are embedded using `HuggingFace` sentence-transformers (`all-MiniLM-L6-v2`).
- A vectorstore is created and queried via `LangChain's RetrievalQA`.
- User queries are answered using `Groqβs LLaMA3-8B` model, delivering fast and accurate responses grounded in the uploaded content.
---
## β¨ Future Enhancements
- [ ] Source highlighting in answers
- [ ] Export chat to PDF/Markdown
- [ ] Upload `.docx` / `.txt` files
- [ ] Switchable LLMs (OpenAI, Claude, Mixtral)
---
## π Acknowledgments
- [LangChain](https://www.langchain.com)
- [Groq](https://console.groq.com)
- [Streamlit](https://streamlit.io)
- [HuggingFace](https://huggingface.co)
---
## π License
This project is licensed under the [MIT License](LICENSE).
---
## π§ Author
**Vaibhav Anand**
Feel free to reach out or contribute!