homeprojectsblogcredentialsusesaboutcontact
projects/research-lens
PythonRAGLangChainQdrantFastAPIGenerative AILLMPydantic

ResearchLens – Production RAG System

Production-oriented Retrieval-Augmented Generation system for research papers and technical docs. Combines hybrid retrieval (Dense + BM25 + RRF), cross-encoder reranking, evidence gating, and claim-level citation verification to minimize hallucination.

GitHub ↗
Recall@5: 1.000MRR: 0.942Faithfulness: 94.2%Citation: 100%
Live Repository Metrics:
0 stars0 forks👁 0 watchers
Retrieval Recall@5
100%
MRR Score
94.2%
Groundedness
94.2%
Citation Accuracy
100%
Python61.0%JavaScript15.0%CSS12.5%HTML11.6%
1.000Recall@5perfect top-5 coverage
0.942MRRnear-top relevant ranking
94.2%Faithfulnessclaim-level groundedness
365 msMean Latencyfull pipeline end-to-end

Standard LLM-based QA suffers from hallucination, poor exact-terminology retrieval, noisy context, unsupported claims, and no ability to abstain on false-premise questions. A simple embed-and-retrieve pipeline gives no control over these failure modes.

Designed a multi-stage pipeline: (1) Parallel dense (semantic) + BM25 (lexical) retrieval, (2) Reciprocal Rank Fusion to merge rankings, (3) Cross-encoder reranking for precision, (4) Context filtering to drop low-confidence passages, (5) Evidence gate that forces abstention when context is insufficient, (6) Grounded LLM generation, and (7) Claim-level citation verification post-generation. Evaluation pipeline measures Recall@5, MRR, groundedness, and citation accuracy independently.

PythonFastAPILangChainQdrantBM25Cross-EncoderSentence TransformersPydanticPytest
  • Retrieval Recall@5 of 1.000 — relevant evidence present in top-5 for all evaluated queries
  • MRR of 0.942 — relevant evidence consistently ranked near the top
  • Groundedness / Faithfulness of 94.2% under claim-level evaluation
  • Citation Accuracy of 100% — every cited passage actually supports its claim
  • False Premise Rejection of 100% — system abstains on unsupported or misleading questions
  • Mean end-to-end latency of 365 ms across the full pipeline
  • 01Hybrid retrieval (dense + BM25 + RRF) outperforms either strategy alone, especially for technical terminology and acronyms
  • 02A second-stage cross-encoder reranker is critical for precision — bi-encoder retrieval optimises recall, not precision
  • 03Evidence gating (abstaining when context is weak) is more important for production reliability than raw generation quality
  • 04Claim-level citation verification catches cases where a citation exists but does not actually support the specific claim made
← Back to projects