Optimized Hybrid Retrieval-Augmented Generation Framework using Semantic Search and Re-ranking for Reliable LLM Responses

Authors

  • Vishwa K Dave Department of CSE, AMC Engineering College Bengaluru, India. Author
  • Pallavi K V Department of CSE, AMC Engineering College Bengaluru, India. Author

DOI:

https://doi.org/10.47392/10.47392/IRJAEH.2026.0625

Keywords:

Retrieval-Augmented Generation, Hybrid Retrieval, Semantic Search, BM25, FAISS, Cross-Encoder Re-ranking, Large Language Models, Gemini, Question Answering

Abstract

Building question-answering systems that can read a document and answer naturally phrased questions about it is difficult when retrieval is left to either keyword matching or dense vector search alone, since each method has blind spots that surface as missed context, near-miss answers, or content invented by the underlying language model. This paper describes an optimized hybrid Retrieval-Augmented Generation (RAG) pipeline built to reduce these failure modes by combining two complementary retrieval signals: dense semantic similarity computed over a FAISS vector index, and sparse lexical scoring computed with BM25. Candidates returned by both retrievers are merged and passed through a Cross-Encoder re-ranking stage that scores each query-passage pair jointly, pushing the most contextually relevant chunks to the top before they reach the language model. Final answers are produced by Google’s Gemini model under a prompt that restricts it to the supplied context, which keeps the output tied to the source document rather than to whatever the model already “knows.” The pipeline is exposed through a Streamlit application that lets a user upload a PDF and ask questions about it in plain language, returning each answer alongside a confidence estimate and the page it came from. Evaluation on a multi-page technical PDF document shows that the hybrid retrieval and re-ranking stages together raise retrieval precision and reduce irrelevant or unsupported answers compared with retrieval limited to a single method, supporting the use of this approach for reliable, document-grounded question answering.

Downloads

Download data is not yet available.

Downloads

Published

2026-07-23

How to Cite

Optimized Hybrid Retrieval-Augmented Generation Framework using Semantic Search and Re-ranking for Reliable LLM Responses. (2026). International Research Journal on Advanced Engineering Hub (IRJAEH), 4(07), 4757-4763. https://doi.org/10.47392/10.47392/IRJAEH.2026.0625