id stringlengths 14 15 | text stringlengths 13 2.7k | source stringlengths 60 181 |
|---|---|---|
f06f4a082e8a-1 | amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
Return VectorStoreRetriever initialized from this VectorStore.
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dashvector.DashVector.html |
f06f4a082e8a-2 | Initialize with DashVector collection.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dashvector.DashVector.html |
f06f4a082e8a-3 | **kwargs – Other keyword arguments that subclasses might use.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documen... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dashvector.DashVector.html |
f06f4a082e8a-4 | fetch_k: Amount of documents to pass to MMR algorithm (Default: 20)
lambda_mult: Diversity of results returned by MMR;
1 for minimum diversity and 0 for maximum. (Default: 0.5)
filter: Filter by document metadata
Returns
Retriever class for VectorStore.
Return type
VectorStoreRetriever
Examples:
# Retrieve more documen... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dashvector.DashVector.html |
f06f4a082e8a-5 | Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and r... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dashvector.DashVector.html |
f06f4a082e8a-6 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, dashvector_api_key: Optional[str] = None, dashvector_endpoint: Optional[str] = None, collection_name: str = 'langchain', text_field: str = 'text', batch_s... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dashvector.DashVector.html |
f06f4a082e8a-7 | filter – Doc fields filter conditions that meet the SQL where clause
specification.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, filter: Optional[dict] = None, **kwargs: Any) → L... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dashvector.DashVector.html |
f06f4a082e8a-8 | specification.
Returns
List of Documents most similar to the query text.
similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[str] = None, **kwargs: Any) → List[Document][source]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dashvector.DashVector.html |
79a2686b4261-0 | langchain_community.vectorstores.marqo.Marqo¶
class langchain_community.vectorstores.marqo.Marqo(client: marqo.Client, index_name: str, add_documents_settings: Optional[Dict[str, Any]] = None, searchable_attributes: Optional[List[str]] = None, page_content_builder: Optional[Callable[[Dict[str, Any]], str]] = None)[sour... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-1 | add_texts(texts[, metadatas])
Upload texts with metadata (properties) to Marqo.
adelete([ids])
Delete by vector ID or other criteria.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized fr... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-2 | Return Marqo initialized from texts.
get_indexes()
Helper to see your available indexes in marqo, useful if the from_texts method was used without an index name specified
get_number_of_documents()
Helper to see the number of documents in the index
marqo_bulk_similarity_search(queries[, k])
Return documents from Marqo u... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-3 | Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶
Run... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-4 | Delete by vector ID or other criteria.
Parameters
ids – List of ids to delete.
**kwargs – Other keyword arguments that subclasses might use.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
async classmethod afrom_documents(documents: List[Document], embedding... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-5 | score_threshold: Minimum relevance threshold
for similarity_score_threshold
fetch_k: Amount of documents to pass to MMR algorithm (Default: 20)
lambda_mult: Diversity of results returned by MMR;
1 for minimum diversity and 0 for maximum. (Default: 0.5)
filter: Filter by document metadata
Returns
Retriever class for Vec... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-6 | Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and r... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-7 | Returns
A list of results for each query.
Return type
List[List[Document]]
bulk_similarity_search_with_score(queries: Iterable[Union[str, Dict[str, float]]], k: int = 4, **kwargs: Any) → List[List[Tuple[Document, float]]][source]¶
Return documents from Marqo that are similar to the query as well as
their scores using a... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-8 | Returns
A Marqo vectorstore
Return type
VectorStore
classmethod from_texts(texts: List[str], embedding: Any = None, metadatas: Optional[List[dict]] = None, index_name: str = '', url: str = 'http://localhost:8882', api_key: str = '', add_documents_settings: Optional[Dict[str, Any]] = None, searchable_attributes: Optiona... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-9 | None. (accompany the texts. Defaults to) –
url (str, optional) – The URL for Marqo. Defaults to “http://localhost:8882”.
api_key (str, optional) – The API key for Marqo. Defaults to “”.
metadatas (Optional[List[dict]], optional) – A list of metadatas, to
None. –
Can (this is only used when a new index is being create... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-10 | Returns
The number of documents
Return type
int
marqo_bulk_similarity_search(queries: Iterable[Union[str, Dict[str, float]]], k: int = 4) → Dict[str, List[Dict[str, List[Dict[str, str]]]]][source]¶
Return documents from Marqo using a bulk search, exposes Marqo’s
output directly
Parameters
queries (Iterable[Union[str, D... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-11 | lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int =... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79a2686b4261-12 | Returns
k documents ordered from best to worst match.
Return type
List[Document]
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to ret... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.marqo.Marqo.html |
79d6bd2e4ee5-0 | langchain_community.vectorstores.neo4j_vector.SearchType¶
class langchain_community.vectorstores.neo4j_vector.SearchType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enumerator of the Distance strategies.
VECTOR = 'vector'¶
HYBRID = 'hybrid'¶ | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.neo4j_vector.SearchType.html |
9322cb431936-0 | langchain_community.vectorstores.zilliz.Zilliz¶
class langchain_community.vectorstores.zilliz.Zilliz(embedding_function: Embeddings, collection_name: str = 'LangChainCollection', connection_args: Optional[dict[str, Any]] = None, consistency_level: str = 'Session', index_params: Optional[dict] = None, search_params: Opt... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-1 | here are a few of the options:
address (str): The actual address of Zillizinstance. Example address: “localhost:19530”
uri (str): The uri of Zilliz instance. Example uri:“https://in03-ba4234asae.api.gcp-us-west1.zillizcloud.com”,
host (str): The host of Zilliz instance. Default at “localhost”,PyMilvus will fill in the ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-2 | # Connect to a Zilliz instance
milvus_store = Milvus(
embedding_function = embedding,
collection_name = “LangChainCollection”,
connection_args = {
“uri”: “https://in03-ba4234asae.api.gcp-us-west1.zillizcloud.com”,
“user”: “temp”,
“password”: “temp”,
“token”: “temp”, # API key as replacements for user and password
“secu... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-3 | Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
Return VectorStoreRetriever initialized from this VectorStore.
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilar... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-4 | similarity_search_with_score(query[, k, ...])
Perform a search on a query string and return results with score.
similarity_search_with_score_by_vector(embedding)
Perform a search on a query string and return results with score.
__init__(embedding_function: Embeddings, collection_name: str = 'LangChainCollection', conne... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-5 | Insert text data into Milvus.
Inserting data when the collection has not be made yet will result
in creating a new Collection. The data of the first entity decides
the schema of the new collection, the dim is extracted from the first
embedding and the columns are decided by the first metadata dict.
Metada keys will nee... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-6 | Return VectorStore initialized from texts and embeddings.
async amax_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[f... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-7 | )
# Fetch more documents for the MMR algorithm to consider
# But only return the top 5
docsearch.as_retriever(
search_type="mmr",
search_kwargs={'k': 5, 'fetch_k': 50}
)
# Only retrieve documents that have a relevance score
# Above a certain threshold
docsearch.as_retriever(
search_type="similarity_score_th... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-8 | **kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, floa... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-9 | “LangChainCollection”.
connection_args (dict[str, Any], optional) – Connection args to use. Defaults
to DEFAULT_MILVUS_CONNECTION.
consistency_level (str, optional) – Which consistency level to use. Defaults
to “Session”.
index_params (Optional[dict], optional) – Which index_params to use.
Defaults to None.
search_para... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-10 | kwargs – Collection.search() keyword arguments.
Returns
Document results for search.
Return type
List[Document]
max_marginal_relevance_search_by_vector(embedding: list[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-11 | Perform a similarity search against the query string.
Parameters
query (str) – The text to search.
k (int, optional) – How many results to return. Defaults to 4.
param (dict, optional) – The search params for the index type.
Defaults to None.
expr (str, optional) – Filtering expression. Defaults to None.
timeout (int, ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-12 | query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_wit... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
9322cb431936-13 | For more information about the search parameters, take a look at the pymilvus
documentation found here:
https://milvus.io/api-reference/pymilvus/v2.2.6/Collection/search().md
Parameters
embedding (List[float]) – The embedding vector being searched.
k (int, optional) – The amount of results to return. Defaults to 4.
par... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zilliz.Zilliz.html |
c824fe95c649-0 | langchain_community.vectorstores.deeplake.DeepLake¶
class langchain_community.vectorstores.deeplake.DeepLake(dataset_path: str = './deeplake/', token: Optional[str] = None, embedding: Optional[Embeddings] = None, embedding_function: Optional[Embeddings] = None, read_only: bool = False, ingestion_batch_size: int = 1000,... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-1 | ... path = <path_for_storing_Data>,
... )
>>>
>>> # Create a vector store in the Deep Lake Managed Tensor Database
>>> data = DeepLake(
... path = "hub://org_id/dataset_name",
... runtime = {"tensor_db": True},
... )
Parameters
dataset_path (str) – Path to existing dataset or where to create
a new ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-2 | issues. Data can be stored anywhere.
compute_engine - C++ implementation of the Deep Lake ComputeEngine that runs on the client. Can be used for any data stored in
or connected to Deep Lake. Not for in-memory or local datasets.
tensor_db - Hosted Managed Tensor Database that isresponsible for storage and query executio... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-3 | Raises
ValueError – If some condition is not met.
Attributes
embeddings
Access the query embedding object if available.
Methods
__init__([dataset_path, token, embedding, ...])
Creates an empty DeepLakeVectorStore or loads an existing one.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-4 | Return docs and relevance scores in the range [0, 1], asynchronously.
asimilarity_search_with_score(*args, **kwargs)
Run similarity search with distance asynchronously.
delete([ids])
Delete the entities in the dataset.
delete_dataset()
Delete the collection.
ds()
force_delete_by_path(path)
Force delete dataset by path.... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-5 | Run similarity search with Deep Lake with distance returned.
__init__(dataset_path: str = './deeplake/', token: Optional[str] = None, embedding: Optional[Embeddings] = None, embedding_function: Optional[Embeddings] = None, read_only: bool = False, ingestion_batch_size: int = 1000, num_workers: int = 0, verbose: bool = ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-6 | read_only (bool) – Open dataset in read-only mode. Default is False.
ingestion_batch_size (int) – During data ingestion, data is divided
into batches. Batch size is the size of each batch.
Default is 1000.
num_workers (int) – Number of workers to use during data ingestion.
Default is 0.
verbose (bool) – Print dataset s... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-7 | deeplake.constants. The specified key-values override the default
ones.
- threshold: The threshold for the dataset size above which an index
will be created for the embedding tensor. When the threshold value
is set to -1, index creation is turned off. Defaults to -1, which
turns off the index.
distance_metric: This key... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-8 | Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶
Run more texts through the embeddings and add to the vectorstore.
Examples
>>> ids = deeplake_vectorstore.add_texts(
... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-9 | Return VectorStore initialized from texts and embeddings.
async amax_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[f... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-10 | )
# Fetch more documents for the MMR algorithm to consider
# But only return the top 5
docsearch.as_retriever(
search_type="mmr",
search_kwargs={'k': 5, 'fetch_k': 50}
)
# Only retrieve documents that have a relevance score
# Above a certain threshold
docsearch.as_retriever(
search_type="similarity_score_th... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-11 | **kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, floa... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-12 | Create a Deep Lake dataset from a raw documents.
If a dataset_path is specified, the dataset will be persisted in that location,
otherwise by default at ./deeplake
Examples:
>>> # Search using an embedding
>>> vector_store = DeepLake.from_texts(
… texts = <the_texts_that_you_want_to_embed>,
… embedding_fu... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-13 | Returns
Deep Lake dataset.
Return type
DeepLake
max_marginal_relevance_search(query: str, 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 maximal marginal relevance.
Maximal marginal relevance optimizes for s... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-14 | 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 initializati... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-15 | 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 impl... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-16 | 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>,
... ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-17 | 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.
dee... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-18 | ”tensor_name_2”: {“key”: value}}
Function - Any function compatible withdeeplake.filter.
Defaults to None.
exec_option (str): Options for search execution include”python”, “compute_engine”, or “tensor_db”. Defaults to
“python”.
- “python” - Pure-python implementation running on the client.
Can be used for data stored a... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-19 | Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the re... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
c824fe95c649-20 | 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.
”tensor_db” - Performant, full... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.deeplake.DeepLake.html |
58776f551423-0 | langchain_community.vectorstores.usearch.dependable_usearch_import¶
langchain_community.vectorstores.usearch.dependable_usearch_import() → Any[source]¶
Import usearch if available, otherwise raise error. | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.usearch.dependable_usearch_import.html |
919637718ffd-0 | langchain_community.vectorstores.pgvecto_rs.PGVecto_rs¶
class langchain_community.vectorstores.pgvecto_rs.PGVecto_rs(embedding: Embeddings, dimension: int, db_url: str, collection_name: str, new_table: bool = False)[source]¶
Attributes
embeddings
Access the query embedding object if available.
Methods
__init__(embeddin... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvecto_rs.PGVecto_rs.html |
919637718ffd-1 | Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1], asynchronously.
asimilarity_search_with_score(*args, **kwargs)
Run similarity search with distance asynchronously.
delete([ids])
Delete by vector ID or other criteria.
from... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvecto_rs.PGVecto_rs.html |
919637718ffd-2 | Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶
Run... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvecto_rs.PGVecto_rs.html |
919637718ffd-3 | Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
Return VectorStore initialized from texts and embeddings.
async amax_marginal_relevance_search(query: str, k: int = 4, fetch_... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvecto_rs.PGVecto_rs.html |
919637718ffd-4 | Return type
VectorStoreRetriever
Examples:
# Retrieve more documents with higher diversity
# Useful if your dataset has many similar documents
docsearch.as_retriever(
search_type="mmr",
search_kwargs={'k': 6, 'lambda_mult': 0.25}
)
# Fetch more documents for the MMR algorithm to consider
# But only return the t... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvecto_rs.PGVecto_rs.html |
919637718ffd-5 | Return docs and relevance scores in the range [0, 1], asynchronously.
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvecto_rs.PGVecto_rs.html |
919637718ffd-6 | Return VectorStore initialized from documents.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, db_url: str = '', collection_name: str = 'd97b0e0c5c0643f5ae185678c4fa2497', **kwargs: Any) → PGVecto_rs[source]¶
Return VectorStore initialized from texts and optional ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvecto_rs.PGVecto_rs.html |
919637718ffd-7 | fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
search(... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvecto_rs.PGVecto_rs.html |
919637718ffd-8 | filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, distance_func: Literal['sqrt_euclid', 'neg_dot_prod', 'ned_cos'] = 'sqrt_euclid', **kwargs: Any) → List[Tuple[Document, float]][source]¶
Run similarity search with distance.
... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvecto_rs.PGVecto_rs.html |
b2dad4e31739-0 | langchain_community.vectorstores.pgvector.DistanceStrategy¶
class langchain_community.vectorstores.pgvector.DistanceStrategy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enumerator of the Distance strategies.
EUCLIDEAN = 'l2'¶
COSINE = 'cosine'¶
MAX_INNER_PRODUCT = 'inne... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.DistanceStrategy.html |
593e8f1f3cd2-0 | langchain_community.vectorstores.redis.filters.RedisTag¶
class langchain_community.vectorstores.redis.filters.RedisTag(field: str)[source]¶
A RedisFilterField representing a tag in a Redis index.
Create a RedisTag FilterField.
Parameters
field (str) – The name of the RedisTag field in the index to be queried
against.
A... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.filters.RedisTag.html |
de3b45750900-0 | langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch¶
class langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch(index_name: str, embedding: Embeddings, es_connection: Optional['Elasticsearch'] = None, es_cloud_id: Optional[str] = None, es_user: Optional[str] = None, es_password: O... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-1 | that contains the original text data.
Type
str, optional
Usage:>>> from embeddings import Embeddings
>>> embedding = Embeddings.load('glove')
>>> es_search = ElasticKnnSearch('my_index', embedding)
>>> es_search.add_texts(['Hello world!', 'Another text'])
>>> results = es_search.knn_search('Hello')
[(Document(page_cont... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-2 | Type
str, optional
Usage:>>> from embeddings import Embeddings
>>> embedding = Embeddings.load('glove')
>>> es_search = ElasticKnnSearch('my_index', embedding)
>>> es_search.add_texts(['Hello world!', 'Another text'])
>>> results = es_search.knn_search('Hello')
[(Document(page_content='Hello world!', metadata={}), 0.9)... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-3 | Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1]... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-4 | similarity_search_with_score(query[, k])
Pass through to knn_search including score
__init__(index_name: str, embedding: Embeddings, es_connection: Optional['Elasticsearch'] = None, es_cloud_id: Optional[str] = None, es_user: Optional[str] = None, es_password: Optional[str] = None, vector_query_field: Optional[str] = '... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-5 | to associate with the texts.
model_id (str, optional) – The ID of the model to use for transforming the
texts into vectors.
refresh_indices (bool, optional) – Whether to refresh the Elasticsearch
indices after adding the texts.
**kwargs – Arbitrary keyword arguments.
Returns
A list of IDs for the added texts.
async ade... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-6 | Return VectorStoreRetriever initialized from this VectorStore.
Parameters
search_type (Optional[str]) – Defines the type of search that
the Retriever should perform.
Can be “similarity” (default), “mmr”, or
“similarity_score_threshold”.
search_kwargs (Optional[Dict]) – Keyword arguments to pass to the
search function. ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-7 | docsearch.as_retriever(
search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}}
)
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
R... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-8 | Delete by vector ID or other criteria.
Parameters
ids – List of ids to delete.
**kwargs – Other keyword arguments that subclasses might use.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embed... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-9 | Perform a hybrid k-NN and text search on the Elasticsearch index.
Parameters
query (str, optional) – The query text to search for.
k (int, optional) – The number of nearest neighbors to return.
query_vector (List[float], optional) – The query vector to search for.
model_id (str, optional) – The ID of the model to use f... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-10 | query_vector (List[float], optional) – The query vector to search for.
model_id (str, optional) – The ID of the model to use for transforming the
query text into a vector.
size (int, optional) – The number of search results to return.
source (bool, optional) – Whether to return the source of the search results.
fields ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-11 | Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
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 to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 t... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
de3b45750900-12 | filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 10, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Pass through to knn_search including score | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
fe5659207ac6-0 | langchain_community.vectorstores.scann.normalize¶
langchain_community.vectorstores.scann.normalize(x: ndarray) → ndarray[source]¶
Normalize vectors to unit length. | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.normalize.html |
4974033d24e4-0 | langchain_community.vectorstores.zep.CollectionConfig¶
class langchain_community.vectorstores.zep.CollectionConfig(name: str, description: Optional[str], metadata: Optional[Dict[str, Any]], embedding_dimensions: int, is_auto_embedded: bool)[source]¶
Configuration for a Zep Collection.
If the collection does not exist, ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.CollectionConfig.html |
2ac5d634b558-0 | langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch¶
class langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch(doc_index: BaseDocIndex, embedding: Embeddings)[source]¶
HnswLib storage using DocArray package.
To use it, you should have the docarray package with version >=0.32.0 installed.
You... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
2ac5d634b558-1 | asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs an... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
2ac5d634b558-2 | Initialize a vector store from DocArray’s DocIndex.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Retu... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
2ac5d634b558-3 | Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
Return VectorStore initialized from texts and embeddings.
async amax_marginal_relevance_search(query: str, k: int = 4, fetch_... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
2ac5d634b558-4 | Return type
VectorStoreRetriever
Examples:
# Retrieve more documents with higher diversity
# Useful if your dataset has many similar documents
docsearch.as_retriever(
search_type="mmr",
search_kwargs={'k': 6, 'lambda_mult': 0.25}
)
# Fetch more documents for the MMR algorithm to consider
# But only return the t... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
2ac5d634b558-5 | Return docs and relevance scores in the range [0, 1], asynchronously.
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
2ac5d634b558-6 | Parameters
embedding (Embeddings) – Embedding function.
work_dir (str) – path to the location where all the data will be stored.
n_dim (int) – dimension of an embedding.
dist_metric (str) – Distance metric for DocArrayHnswSearch can be one of:
“cosine”, “ip”, and “l2”. Defaults to “cosine”.
max_elements (int) – Maximum... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
2ac5d634b558-7 | work_dir (str) – path to the location where all the data will be stored.
n_dim (int) – dimension of an embedding.
**kwargs – Other keyword arguments to be passed to the __init__ method.
Returns
DocArrayHnswSearch Vector Store
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
2ac5d634b558-8 | to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
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... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
2ac5d634b558-9 | Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of documents most similar to the query text and
cosine distance in float for each.
Lower score represents more similarity.
Examples using DocArrayHnswSearch¶
DocArra... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.hnsw.DocArrayHnswSearch.html |
ea446493821a-0 | langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings¶
class langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings(endpoint: str, instance_id: str, username: str, password: str, table_name: str, field_name_mapping: Dict[str, str], protocol: str = 'http... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings.html |
ea446493821a-1 | namespace (str) : The instance data will be partitioned based on the “namespace”
field,If the namespace is enabled, you need to specify the namespace field
name during initialization, Otherwise, the queries cannot be executed
correctly.
embedding_field_separator(str): Delimiter specified for writing vectorfield data, d... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings.html |
92ceb8f88a34-0 | langchain_community.vectorstores.vectara.VectaraRetriever¶
class langchain_community.vectorstores.vectara.VectaraRetriever[source]¶
Bases: VectorStoreRetriever
Retriever class for Vectara.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.VectaraRetriever.html |
92ceb8f88a34-1 | param vectorstore: Vectara [Required]¶
Vectara vectorstore.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Add documents to vectorstore.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Opti... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.VectaraRetriever.html |
92ceb8f88a34-2 | and passed as arguments to the handlers defined in callbacks.
Parameters
metadata – Optional metadata associated with the retriever. Defaults to None
This metadata will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Returns
List of relevant documents
async ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.VectaraRetriever.html |
92ceb8f88a34-3 | step, and the final state of the run.
The jsonpatch ops can be applied in order to construct state.
Parameters
input – The input to the runnable.
config – The config to use for the runnable.
diff – Whether to yield diffs between each step, or the current state.
with_streamed_output_list – Whether to yield the streamed_... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.VectaraRetriever.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.