Skip to content

About

Chat with any PDF or TXT using RAG. LangChain + FAISS + free local embeddings (sentence-transformers) + OpenAI GPT. Conversational memory and source citations included.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RAG Document Chatbot

CI

Python LangChain Streamlit FAISS License

Upload any PDF or TXT and ask questions. Uses free local embeddings, FAISS vector search, and OpenAI GPT for answers with source citations.


Business Problem

Professionals waste hours scanning long documents. This tool lets anyone ask plain-English questions and get precise, cited answers in seconds — from contracts, reports, manuals, or research papers.


Architecture

Upload PDF/TXT → Chunk → Embed (free, local) → FAISS → Query → OpenAI GPT → Answer + Citations

Key Features

Feature Detail
Free embeddings all-MiniLM-L6-v2 via sentence-transformers — no API cost
Local vector search FAISS in-memory — no external database
Conversational memory Remembers last 5 turns
Source citations Every answer links to source chunks
Model selector Switch between gpt-3.5-turbo, gpt-4o-mini, gpt-4o

Use Cases

  • Legal contracts — "What are the termination clauses?"
  • Financial reports — "What was Q3 revenue growth?"
  • Research papers — "What methodology did the authors use?"
  • HR policies — "What is the leave policy?"

Quickstart

git clone https://github.com/deepanshu0110/rag-document-chatbot.git
cd rag-document-chatbot
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env  # add your OpenAI API key
streamlit run app.py

Tech Stack

Python · LangChain · FAISS · sentence-transformers · OpenAI · PyPDF · Streamlit


Roadmap

  • DOCX, CSV, Markdown support
  • Persistent FAISS index
  • Ollama local LLM (fully offline)
  • Streamlit Cloud deployment

Author

Deepanshu Garg — Freelance Data Scientist

MIT License

About

Chat with any PDF or TXT using RAG. LangChain + FAISS + free local embeddings (sentence-transformers) + OpenAI GPT. Conversational memory and source citations included.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages