for data stored in the Deep Lake Managed Database. To store
datasets in this database, specify
runtime = {“db_engine”: True} during dataset creation.
deep_memory (bool) – Whether to use the Deep Memory model for improving
search results. Defaults to False if deep_memory is not specified
in the Vector Store initialization. If True, the distance metric
is set to “deepmemory_distance”, which represents the metric with
which the model was trained. The search is performed using the Deep
Memory model. If False, the distance metric is set to “COS” or
whatever distance metric user specifies.
**kwargs – Additional keyword arguments
Returns
List of Documents selected by maximal marginal relevance.
Raises
ValueError – when MRR search is on but embedding function is
    not specified.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, exec_option: Optional[str] = None, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance. Maximal marginal
relevance optimizes for similarity to query AND diversity among selected docs.
Examples:
>>> data = vector_store.max_marginal_relevance_search_by_vector(
…        embedding=<your_embedding>,
…        fetch_k=<elements_to_fetch_before_mmr_search>,
…        k=<number_of_items_to_return>,
…        exec_option=<preferred_exec_option>,
… )
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch for MMR algorithm.
lambda_mult – Number between 0 and 1 determining the degree of diversity.