All work

RAG Engineering Handbook

Ask the 297-page NASA Systems Engineering Handbook a question and get a streamed answer whose citations open the exact highlighted passage in the PDF.

What it is
Retrieval-augmented Q&A with cited sources
Role
Personal project, 2026
Stack
Docling, Sentence Transformers, FAISS, BM25, Cross-encoder, Azure OpenAI, FastAPI, Streamlit, RAGAS, Docker, Azure Container Apps

The problem

Long technical handbooks are where engineers lose hours. A chatbot that paraphrases without showing its source is worse than search, because nobody can check it.

What I built

  1. PDF
  2. Docling parse
  3. Chunk
  4. Embed
  5. FAISS + BM25
  6. Rerank
  7. Stream with citations
  1. Layout-aware parsing with Docling, keeping tables and the bounding box of every passage, then structure-aware chunks of 100 to 700 tokens.
  2. Hybrid retrieval: FAISS dense search fused with BM25 through reciprocal rank fusion, then a cross-encoder reranker.
  3. Streaming answers from gpt-4o-mini with inline [C1] citations; each one jumps to the source page with the passage highlighted.
  4. Two modes: Quick (dense only, about 1.2 s) and Thorough (with reranking, about 2.2 s).
  5. Evaluated before shipping, with IR metrics on a ground-truth set and RAGAS with Gemini as the judge; deployed on Azure Container Apps.

Results

Faithfulness
0.93
Answer relevancy
0.88
Hit@5 with reranking
0.95
Time to first token, median
1.1 s

Measured on 20 ground-truth queries; RAGAS judged by Gemini 2.5 Flash

What the cross-encoder reranker bought
PipelineHit@3Hit@5MRR@3MRR@5
Dense only0.850.850.710.71
Dense and rerank0.900.950.790.80

The Azure deployment has been taken down to avoid running costs; the code and evaluation results are in the repository.