Skip to content

Add explain/debug MMR score feature for 3.3 version #3107

@rajanim

Description

@rajanim

Feature Request: Explainable MMR Score in k-NN

Summary:
For the Multi-Maximal Relevance (MMR) feature in version 3.3, add detailed explainability by including a debug payload for each hit.

Proposed Enhancement

  • Introduce a debug field (e.g., mmr_debug) per result hit.
  • The debug payload should include:
    • original_score: The initial similarity score for the hit.
    • computed mmr_score: The recalculated score after applying MMR.
    • max_similarity_to_selected: The maximum similarity to any already selected hit.

This improvement will make debugging, understanding, and tuning MMR much easier for developers and users by exposing inner calculations.

Version Target

  • OpenSearch k-NN 3.3

Example

{
  "mmr_debug": {
    "original_score": 0.85,
    "mmr_score": 0.61,
    "max_similarity_to_selected": 0.20
  }
}

Benefits

  • Improved transparency of MMR ranking
  • Easier debugging and tuning for search quality
  • Facilitates downstream analysis and validation

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions