Skip to content

ya-sonia/RAG-based-PDF-chatbot

Repository files navigation

Smart PDF Chatbot (RAG + Ollama)

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).



Features

  • 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)

Tech Stack

  • Streamlit (Frontend UI)
  • LangChain (RAG pipeline)
  • FAISS (Vector database)
  • HuggingFace Transformers (Embeddings)
  • SentenceTransformers (all-MiniLM-L6-v2)
  • Ollama (Local LLM - Mistral)
  • PyPDF (PDF parsing)

System Architecture

The following diagram explains the end-to-end workflow of the Smart PDF Chatbot using RAG and Ollama.

RAG Architecture


Setup Guide

1️ Clone the repository

git clone https://github.com/ya-sonia/RAG-based-PDF-chatbot.git
cd RAG-based-PDF-chatbot

2. Create and activate virtual environment

For Windows :
python -m venv venv
venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Install Ollama (IMPORTANT)

Download Ollama: https://ollama.com

Then pull the model:

ollama pull mistral

Run Ollama (keep it running in background):

ollama run mistral

5. Run the Application

streamlit run app.py

About

Built a RAG-based system to extract and answer questions from PDF documents using semantic search and local LLMs (Ollama).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages