Back to Case Studies

Hybrid Search Architecture for Enterprise RAG

Implemented hybrid retrieval with semantic re-ranking for higher precision and recall — dense + sparse fusion done right.

VectorKeywordRerank Financial Services
45%
Better Recall
30%
Better Precision
<200ms
P95 Latency

Business Problem

Dense-only retrieval missed exact financial terminology, while naive keyword search failed on intent. The system also needed to preserve document permissions across every retrieval stage.

Architecture Overview

A measurable retrieval pipeline with access controls before reranking, transparent citations, and evaluation at both retrieval and answer levels.

  1. 1 Query understanding
  2. 2 RBAC + metadata scope
  3. 3 Dense + sparse retrieval
  4. 4 Reciprocal Rank Fusion
  5. 5 Cross-encoder reranking
  6. 6 Grounded answer + citations

All components are deployed with private networking, scoped IAM roles, and encryption at rest and in transit.

Key Design Decisions

  • Permissions before reranking. Unauthorized content is removed before it enters expensive ranking or generation stages, reducing leakage risk and wasted compute.
  • Hybrid retrieval by default. Dense retrieval captures meaning; sparse retrieval preserves identifiers. RRF combines them without fragile score normalization.
  • Abstention is a valid answer. Low evidence coverage produces a transparent no-answer response rather than forcing a fluent hallucination.

Technology Stack

ElasticsearchFAISSCohereBGE RerankerPythonRRF

My Role

  • Designed the fusion and reranking pipeline.
  • Implemented chunk-level permission filtering.
  • Built retrieval evaluation (hit rate, MRR, nDCG) with segmentation.

Measurable Impact

  • 45% Better Recall
  • 30% Better Precision
  • <200ms P95 Latency

Challenges & How I Solved Them

  • Score incompatibility: Rank-based fusion (RRF) replaced fragile score normalization across BM25 and cosine similarity.
  • OCR variance: Layout-aware parsing and quality scoring for low-quality scans.
  • Permission invalidation: Fast policy-cache invalidation when access changes.

Lessons Learned

  • Hybrid search consistently outperforms single-modality retrieval.
  • The interesting evaluation insight is always in the segmentation.
  • Reranking is usually the best latency purchase in the pipeline.