MmrOptions: {
    mmr_lambda?: number | null;
    use_mmr: boolean;
}

MMR Options lets you specify different methods to rerank the chunks in the result set using Maximal Marginal Relevance. If not specified, this defaults to the score of the chunks.

Type declaration

  • Optionalmmr_lambda?: number | null

    Set mmr_lambda to a value between 0.0 and 1.0 to control the tradeoff between relevance and diversity. Closer to 1.0 will give more diverse results, closer to 0.0 will give more relevant results. If not specified, this defaults to 0.5.

  • use_mmr: boolean

    Set use_mmr to true to use the Maximal Marginal Relevance algorithm to rerank the results.