The article describes a production-focused effort to improve retrieval in a RAG (retrieval-augmented generation) system, moving from default “semantic search + hope” settings to a measured, tunable pipeline. It argues that retrieval quality depends heavily on chunking and evaluation rather than fixed defaults. The authors report using different chunking strategies by document type—recursive, semantic, and LLM/agentic chunking—with chunk sizes and overlaps adjusted for legal contracts, API documentation, support tickets, and an internal wiki.

For retrieval, they implement a hybrid approach combining BM25 and vector search, then apply reciprocal rank fusion to merge candidate lists. A cross-encoder reranker selects a smaller set of passages from the fused results to improve relevance. They also introduce query transformation, including query expansion (multiple generated queries) to improve recall for short or ambiguous user questions.

Finally, they tune retrieval hyperparameters (such as chunk size, overlap, top-k, and weighting between retriever components) using Bayesian optimization against a “golden set” of 200 queries, optimizing for recall@10 and latency. Over six months, they report baseline versus optimized results: recall@10 rising from 78% to 95%, p95 latency dropping from 850ms to 320ms, a hallucination-rate reduction from 12% to 3%, and per-query cost decreasing from $0.008 to $0.005.