Skip to content

manasmannu/Knowledge-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knowledge Chatbot (Local RAG over PDFs)

Python Flask HuggingFace FAISS License

A tiny Flask app that answers questions about your PDFs using local embeddings (MiniLM) + FAISS + an extractive QA model (Distil/Roberta SQuAD). No API keys required.

Features

  • Drop PDFs in ./data, run ingest.py to index
  • Ask questions at http://127.0.0.1:5000
  • 100% local — no internet access needed
  • Pure local pipeline (CPU-friendly)

Quickstart

Clone the repository

git clone https://github.com/manasmannu/knowledge-chatbot.git
cd knowledge-chatbot

Create a virtual environment

python -m venv .venv
source .venv/bin/activate           # Windows: .venv\Scripts\activate

Install dependencies

pip install -r requirements.txt

Prepare your data

Run the below to remove the index

rm -rf vectorstore

Put one or more PDF files inside the data/folder (There is one sample file in the folder already, you can remove it and add your own pdf).

Build the FAISS vectore store

python ingest.py                    # builds ./vectorstore from PDFs in ./data
python app.py                       # starts the web app

Open your browser and visit

http://127.0.0.1:5000

Demo Screenshot

Chatbot Demo

Chatbot Demo

Chatbot Demo

How it Works

  1. PDF Processing → Extracts text using pypdf
  2. Chunking → Splits text into ~1000-character segments for semantic search
  3. Embedding → Converts chunks into dense vectors using MiniLM
  4. Vector Store → Saves embeddings in FAISS for fast similarity search
  5. Retrieval → On user query, retrieves top-matching chunks
  6. QA Model → Uses Roberta (deepset/roberta-base-squad2) to extract the exact answer
  7. Response → Displays the best-matched answer + PDF source

About

Local PDF QA Chatbot using Flask, FAISS, and Langchain Hugging Face embeddings

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published