Toggle Menu
Prev Up Next

# `langchain_chroma.vectorstores`.maximal_marginal_relevance

langchain_chroma.vectorstores.maximal_marginal_relevance(query_embedding: ndarray, embedding_list: list, lambda_mult: float = 0.5, k: int = 4) → List[int]

  Calculate maximal marginal relevance.

  Parameters

    - query_embedding (ndarray) –

    - embedding_list (list) –

    - lambda_mult (float) –

    - k (int) –

  Return type

    List[int]