A Retrieval-Augmented Generation (RAG) based AI chatbot that allows users to upload any PDF and interact with it in a conversational way.
Built using Streamlit, LangChain, FAISS, HuggingFace embeddings, and Ollama (local LLM).
- Upload any PDF document
- AI understands document content using embeddings
- Chat with your PDF like a personal assistant
- Context-aware answers using FAISS retrieval
- Supports follow-up questions (memory enabled)
- Runs locally using Ollama (no API cost)
- Streamlit (Frontend UI)
- LangChain (RAG pipeline)
- FAISS (Vector database)
- HuggingFace Transformers (Embeddings)
- SentenceTransformers (all-MiniLM-L6-v2)
- Ollama (Local LLM - Mistral)
- PyPDF (PDF parsing)
The following diagram explains the end-to-end workflow of the Smart PDF Chatbot using RAG and Ollama.
git clone https://github.com/ya-sonia/RAG-based-PDF-chatbot.git
cd RAG-based-PDF-chatbotFor Windows :
python -m venv venv
venv\Scripts\activatepip install -r requirements.txtDownload Ollama: https://ollama.com
Then pull the model:
ollama pull mistralRun Ollama (keep it running in background):
ollama run mistralstreamlit run app.py
