Research Paper RAG

rag
llm
fastapi
python
A hybrid retrieval pipeline for question answering over research papers, with citations and an automated evaluation suite.
Author

Anto Francis

Published

Sep 2026

Overview

A question-answering service over research papers. Answers come with citations back to the source papers, and the system declines to answer when retrieval doesn’t find enough relevant material.

Retrieval

Retrieval Recall@5 improved from 72% to 91% across 200 benchmark queries by combining four techniques:

  • Dense vector search (Qdrant)
  • BM25 keyword retrieval
  • Metadata filtering
  • Cross-encoder reranking

Grounding

Hallucinated responses fell by 45%, and grounded-answer accuracy reached 88%, after adding:

  • Source-aware prompting
  • Relevance thresholds that stop the model answering from weak context
  • Citations back to the source papers
  • An automated RAG evaluation suite to measure each change

Latency

Median end-to-end query latency fell by 38% after three changes: caching paper embeddings and retrieval results, batching embedding requests, and deploying the FastAPI service with PostgreSQL and Qdrant in Docker. Ingestion jobs are orchestrated with Inngest.

Stack

Python · FastAPI · Inngest · PostgreSQL · Qdrant · Docker