Retrieval Strategies for Retrieval-Augmented Generation with LangChain: A Comparative Study of Chunking, Sparse, Dense and Hybrid Search
This paper compares retrieval strategies for Retrieval-Augmented Generation (RAG) pipelines built with LangChain. Using the SQuAD v1.1 validation set (48 Wikipedia articles, 1,000 sampled questions), it evaluates three chunk sizes (250, 500 and 1,000 characters, 10% overlap) with three retrievers: BM25 sparse search, dense search using all-MiniLM-L6-v2 embeddings, and hybrid search that fuses both rankings with Reciprocal Rank Fusion (RRF). Performance is measured with Hit@1, Hit@3, Hit@5 and MRR@10. Hybrid retrieval gave the best Hit@5 (93.1%) and the best MRR@10 at the 250- and 500-character chunk sizes. BM25 was the strongest at Hit@1 and MRR@10 with 1,000-character chunks (77.5% and 0.837). Dense search alone was weakest at every chunk size. The results give practical guidance on chunking and retriever choice for RAG systems.
Authors
- Anisha Gupta (ORCID: https://orcid.org/0000-0002-0276-9169)
Institutions
- Indira Gandhi Delhi Technical University for Women (IN)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-01
- DOI
- https://doi.org/10.5281/zenodo.23860324
- Primary Topic
- Topic Modeling
- Type
- preprint