langchain_community.vectorstores.vectara.MMRConfig¶

class langchain_community.vectorstores.vectara.MMRConfig(is_enabled: bool = False, mmr_k: int = 50, diversity_bias: float = 0.3)[source]¶

Configuration for Maximal Marginal Relevance (MMR) search.

is_enabled: True if MMR is enabled, False otherwise mmr_k: number of results to fetch for MMR, defaults to 50 diversity_bias: number between 0 and 1 that determines the degree

of diversity among the results with 0 corresponding to minimum diversity and 1 to maximum diversity. Defaults to 0.3. Note: diversity_bias is equivalent 1-lambda_mult where lambda_mult is the value often used in max_marginal_relevance_search() We chose to use that since we believe it’s more intuitive to the user.

Attributes

diversity_bias

is_enabled

mmr_k

Methods

__init__([is_enabled, mmr_k, diversity_bias])

Parameters
  • is_enabled (bool) –

  • mmr_k (int) –

  • diversity_bias (float) –

__init__(is_enabled: bool = False, mmr_k: int = 50, diversity_bias: float = 0.3) None¶
Parameters
  • is_enabled (bool) –

  • mmr_k (int) –

  • diversity_bias (float) –

Return type

None