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.
0 corresponds to max diversity and 1 to min diversity. Defaults to 0.5.
exec_option (str) – DeepLakeVectorStore supports 3 ways for searching.
Could be “python”, “compute_engine” or “tensor_db”. Defaults to
“python”.
- “python” - Pure-python implementation running on the client.
Can be used for data stored anywhere. WARNING: using this
option with big datasets is discouraged due to potential
memory issues.
”compute_engine” - Performant C++ implementation of the DeepLake Compute Engine. Runs on the client and can be used for
any data stored in or connected to Deep Lake. It cannot be used
with in-memory or local datasets.