01 / CONTEXT
The problem to solve
A generated answer can hide how documents were read, which passages were retrieved and why those passages were selected. Learners need a working RAG pipeline whose intermediate evidence and limits can be inspected.
02 / ENGINEERING
From need to system
- Extract PDF text with PDF.js, use Tesseract for scanned pages, and preserve file and page provenance when creating passages.
- Run multilingual-e5-small locally with Transformers.js and ONNX Runtime: 384-dimensional embeddings, mean pooling and L2 normalization. Keep PDF contents and vectors in browser-session memory.
- Combine semantic cosine similarity and BM25 lexical retrieval with Reciprocal Rank Fusion (k = 60). Expose scores, ranking and the context budget through an interactive learning journey.
- After explicit consent, send only the question and selected passages through a validating server API to NVIDIA GPT-OSS 20B. Check returned references against the supplied context.
- Explain the pipeline in French and English through theory and architecture pages, including the calculations from the latest search.
03 / DESIGN DECISION
A meaningful choice
Make retrieval and its trust boundaries visible: index locally, combine complementary search methods, and keep generation separate and optional. A citation supports inspection; it does not guarantee a correct interpretation.
04 / EVIDENCE AND LIMITATIONS
What is actually documented
The public repository and Vercel demo are available. GitHub Actions passed 24 browser cases and 14 Node API tests; PDF/OCR/E5 tests run real processing, while generation UI tests use simulated responses. The full Git-history secret scan found no unexplained credential findings. These checks do not establish retrieval accuracy or answer faithfulness on a labeled benchmark.
05 / NEXT VALIDATIONS
How I would strengthen the proof
- Build a labeled question-and-document evaluation set and measure retrieval recall@k.
- Evaluate citation faithfulness, unsupported answers and ambiguous questions.
- Measure latency and provider usage across representative documents without presenting CI pass counts as model-quality metrics.
These are planned validation steps, not already measured results.