with in-memory or local datasets.
”tensor_db” - Performant, fully-hosted Managed Tensor Database.Responsible for storage and query execution. Only available for
data stored in the Deep Lake Managed Database. To store datasets
in this database, specify runtime = {“db_engine”: True}
during dataset creation.
**kwargs – Additional keyword arguments.
Returns
List[Documents] - A list of documents.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
Examples
>>> # Search using an embedding
>>> data = vector_store.similarity_search(
...     query=<your_query>,
...     k=<num_items>,
...     exec_option=<preferred_exec_option>,
... )
>>> # Run tql search:
>>> data = vector_store.similarity_search(
...     query=None,
...     tql="SELECT * WHERE id == <id>",
...     exec_option="compute_engine",
... )
Parameters
k (int) – Number of Documents to return. Defaults to 4.
query (str) – Text to look up similar documents.
**kwargs – Additional keyword arguments include:
embedding (Callable): Embedding function to use. Defaults to None.
distance_metric (str): ‘L2’ for Euclidean, ‘L1’ for Nuclear, ‘max’
for L-infinity, ‘cos’ for cosine, ‘dot’ for dot product.
Defaults to ‘L2’.
filter (Union[Dict, Callable], optional): Additional filterbefore embedding search.
- Dict: Key-value search on tensors of htype json,