Skip to content

Keshav1926/VEC2RAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

README.md

📖 Project Overview

This repository implements a Retrieval-Augmented Generation (RAG) chatbot powered by a Qdrant vector database and an NVIDIA-hosted LLM (Meta LLaMA-3.1-405B). The pipeline covers document ingestion, chunking, embedding, vector store creation, and a Streamlit front‑end for interactive question answering.

🔍 Architecture & Flow

Raw documents (PDF, TXT)
  └─> preprocess.py (load + split into chunks)
         └─> 2,000‑char chunks w/200‑char overlap
               └─> HuggingFaceEmbeddings (all‑MiniLM‑L6‑v2)
                     └─> Qdrant vector store (collection: amlgo‑docs)
                           └─> rag_pipeline.py (RetrievalQA chain)
                                 └─> ChatNVIDIA LLM (llama-3.1-405b-instruct)
                                       └─> app.py (Streamlit UI)

🚀 Getting Started

1. Clone & Install

git clone <repo-url>
cd Code
pip install -r requirements

2. Preprocessing & Embeddings

  1. Place your PDF/TXT files in ../data/
  2. Run chunking and ingestion:
    python preprocess.py
    • Splits documents into 2,000‑char chunks
    • Generates embeddings via sentence‑transformers/all‑MiniLM‑L6‑v2
    • Creates or overwrites Qdrant collection amlgo‑docs

3. Build RAG Pipeline

No separate step required — the first call to the Streamlit app will initialize the Retriever + LLM chain.

4. Run the Chatbot (Streaming)

streamlit run app.py
  • Opens UI at http://localhost:8501
  • Enter your NVIDIA API key as env var or modify rag_pipeline.py
  • Queries stream in real‑time; history panel shows previous Q&A

🤖 Models & Embeddings

  • Embedding Model: sentence‑transformers/all‑MiniLM‑L6‑v2 (384‑dim cosine)
  • LLM: llama-3.1-405b-instruct via ChatNVIDIA (streaming enabled)
  • Vector DB: Qdrant (self‑hosted or cloud, COSINE distance)

🎯 Sample Queries & Output

Query 1

Screenshot (43)

Query 2

Screenshot (44)

Query 3

Screenshot (45)

Query 4

Screenshot (46)

Conversation History

Screenshot (47)

Clear Buttom

Screenshot (48)

Streaming response Video

RAG_Chatbot_demo.mp4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages