Default Retriever to weighted hybrid search - #2427
Conversation
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Greptile SummaryThis PR makes weighted dense-favoring hybrid retrieval the default for newly created indexes while preserving the physical retrieval mode of existing tables on append.
|
| Filename | Overview |
|---|---|
| nemo_retriever/src/nemo_retriever/common/vdb/lancedb.py | Adds weighted hybrid retrieval and service-side FTS maintenance, but FTS telemetry can still propagate transient index-listing failures into an unhealthy service response. |
| nemo_retriever/src/nemo_retriever/common/vdb/hybrid_fusion.py | Introduces a validated weighted-RRF policy and LanceDB reranker implementation. |
| nemo_retriever/src/nemo_retriever/ingest/index_mode.py | Centralizes validation and resolution of automatic, dense, hybrid, and sparse ingest modes. |
| nemo_retriever/src/nemo_retriever/ingest/plan.py | Resolves automatic index mode against existing physical table capabilities before constructing the ingest plan. |
| nemo_retriever/src/nemo_retriever/service/vectordb_app.py | Enables automatic hybrid service storage and query fusion, while the prior health-probe availability issue remains reachable through backend telemetry. |
| nemo_retriever/src/nemo_retriever/common/vdb/lancedb_capabilities.py | Makes physical vector and FTS capabilities authoritative over stale schema metadata. |
| nemo_retriever/helm/templates/deployment-vectordb.yaml | Validates the configured VectorDB index mode and forwards it to the service process. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Ingest request] --> B{Table exists and append?}
B -- No --> C[Resolve auto to hybrid]
B -- Yes --> D[Inspect physical indexes]
D --> E[Preserve dense, hybrid, or sparse mode]
C --> F[Write vectors and text]
E --> F
F --> G[Create or maintain FTS index]
H[Query with mode auto] --> I[Inspect vector and FTS capabilities]
I --> J{Hybrid capable?}
J -- Yes --> K[Dense search plus BM25 search]
K --> L[Weighted RRF fusion]
J -- No --> M[Use supported physical mode]
Reviews (9): Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." | Re-trigger Greptile
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
…fault-poc Signed-off-by: Jacob Ioffe <jioffe@nvidia.com> # Conflicts: # nemo_retriever/helm/templates/deployment-vectordb.yaml # nemo_retriever/src/nemo_retriever/common/vdb/lancedb.py # nemo_retriever/src/nemo_retriever/service/vectordb_app.py # nemo_retriever/tests/test_service_vectordb_app.py # nemo_retriever/tests/test_service_vectordb_hybrid_integration.py
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
…fault-poc Signed-off-by: Jacob Ioffe <jioffe@nvidia.com> # Conflicts: # nemo_retriever/src/nemo_retriever/common/vdb/lancedb.py # nemo_retriever/src/nemo_retriever/ingest/plan.py
Summary
This PR makes weighted hybrid retrieval the default for new NeMo Retriever indexes.
The product behavior is intentionally simple:
Each hybrid query combines dense semantic search with BM25 full-text search (FTS) for exact terms, then merges the two ranked lists with weighted Reciprocal Rank Fusion (RRF). RRF is a rank-list merge: dense remains the primary signal, while FTS can rescue identifiers, numbers, names, and other lexical matches.
Why weighted hybrid
Dense retrieval is strong for paraphrases and semantic similarity, but it can miss an exact identifier or phrase. FTS has the opposite profile. Combining both signals is a better general-purpose default, but equal weighting can allow a lexical match to displace a stronger semantic result.
The product paths therefore use one fixed, dense-favoring policy:
0.80.2k=10This policy is intentionally not exposed as a runtime tuning surface. Low-level LanceDB callers can still opt into explicit behavior.
What the evaluation says
BO767 showed the clearest positive movement in the nightly validation, particularly for lexical/document matching. The full ViDoRe suite was used as a broad check against overfitting:
Primary no-reranker ablation
This is the no-model-reranker policy-selection run, comparing two different fusion policies against dense retrieval. Equal-weight RRF reduced quality on ViDoRe and FinanceBench. The selected dense-favoring weighted RRF improved ViDoRe, BO767, and Earnings/Consulting, and removed the large FinanceBench regression, leaving FinanceBench effectively tied with dense. The four-arm table below separately measures how the model reranker interacts with dense and weighted hybrid retrieval.
These are query-weighted results over all 14,514 queries in the eight ViDoRe V3 datasets.
The important conclusions are:
This is a deliberate, evidence-based default change: hybrid does not materially regress dense behavior, and it improves the query classes where semantic-only retrieval is least reliable.
Index-mode behavior
index_mode=autois now the default for SDK, CLI, harness, and service paths:autobehaviorindex_mode=hybridon dense tableQuery
retrieval_mode=autoresolves from the table's physical vector and FTS capabilities, so stale schema metadata cannot override the actual storage state.Service behavior
optimize()after 20 writes or 100,000 added rows.serviceConfig.vectordb.indexMode, defaulting toauto.Scope and non-goals
This PR does not add a query router, model reranker, approximate vector index, fusion-learning loop, or new runtime tuning surface. Reranking remains an existing opt-in capability; this change only makes hybrid retrieval the default retrieval strategy for new indexes.
Validation
uvx pre-commit run --all-files: passed.Recommendation
Merge this as a default-behavior improvement. New users get the best tested general-purpose retrieval configuration without having to select a mode. Existing dense deployments remain safe and unchanged until an explicit hybrid upgrade is requested. Users who need maximum accuracy can continue to enable the reranker, while future routing work can target the query slices where the evidence shows the largest lexical benefit.