Skip to content

Madad

An offline semantic search engine for course material

2 min read232 wordsUpdated Oct 2026v2.0

Point Madad at a semester of PDFs, slides, Word files and scans and it answers queries in milliseconds, entirely offline. A Python Brain ingests, embeds and classifies; a C++ Engine searches with data structures written from scratch.

Overview

Madad (مدد, "help") is a local-first study search engine. It is deliberately not a chatbot: the contribution is the search and retrieval system. An optional Ask Mode over a local LLM is a thin demonstration layer on top.

Problem

Students collect hundreds of course files a semester across LMS downloads, chat groups and folders. Before an exam, finding the one slide that explains a concept, or every past question on a topic, takes hours.

Architecture

Two independently testable halves joined by a frozen, versioned file contract (CRC32-checked). The Python Brain handles ingestion, parsing, OCR, chunking, TF-IDF and embeddings, topic classifiers and evaluation. It never searches.

The C++ Engine never embeds or trains. It builds every index from scratch: an FNV-1a hash table with chaining, an inverted index with BM25, KD-tree, LSH and HNSW for vectors, a trie for autocomplete, an AVL tree, a binary heap for top-K, and a concept graph with BFS, DFS and Dijkstra learning paths.

Implementation

Hybrid search fuses BM25 and semantic results. Budgets: keyword search under 50 ms and semantic under 100 ms at 10,000 chunks, autocomplete under 10 ms. Built as the joint semester project for CS250 (Data Structures) and CS272 (Artificial Intelligence).

Related projects

No results for “”.