Stage Category: SORT (Reorders with diversity)Transformation: N documents → top_k documents (diverse selection)
When to Use
When NOT to Use
Parameters
Lambda Parameter
Thelambda parameter controls the relevance-diversity trade-off:
Configuration Examples
How MMR Works
The MMR algorithm iteratively selects documents using:- First Selection: Choose the most relevant document
- Subsequent Selections: Balance relevance against similarity to already-selected documents
- Repeat: Until top_k documents are selected
Example Selection Process
Output Schema
Performance
Common Pipeline Patterns
Search + MMR
Search + Filter + MMR + Enrich
Diverse RAG Pipeline
MMR vs Rerank
Tuning Lambda
Error Handling
Related
- Rerank - Pure relevance re-scoring
- Sort Relevance - Simple score sorting
- Sample - Random diversity

