Skip to content

Add MUVERA processors for multi-vector search#3164

Open
praveenMprasad wants to merge 6 commits intoopensearch-project:mainfrom
praveenMprasad:feature/muvera-processors
Open

Add MUVERA processors for multi-vector search#3164
praveenMprasad wants to merge 6 commits intoopensearch-project:mainfrom
praveenMprasad:feature/muvera-processors

Conversation

@praveenMprasad
Copy link

Description

Add MUVERA (Multi-Vector Retrieval via Fixed Dimensional Encodings) ingest and search request processors to enable ANN prefetch for multi-vector models like ColBERT and ColPali.

The MUVERA algorithm converts variable-length multi-vector embeddings into a single fixed-dimensional encoding (FDE) vector using SimHash clustering and random projections. This enables approximate nearest neighbor search on multi-vector representations, which previously required brute-force scoring via lateInteractionScore.

Two new processors:

  • muvera ingest processor — reads multi-vectors from a source field, produces an FDE vector, writes it to a knn_vector target field. Original multi-vectors remain in _source for reranking.
  • muvera_query search request processor — intercepts script_score queries containing query_vectors in script params, MUVERA-encodes them, and replaces the inner match_all with a knn query on the FDE field. The lateInteractionScore script wrapper stays intact for MaxSim reranking.

Key design decisions:

  • All hyperparameters have sensible defaults (k_sim=4, dim_proj=8, r_reps=20, seed=42)
  • FDE dimension is computed and logged at pipeline creation time
  • Optional fde_dimension parameter validates against computed value
  • Tested end-to-end on a live cluster with correct MaxSim reranking scores

Reference: MUVERA paper, fastembed implementation

Related Issues

Resolves #3163

Check List

  • New functionality includes testing.
    • 34 unit tests across 3 test classes, stable across 10 iterations with random seeds
  • New functionality has been documented.
    • Documentation PR to follow after initial review
  • API changes companion pull request created.
    • No REST API changes — processors are configured via existing ingest/search pipeline APIs
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.
    • Will create after initial review

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Introduces MUVERA (Multi-Vector Retrieval via Fixed Dimensional
Encodings) as ingest and search request processors in the k-NN
plugin. Documents are encoded into fixed-size FDE vectors at
ingest time for ANN prefetch, while the original multi-vectors
are preserved for MaxSim reranking via lateInteractionScore.

Resolves opensearch-project#3163

Signed-off-by: Praveen Mohan Prasad <prasadnu@amazon.com>
Signed-off-by: Navneet Verma <navneev@amazon.com>
@navneet1v
Copy link
Collaborator

@praveenMprasad please add the IT for this new Processor.

@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

❌ Patch coverage is 86.45418% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.59%. Comparing base (5419381) to head (eb2b695).

Files with missing lines Patch % Lines
...processor/muvera/MuveraSearchRequestProcessor.java 78.94% 8 Missing and 12 partials ⚠️
...ch/knn/processor/muvera/MuveraIngestProcessor.java 83.78% 7 Missing and 5 partials ⚠️
...opensearch/knn/processor/muvera/MuveraEncoder.java 97.50% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3164      +/-   ##
============================================
+ Coverage     82.52%   82.59%   +0.06%     
- Complexity     3935     4001      +66     
============================================
  Files           426      429       +3     
  Lines         14646    14897     +251     
  Branches       1869     1935      +66     
============================================
+ Hits          12087    12304     +217     
- Misses         1796     1811      +15     
- Partials        763      782      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add MuveraProcessorIT with 7 REST-based integration tests
covering the end-to-end MUVERA ingest and search pipeline
flow. Tests verify pipeline creation, document indexing with
FDE encoding, ANN prefetch via search pipeline, passthrough
for non-script_score queries, and error handling for
dimension mismatches and invalid fde_dimension config.

Signed-off-by: Praveen M Prasad <prasadnu@amazon.com>
Signed-off-by: Praveen Mohan Prasad <prasadnu@amazon.com>
@praveenMprasad
Copy link
Author

@praveenMprasad please add the IT for this new Processor.

@navneet1v Added MuveraProcessorIT with 7 integration tests covering the end-to-end flow - ingest pipeline creation, FDE encoding on indexed documents, search pipeline with ANN prefetch via muvera_query, passthrough for non-script_score queries, and error handling for dimension mismatches and invalid fde_dimension config. Please take a look.

@navneet1v
Copy link
Collaborator

Thank you @praveenMprasad . Will start reviewing the PR. I would need some to review it, since I had to first understand what MUVERA is.

@navneet1v
Copy link
Collaborator

navneet1v commented Mar 17, 2026

@praveenMprasad before we can kickoff the review lets ensure that all CIs are passing.

cc: @Gankris96 and @kotwanikunal

navneet1v and others added 2 commits March 16, 2026 20:42
The deleteIndex(String) method in MuveraProcessorIT conflicted
with the static deleteIndex(String) in OpenSearchRestTestCase.
Renamed to deleteTestIndex to avoid the override error.
Also applied spotless formatting.

Signed-off-by: Praveen Mohan Prasad <prasadnu@amazon.com>
@praveenMprasad
Copy link
Author

@navneet1v I've fixed the compilation issue. The CI workflows need maintainer approval to run, could you please approve them ?

Use Processor import instead of full package path in
KNNPlugin.getProcessors(). Use ArrayList import instead
of inline java.util.ArrayList in MuveraIngestProcessor.

Signed-off-by: Praveen Mohan Prasad <prasadnu@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add MUVERA ingest and search processors for multi-vector ANN prefetch

4 participants