https://github.com/haswinai/rag_chatbot
A Retrieval-Augmented Generation (RAG) chatbot that answers questions from uploaded PDFs. Built using LangChain, Groq LLMs (LLaMA 3), FAISS, HuggingFace Embeddings, and Streamlit.
https://github.com/haswinai/rag_chatbot
faiss langchain llama3 rag-chatbot streamlit
Last synced: 3 months ago
JSON representation
A Retrieval-Augmented Generation (RAG) chatbot that answers questions from uploaded PDFs. Built using LangChain, Groq LLMs (LLaMA 3), FAISS, HuggingFace Embeddings, and Streamlit.
- Host: GitHub
- URL: https://github.com/haswinai/rag_chatbot
- Owner: HaswinAI
- Created: 2025-07-18T09:11:46.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-19T06:58:40.000Z (11 months ago)
- Last Synced: 2025-07-19T11:26:51.550Z (11 months ago)
- Topics: faiss, langchain, llama3, rag-chatbot, streamlit
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π RAG Chatbot β PDF Q&A with LangChain + Groq
# A Retrieval-Augmented Generation (RAG) chatbot that answers questions from uploaded PDFs. Built using LangChain, Groq LLMs (LLaMA 3), FAISS, HuggingFace Embeddings, and Streamlit.
# π§ What This Project Does
π Uploads a PDF document
π Reads and chunks the content into manageable parts
π’ Converts chunks into embeddings using HuggingFace models
πΎ Stores embeddings in a FAISS vector store
β Accepts user queries and retrieves top-matching chunks
π§ Sends the context to Groqβs LLaMA 3 model to generate an answer
π¬ Displays accurate, document-based responses in real-time
# π Workflow
PDF Upload
β Text Extraction
β Chunking
β Embedding (HuggingFace)
β FAISS Vector Store
User Query
β Embedding
β Search FAISS for Relevant Chunks
β Generate Answer with Groq LLM
π§° Tech Stack
Tool Role
π¦ LangChain LLM and retrieval framework
π§ Groq LLM inference (e.g. llama3-70b-8192)
π§ HuggingFace Embedding model (all-MiniLM-L6-v2)
π FAISS Vector search for chunk similarity
π PyPDF2 PDF text extraction
β‘ Streamlit UI to upload and chat
π Dotenv Secure API key handling
π Project Structure
rag-chatbot/
βββ app.py # Streamlit UI
βββ rag_chain.py # Retrieval and LLM logic
βββ utils.py # PDF reading and chunking
βββ requirements.txt # Required packages
βββ .env # API keys (not pushed)
βββ data/ # Uploaded PDFs (ignored)
βββ README.md # You are here
π Installation
Clone this repo:
git clone https://github.com/HaswinAI/RAG-chatbot.git
cd rag-chatbot-groq
Create a virtual environment:
python -m venv chatbot
source chatbot/bin/activate # or chatbot\Scripts\activate on Windows
Install requirements:
pip install -r requirements.txt
Set up .env:
GROQ_API_KEY=your_actual_groq_key_here
βΆοΈ Run the App
streamlit run app.py
Go to localhost in your browser.
π¬ Example Use
Upload a whitepaper or article PDF
Ask: "What are the key takeaways?"
Get an instant, AI-generated summary based on the real content
π Notes
PDF contents are not stored permanently
.env, .pdf files, and data/ are in .gitignore
Compatible with models like:
llama3-70b-8192
llama3-8b-8192
gemma-7b-it
mixtral-8x22b
π License
This project is released under the MIT License
β¨ Acknowledgements
LangChain
Groq
FAISS by Meta
HuggingFace Sentence Transformers
Streamlit
# Creator - HASWIN