A high-performance Retrieval-Augmented Generation (RAG) system that allows users to chat with their PDF documents. This project stands out by supporting Multimodal Ingestion, meaning it can "see" and describe charts, graphs, and images within your PDFs.
- Semantic Text Search: Uses local
all-MiniLM-L6-v2embeddings for fast, zero-cost text retrieval. - Multimodal Vision: Automatically extracts images from PDFs and captions them using Groq's Llama 3.2 Vision model.
- Vector Database: Scalable vector storage using MongoDB Atlas Vector Search.
- Ultra-Fast LLM: Powers conversations with Llama 3.3 (70B) via Groq, providing near-instant responses.
- Streamlit UI: A clean, modern chat interface for easy document management and interaction.
- AI Models: Groq (Llama 3.3 & Llama 3.2 Vision), HuggingFace (Local Embeddings).
- Database: MongoDB Atlas (Vector Search).
- Orchestration: LangChain.
- Interface: Streamlit.
- PDF Processing: PyMuPDF (fitz), PyPDF.
- Ingestion: PDFs are split into text chunks. Images are extracted and sent to Groq Vision for detailed captioning.
- Indexing: Both text and image captions are converted into 384-dimensional vectors and stored in MongoDB Atlas.
- Retrieval: When a user asks a question, the system performs a similarity search in MongoDB to find the most relevant context (text or visuals).
- Generation: Groq's Llama 3.3 synthesizes the retrieved context into a clear, accurate answer.
- Clone the repo:
git clone <your-repo-url> cd Multimodal-RAG-Chatbot
- Create and Activate Environment:
conda create -n chatbot-env python=3.12 -y conda activate chatbot-env
- Install Dependencies:
pip install -r requirements.txt
- Configure Environment Variables:
Create a
.envfile based on.env.exampleand add your:GROQ_API_KEYMONGODB_ATLAS_CLUSTER_URIGOOGLE_API_KEYis optional (only needed if you want Gemini fallback/testing).
- Run the App:
streamlit run app.py