Skip to content

Ayesha037/rag-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 RAG Document Intelligence System

Upload any PDF → ask questions in plain English → get accurate, source-attributed answers instantly.

Live Demo GitHub


🌐 Live Demo

👉 https://rag-chatbot-danjpg2yc4taeeerwzsvyp.streamlit.app/


🚀 What it does

  1. Upload any PDF document
  2. Ask questions in plain English
  3. Get accurate answers with source page references — no hallucinations

⚙️ Architecture

PDF Upload → Text Chunking → HuggingFace Embeddings
          → FAISS Vector Store → LLaMA3 (Groq) → Source-attributed Answer

🛠 Tech Stack

Layer Technology
LLM LLaMA3-8b via Groq
Embeddings sentence-transformers/all-MiniLM-L6-v2
Vector Store FAISS
Orchestration LangChain
PDF Parsing PyMuPDF
Backend API FastAPI (port 7860)
Frontend Streamlit (port 8501)

📊 Performance

  • ⚡ Sub-10s response latency
  • 💰 $0 API cost — fully open source stack
  • 🎯 100% source attribution — eliminates hallucinations
  • 🔧 Configurable top-k retrieval (1–10 sources)

🔧 Run Locally

git clone https://github.com/Ayesha037/rag-chatbot
cd rag-chatbot

pip install -r requirements.txt

# Add your Groq API key
cp .env.example .env
# Edit .env → set GROQ_API_KEY=gsk_...

# Terminal 1 — backend
python main.py

# Terminal 2 — frontend
streamlit run frontend/app.py

Open http://localhost:8501


🐳 Docker

docker build -t rag-chatbot .
docker run --env-file .env -p 7860:7860 -p 8501:8501 rag-chatbot

📄 API Endpoints

Method Path Description
POST /upload Upload & index a PDF
POST /query Ask a question
GET /documents List indexed docs
GET /health Health check
GET /reset Clear all docs
GET /docs Swagger UI

📁 Project Structure

rag-chatbot/
├── main.py              # FastAPI backend
├── frontend/
│   └── app.py           # Streamlit frontend (all-in-one for cloud deploy)
├── requirements.txt
├── Dockerfile
└── .env.example

Built by Mohammad Ayesha Summaiyya

About

Production-grade RAG document assistant using LangChain, FAISS, LLaMA3 and FastAPI — 6-endpoint REST API with sub-10s response latency and zero API cost

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors