Back to portfolio

Applied AI, AUI

Paper in progress

RAG Class Assistant

A production RAG assistant for Calculus II, built and deployed inside OneNote, with slide-level citations for every answer.

Key results

600

engineering students served

94%

accuracy, 47/50 on a validated question bank

1,183

production chunks indexed

RAG Class Assistant project hero

Overview

An end-to-end retrieval-augmented generation system, engineered and deployed as university infrastructure for 600 engineering students in Al Akhawayn University's Calculus II course. It answers with exact chapter, section, and slide citations at 94% accuracy (47/50 on a validated question bank) and runs inside Microsoft OneNote as a native task-pane add-in. Built under Prof. Sofiane Grira as both a production deployment and an active research project: a paper on hybrid retrieval and cross-encoder reranking for mathematical educational content is in progress, alongside a PIF Spring 2027 grant proposal (72,000 MAD).

Problem

Students navigating 1,000+ lecture slides across multiple OneNote class notebooks had no way to instantly locate, cross-reference, and understand specific calculus concepts, from integration by parts to p-series convergence, with precise slide-level citations.

Solution

A production-grade RAG pipeline that ingests, indexes, and retrieves mathematical content, delivering answers with exact chapter, section, and slide references, deployed directly inside Microsoft OneNote as a native task-pane add-in.

Impact

Built end to end, from the dual OCR math extraction pipeline to the hybrid retrieval engine, the OneNote add-in, and the security-hardened API, and deployed as real university infrastructure rather than a class project. Now scaling from free-tier prototyping to a paid Groq tier for the full engineering department. The paper with Dr. Grira will formalize the retrieval methodology, evaluation framework, and findings.

Built during

Research Assistant, RAG Class Assistant System

Al Akhawayn University · Aug 2026 to Present

Course
MTH 1312 Calculus II, Al Akhawayn University
Supervisor
Prof. Sofiane Grira
Funding
PIF Spring 2027 grant proposal, 72,000 MAD

Topics

RAGFAISSBM25Cross-Encoder RerankingHyDEEasyOCRGOT-OCR2Office.jsMicrosoft Graph APIFastAPIGroq

Stack

  • Python
  • FastAPI (CSP, rate limiting, cookie isolation)
  • FAISS dense retrieval (IndexFlatIP) + BM25 with synonym expansion, fused by RRF (k=60)
  • BAAI/bge-base-en-v1.5 embeddings (768-d)
  • BAAI/bge-reranker-v2-m3 cross-encoder (top 128 to 32, rerank top 16)
  • HyDE query rewriting
  • EasyOCR + GOT-OCR2 for math formulas
  • Groq, Gemini, Claude, SambaNova failover with circuit breakers
  • Microsoft Graph API
  • Office.js OneNote add-in

Key highlights

01

Hybrid BM25 + dense retrieval fused with Reciprocal Rank Fusion

02

Cross-encoder reranking and HyDE query rewriting

03

Dual-engine math OCR; every answer cites chapter, section, and slide

04

Multi-provider LLM failover with per-provider circuit breakers

More projects

View all

Startup, AUI Entrepreneurship

Bliss Bites

Breast Cancer Research, KMUTT Bangkok

ML Virtual Screening for Cancer Drug Discovery

AgriVerse feature

Hackathon, UFV Community Ideation Jam

AgriVerse