An AI-powered document question-answering system built using LangChain, HuggingFace Embeddings, FAISS, and Streamlit. Ask questions about any PDF document — the system retrieves relevant context and answers using an LLM.
- 📄 PDF document ingestion and processing
- 🔍 Semantic search using HuggingFace embeddings
- 🧠 MMR retrieval for diverse and relevant results
- 💬 Conversational chat interface
- ⚡ Fast and accurate answers from document context
- Python 3.11
- Streamlit
- LangChain
- HuggingFace Embeddings (all-mpnet-base-v2)
- FAISS
- Groq API (Llama 3.3 70B)
- PyPDF
rag-document-assistant/
│
├── DocumentLoaders/
│ └── deeplearning.pdf
│
├── assets/
│ ├── demo1.png
│ ├── demo2.png
│ └── rag.png
│
├── .env.example
├── .gitignore
├── app.py
├── runtime.txt
├── requirements.txt
└── README.md
git clone https://github.com/bangarukondabollapally/rag-document-assistant.git
cd rag-document-assistantpython -m venv .venvActivate:
.venv\Scripts\activatesource .venv/bin/activatepip install -r requirements.txtCreate a .env file:
GROQ_API_KEY=your_groq_api_keyGet your free Groq API key at console.groq.com
streamlit run app.pyThen ask questions like:
What is backpropagation?
Explain dropout in deep learning
What is a neural network?
PDF Document
↓
PyPDFLoader → loads pages
↓
RecursiveCharacterTextSplitter → chunks (500 tokens, 100 overlap)
↓
HuggingFace Embeddings → converts chunks to vectors
↓
FAISS → stores vectors in memory
↓
MMR Retriever → fetches diverse relevant chunks
↓
Groq LLM → generates answer from context
↓
Streamlit UI → displays response
streamlit
langchain
langchain-groq
langchain-huggingface
langchain-community
langchain-text-splitters
pypdf
sentence-transformers
faiss-cpu
- 📁 Multi-document support
- 🌐 Web URL ingestion
- 📊 Source citation with page numbers
- 🔎 Hybrid search (semantic + keyword)
- 🧾 Export Q&A as PDF report
- 🗂️ Document management UI


