← All projects

AI Engineering · RAG

Index Methodology RAG Assistant

Answering “what's the cap rule for this index?” means searching hundreds of pages of methodology PDFs. It's slow, and a wrong answer ends up in a rebalancing file.

My role
Solo project: parsing, retrieval, evaluation sets and web UI.
When
2026
retrieve → answer → citeshipped
QUERYHYBRID RETRIEVALANSWERMax weight perstock in theindex at rebal?p.14 §3.20.91p.15 §3.30.87p.41 §7.10.82p.9 §2.40.58p.63 §9.00.37Capped at 10%per constituentat each rebal.[p.14] [p.15]no evidence → “not found”

81.9%

held-out accuracy (95% CI 73–88%)

14/14

unanswerable questions correctly refused

1,082

pages from 7 index rulebooks

4 GB

laptop GPU, fully local

Approach

Page-level PDF parsing with OCR, hybrid retrieval (BM25 + bge-m3 embeddings) with LLM query rewriting, and a local model that answers only from the retrieved pages, citing the exact page or replying NOT_FOUND.

Results

Run once on a frozen system, the assistant answers 81.9% of 94 held-out questions correctly (95% CI 73–88%) and refuses all 14 questions the documents don't answer. Held-out accuracy matches the 126-question dev set it was tuned on (81.7%), so tuning didn't overfit. Testing paraphrased questions showed that keyword search only looked good on questions worded like the documents (98% vs 42% retrieval), and swapping the answer model added 12 points.

Technical highlights

  • 01Two question sets: a dev set for every decision, a held-out set run once at the end
  • 02Held-out labels reviewed blind by a person, 95% confidence intervals on every number
  • 03Hybrid retrieval with LLM query rewriting; paraphrased questions tracked separately
  • 04Deterministic scoring with accepted wordings and forbidden facts, no LLM judge

Stack

PythonBM25 + bge-m3 hybrid retrievalqwen3-4B via OllamaPyMuPDF + OCREvaluation harness
View code →

Building something similar?

hichamalaoui975@gmail.com