-
Notifications
You must be signed in to change notification settings - Fork 522
Improving vector search diversity through native MMR #3970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
b0d97ba
3ac8d57
7d12af9
de8f0dd
9fd609d
7123a9e
46d752f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,236 @@ | ||||||
| --- | ||||||
| layout: post | ||||||
| title: "Improving vector search diversity through native MMR" | ||||||
| layout: post | ||||||
| authors: | ||||||
| - bzhangam | ||||||
| date: 2025-10-24 | ||||||
| has_science_table: true | ||||||
| categories: | ||||||
| - technical-posts | ||||||
| meta_keywords: MMR, Maximal Marginal Relevance, search diversity, search ranking, OpenSearch 3.3, vector search | ||||||
| meta_description: Learn how to use Maximal Marginal Relevance (MMR) in OpenSearch to make your search results more diverse. | ||||||
| --- | ||||||
|
|
||||||
| ## Improving vector search diversity through native MMR | ||||||
|
|
||||||
| When it comes to search and recommendation systems, returning highly relevant results is only half the battle. An equally important component is diversity---ensuring that users see a range of results rather than multiple near-duplicates. OpenSearch 3.3 now supports native Maximal Marginal Relevance (MMR) for k-NN and neural queries that makes this easy. | ||||||
natebower marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ## What is MMR? | ||||||
|
|
||||||
| MMR is a reranking algorithm that balances relevance and diversity: | ||||||
|
|
||||||
| - **Relevance:** How well a result matches the query. | ||||||
natebower marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| - **Diversity:** How different the results are from each other. | ||||||
natebower marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| MMR iteratively selects results that are relevant to the query and not too similar to previously selected results. The trade-off is controlled by the `diversity` parameter (0 = prioritize relevance, 1 = prioritize diversity). | ||||||
|
|
||||||
| In vector search, this is particularly useful because embeddings often cluster similar results together. Without MMR, the top-k results might all look nearly identical. | ||||||
|
|
||||||
| ## Native MMR in OpenSearch | ||||||
|
|
||||||
| Previously, MMR could only be implemented externally, requiring custom pipelines and extra coding. Now, OpenSearch supports native MMR directly in k-NN and neural queries using `knn_vector`. This simplifies your setup and reduces latency. | ||||||
|
|
||||||
| ## How to Use MMR | ||||||
|
Check failure on line 35 in _posts/2025-10-24-Improving-vector-search-diversity-through-native-MMR.markdown
|
||||||
natebower marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
natebower marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| ### Pre-Requisites | ||||||
|
Check failure on line 37 in _posts/2025-10-24-Improving-vector-search-diversity-through-native-MMR.markdown
|
||||||
|
||||||
| ### Pre-Requisites | |
| ### Prerequisites |
kolchfa-aws marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
natebower marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Check failure on line 148 in _posts/2025-10-24-Improving-vector-search-diversity-through-native-MMR.markdown
GitHub Actions / style-job
[vale] reported by reviewdog 🐶
[OpenSearch.Inclusive] Use 'cluster manager' instead of 'Master' because the latter is an offensive term.
Raw Output:
{"message": "[OpenSearch.Inclusive] Use 'cluster manager' instead of 'Master' because the latter is an offensive term.", "location": {"path": "_posts/2025-10-24-Improving-vector-search-diversity-through-native-MMR.markdown", "range": {"start": {"line": 148, "column": 3}}}, "severity": "ERROR"}
Uh oh!
There was an error while loading. Please reload this page.