Principle:Langchain ai Langchain Maximal Marginal Relevance
| Knowledge Sources | |
|---|---|
| Domains | Information_Retrieval, Vector_Search |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
A retrieval strategy that balances relevance to the query with diversity among selected documents to reduce redundancy in results.
Description
Standard similarity search may return highly similar documents that cover the same information. Maximal Marginal Relevance (MMR) addresses this by iteratively selecting documents that are both relevant to the query and dissimilar to already-selected documents. The lambda_mult parameter controls the tradeoff: values near 1.0 favor relevance, values near 0.0 favor diversity.
Usage
Use MMR search when result diversity matters, such as when providing context to an LLM where redundant information wastes context window tokens.
Theoretical Basis
Where R is the candidate set, S is the selected set, q is the query, and controls the relevance-diversity tradeoff.