WARNING: not recommended for big datasets.
’compute_engine’: C++ implementation of the Compute Engine forthe client. Not for in-memory or local datasets.
’tensor_db’: Managed Tensor Database for storage and query.Only for data in Deep Lake Managed Database.
Use runtime = {“db_engine”: True} during dataset creation.
deep_memory (bool): Whether to use the Deep Memory model for improvingsearch 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.
Returns
List of Documents most similar to the query vector.
Return type
List[Document]
similarity_search_by_vector(embedding: Union[List[float], ndarray], k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to embedding vector.
Examples
>>> # Search using an embedding
>>> data = vector_store.similarity_search_by_vector(
...    embedding=<your_embedding>,
...    k=<num_items_to_return>,
...    exec_option=<preferred_exec_option>,
... )
Parameters
embedding (Union[List[float], np.ndarray]) – Embedding to find similar docs.
k (int) – Number of Documents to return. Defaults to 4.
**kwargs – Additional keyword arguments including:
filter (Union[Dict, Callable], optional):
Additional filter before embedding search.
- Dict - Key-value search on tensors of htype json. True
if all key-value filters are satisfied.
Dict = {“tensor_name_1”: {“key”: value},
”tensor_name_2”: {“key”: value}}