Exam RAG is an AI-powered Retrieval-Augmented Generation (RAG) system that automates the process of:
✔ Crawling institutional repositories ✔ Extracting exam questions from PDFs ✔ Structuring them using AI ✔ Enabling semantic search (search by meaning, not keywords)
💡 Built to solve the real problem of finding relevant past exam questions efficiently.
- Automatically discovers and downloads PDF files from repositories (e.g., Amrita DSpace)
- Extracts text dynamically without storing unnecessary files
- Uses LangChain + LLMs to convert messy text into structured questions (JSONL format)
- Uses vector embeddings to find contextually similar questions
-
Separate pipelines for:
- Crawling
- Processing
- Searching
- Uses SQLite + NumPy for efficient storage and retrieval
sqlite3– Databasejson– Data formattingnumpy– Vector operationsos– File handling
requests– Fetching dataBeautifulSoup (bs4)– HTML parsingPyPDF2– PDF text extractionio– In-memory streams
langchain– LLM pipelinesentence-transformers– Embeddingssklearn– Cosine similarity
flask– Web interface
Repository → Crawler → PDF Extractor → AI Processing → SQLite DB → Semantic Search
exam_rag/
│
├── crawler.py # Crawls repository and collects PDFs
├── processor.py # Extracts and processes questions
├── database.py # SQLite operations
├── search.py # Semantic search engine
├── app.py # Flask application
│
├── data/
│ ├── raw/
│ └── processed/
│
├── implementation/
│ ├── cc.png
│ ├── eee.png
│ ├── eng.png
│ └── qm.png
│
├── requirements.txt
└── README.md
-
Crawl Repository
- Extract all PDF links
-
Process PDFs
- Convert PDFs → raw text
-
AI Structuring
- Text → clean questions (JSONL)
-
Embedding Generation
- Convert questions → vectors
-
Store in Database
-
SQLite stores:
- Questions
- Embeddings
-
-
Semantic Search
- Input query → find most relevant questions
git clone https://github.com/backpropbrigade-dev/Exam-rag.git
cd Exam-ragpip install -r requirements.txtpython crawler.py
python processor.py
python app.pySearch: "control systems stability questions" ➡ Returns relevant questions even if exact words don’t match.
- 🔹 Add subject-wise filtering
- 🔹 Improve UI with React frontend
- 🔹 Support multiple repositories
- 🔹 Add question difficulty classification
- 🔹 Deploy as cloud-based API
Contributions are welcome!
- Fork the repo
- Create a feature branch
- Commit changes
- Open a Pull Request
If you like this project:
- ⭐ Star the repo
- 🍴 Fork it
- 🧠 Share ideas



