Property MmrLambda
MmrLambda
Gets or sets the Maximal Marginal Relevance (MMR) lambda parameter that controls the balance between relevance and diversity in retrieval results.
public float MmrLambda { get; set; }
Property Value
- float
A value between
0and1. Default is1.0(disabled).
Examples
using var chat = new PdfChat(chatModel, embeddingModel);
// Enable MMR diversity filtering
chat.MmrLambda = 0.7f;
Remarks
When set to 1.0 (default), results are ranked purely by relevance.
Lower values progressively favor diversity, reducing near-duplicate passages.
A value of 0.7 provides a good balance for most use cases.
When active (less than 1.0), additional candidates are retrieved internally
to allow the diversity filter to select from a broader pool.