🔗 Live Deployment: Click Here to Try the App 🚀 🔗 Github Repository: Click Here to get the source code 🚀
The Multi-Mode RAG Bot is a Streamlit-powered AI assistant that allows you to:
- 📖 Chat (Q&A) with your uploaded PDF documents using RAG (Retrieval-Augmented Generation).
- 📝 Summarize entire documents with a map-reduce summarization chain.
It integrates LangChain, FAISS, HuggingFace embeddings, and Groq LLMs to deliver a smooth and interactive experience.
- The app uses your GROQ API Key, securely stored in
secrets.toml. - Keys are never exposed in the codebase.
- Upload a PDF file in the sidebar.
- The app will:
- Save it temporarily
- Extract the text using PyPDFLoader
- Split it into manageable chunks with RecursiveCharacterTextSplitter
- Each document chunk is embedded using HuggingFace MiniLM embeddings.
- FAISS builds a vector database for fast retrieval.
- Queries are matched against the document using FAISS retriever.
- A cross-encoder reranker refines the best results.
- The selected context is passed into Groq’s LLaMA-3 model for precise answers.
- A map-reduce summarization chain condenses the document into an easy-to-read summary.
- 📤 Upload your PDF file
- ✅ Get confirmation once it’s loaded
- Choose between Q&A (Chat) or Summarization mode.
- Ask questions in the chat box
- Get contextual answers based only on the uploaded PDF
- Click "Generate Summary" to get a concise overview of the document
-
Streamlit – Web app framework
-
LangChain – AI orchestration
-
Groq – LLaMA-3 inference
-
FAISS – Vector search
-
HuggingFace Transformers – Embeddings & reranker
-
📚 Research papers → Summarize and Q&A
-
🏛️ Legal documents → Extract key points quickly
-
🧑🎓 Study material → Summarize chapters or test knowledge
-
📊 Reports → Fast insights