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.
- 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
| 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 |
cd RAGpython -m venv venv# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root (already provided):
GROQ_API_KEY=your_groq_api_key_here
streamlit run app.pyThe app will open in your default browser at http://localhost:8501.
- Upload Notes — Use the sidebar to enter a subject name and upload PDF files
- Index Notes — Click "Index Notes" to process and embed the content
- Load Subject — Select and load the subject you want to query
- Ask Questions — Type your question in the chat input at the bottom
- View Sources — Expand the "Sources" section under each answer to verify
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)
This project was built as a B.Tech Final Year Project demonstrating practical applications of RAG architecture for academic use cases.