Skip to content

About

A Retrieval-Augmented Generation (RAG) chatbot for querying academic PDF notes with semantic search, source citations, and hallucination safeguards using LangChain, FAISS, and Groq LLM.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

📚 Smart-RAGging

A Retrieval-Augmented Generation (RAG) based question-answering system that allows students to upload their own course notes (PDF) and ask natural-language questions. Answers are grounded in your uploaded material with source citations.

🎯 Features

  • Semantic Search — Understands meaning, not just keywords
  • Source-Grounded Answers — Every answer cites the exact passage and page number
  • Hallucination Safeguard — Says "not covered" instead of making up answers
  • Subject-wise Indexing — Maintain separate indexes per subject (DBMS, OS, CN, etc.)
  • Multi-PDF Upload — Upload multiple PDFs at once per subject
  • Session Chat History — Ask follow-up questions in a conversation
  • Fully Free Stack — No paid APIs; runs locally with free Groq tier

🛠️ Technology Stack

Component Technology
Language Python 3.10
Framework LangChain
Embeddings sentence-transformers (all-MiniLM-L6-v2)
Vector DB FAISS
LLM Groq API (Llama 3.1 8B Instant)
UI Streamlit

📦 Setup Instructions

1. Clone / Navigate to project directory

cd RAG

2. Create virtual environment

python -m venv venv

3. Activate virtual environment

# Windows
venv\Scripts\activate

# macOS/Linux
source venv/bin/activate

4. Install dependencies

pip install -r requirements.txt

5. Set up environment variables

Create a .env file in the project root (already provided):

GROQ_API_KEY=your_groq_api_key_here

6. Run the application

streamlit run app.py

The app will open in your default browser at http://localhost:8501.

🚀 Usage

  1. Upload Notes — Use the sidebar to enter a subject name and upload PDF files
  2. Index Notes — Click "Index Notes" to process and embed the content
  3. Load Subject — Select and load the subject you want to query
  4. Ask Questions — Type your question in the chat input at the bottom
  5. View Sources — Expand the "Sources" section under each answer to verify

📁 Project Structure

RAG/
├── app.py                # Streamlit web application
├── rag_engine.py         # Core RAG logic (embeddings, FAISS, Groq)
├── pdf_processor.py      # PDF loading and text chunking
├── config.py             # Configuration and constants
├── requirements.txt      # Python dependencies
├── .env                  # API key (not tracked in git)
├── .gitignore            # Git ignore rules
├── README.md             # This file
├── vector_stores/        # FAISS indexes (auto-created, per subject)
└── uploaded_pdfs/        # Stored uploaded PDFs (auto-created)

📝 B.Tech Final Year Project

This project was built as a B.Tech Final Year Project demonstrating practical applications of RAG architecture for academic use cases.

About

A Retrieval-Augmented Generation (RAG) chatbot for querying academic PDF notes with semantic search, source citations, and hallucination safeguards using LangChain, FAISS, and Groq LLM.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages