Skip to content

AnupojuRohit/RAGChatBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ RAG-Based PDF Chatbot (FAISS + LLaMA 3)

A Retrieval-Augmented Generation (RAG) chatbot that answers questions from PDF documents using semantic search and large language models.
Built from scratch using FAISS, Sentence Transformers, and Groq’s LLaMA-3.1 model.

This project is designed for internship and portfolio use, demonstrating real-world AI engineering skills.


πŸš€ Features

  • πŸ“„ Ingests one or multiple PDF documents
  • βœ‚οΈ Smart text chunking with overlap
  • πŸ”Ž Semantic search using FAISS vector database
  • 🧠 Context-aware answers using LLaMA-3.1
  • πŸ’¬ Chat-style UI with conversation history
  • πŸ“Œ Uses PDF context first, with intelligent fallback
  • 🧾 (Optional) Source-aware responses

🧠 Architecture Overview

PDF Documents ↓ Text Extraction (PyPDF) ↓ Chunking with Overlap ↓ Embeddings (Sentence Transformers) ↓ FAISS Vector Database ↓ Top-K Context Retrieval + Reranking ↓ LLaMA-3.1 (Groq API) ↓ Final Answer (Chat UI)


πŸ› οΈ Tech Stack

  • Programming Language: Python 3.13
  • Embeddings: Sentence Transformers (all-MiniLM-L6-v2)
  • Vector Database: FAISS
  • LLM: LLaMA-3.1 via Groq API
  • Frontend: Streamlit
  • PDF Parsing: PyPDF

πŸ“‚ Project Structure

RAGChatBot/ β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ load_pdf.py # PDF text extraction β”‚ β”œβ”€β”€ chunker.py # Text chunking logic β”‚ β”œβ”€β”€ vector_store.py # FAISS index creation β”‚ β”œβ”€β”€ rag_answer.py # Final RAG pipeline β”‚ └── test_rag.py # Backend testing β”œβ”€β”€ data/ β”‚ └── pdfs/ # Input PDF files β”œβ”€β”€ faiss_index/ β”‚ β”œβ”€β”€ index.faiss # FAISS vector index β”‚ └── chunks.txt # Stored text chunks β”œβ”€β”€ frontend/ β”‚ └── app.py # Streamlit chat UI β”œβ”€β”€ requirements.txt └── README.md


βš™οΈ How to Run Locally

1️⃣ Clone the repository

git clone https://github.com/your-username/RAGChatBot.git
cd RAGChatBot


2️⃣ Create and activate virtual environment
python -m venv venv
venv\Scripts\activate

3️⃣ Install dependencies
pip install -r requirements.txt

4️⃣ Build the FAISS vector index
python backend/vector_store.py

5️⃣ Run the chatbot UI
python -m streamlit run frontend/app.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages