id
stringlengths
14
16
text
stringlengths
13
2.7k
source
stringlengths
57
178
47575929e1fa-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. max_mar...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
47575929e1fa-8
NOTE – Please do not let end-user to fill this and always be aware of SQL injection. When dealing with metadatas, remember to use {self.metadata_column}.attribute instead of attribute alone. The default name for it is metadata. Returns List of Documents Return type List[Document] similarity_search_by_vector(embedding: ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
47575929e1fa-9
alone. The default name for it is metadata. Returns List of documents Return type List[Document] similarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶ Run similarity search with distance. Examples using StarRocks¶ StarRocks
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
fbdb098de978-0
langchain.vectorstores.chroma.Chroma¶ class langchain.vectorstores.chroma.Chroma(collection_name: str = 'langchain', embedding_function: Optional[Embeddings] = None, persist_directory: Optional[str] = None, client_settings: Optional[chromadb.config.Settings] = None, collection_metadata: Optional[Dict] = None, client: O...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-1
afrom_texts(texts, embedding[, metadatas]) Return VectorStore initialized from texts and embeddings. amax_marginal_relevance_search(query[, k, ...]) Return docs selected using the maximal marginal relevance. amax_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. as_retr...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-2
Return docs most similar to query using specified search type. similarity_search(query[, k, filter]) Run similarity search with Chroma. similarity_search_by_vector(embedding[, k, ...]) Return docs most similar to embedding vector. similarity_search_by_vector_with_relevance_scores(...) Return docs most similar to embedd...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-3
add_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[str] add_images(uris: List[str], metadatas: Op...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-4
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 documents and embeddings. async classmethod afrom_texts(texts: List[s...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-5
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 documents with higher diversity # Useful if your dataset has many similar d...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-6
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 relevance scores in the range [0, 1], asynchronously. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Docume...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-7
Otherwise, the data will be ephemeral in-memory. Parameters collection_name (str) – Name of the collection to create. persist_directory (Optional[str]) – Directory to persist the collection. ids (Optional[List[str]]) – List of document IDs. Defaults to None. documents (List[Document]) – List of documents to add to the ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-8
ids (Optional[List[str]]) – List of document IDs. Defaults to None. client_settings (Optional[chromadb.config.Settings]) – Chroma client settings collection_metadata (Optional[Dict]) – Collection configurations. Defaults to None. Returns Chroma vectorstore. Return type Chroma get(ids: Optional[OneOrMany[ID]] = None, wh...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-9
Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. Parameters query – Text 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 that deter...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-10
Persist the collection. This can be used to explicitly persist the data to disk. It will also be called automatically when the object is destroyed. 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 = ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-11
Return docs most similar to embedding vector and similarity score. Parameters embedding (List[float]) – Embedding to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None. Returns List of documents most similar to t...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
fbdb098de978-12
Lower score represents more similarity. Return type List[Tuple[Document, float]] update_document(document_id: str, document: Document) → None[source]¶ Update a document in the collection. Parameters document_id (str) – ID of the document to update. document (Document) – Document to update. update_documents(ids: List[st...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.chroma.Chroma.html
ca7b0729d867-0
langchain.vectorstores.scann.dependable_scann_import¶ langchain.vectorstores.scann.dependable_scann_import() → Any[source]¶ Import scann if available, otherwise raise error.
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.dependable_scann_import.html
a96a98c92f98-0
langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch¶ class langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch(collection: Collection[CosmosDBDocumentType], embedding: Embeddings, *, index_name: str = 'vectorSearchIndex', text_key: str = 'textContent', embedding_key: str = 'vectorContent')[sou...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-1
add_documents(documents, **kwargs) Run more documents through the embeddings and add to the vectorstore. add_texts(texts[, metadatas]) Run more texts through the embeddings and add to the vectorstore. adelete([ids]) Delete by vector ID or other criteria. afrom_documents(documents, embedding, **kwargs) Return VectorStor...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-2
Creates an Instance of AzureCosmosDBVectorSearch from a Connection String from_documents(documents, embedding, **kwargs) Return VectorStore initialized from documents and embeddings. from_texts(texts, embedding[, metadatas, ...]) Return VectorStore initialized from texts and embeddings. get_index_name() Returns the ind...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-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...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-4
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_...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-5
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...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-6
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 ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-7
the search speed and latency will be slow. After your initial setup, you should go ahead and tune the numLists parameter using the above guidance. Parameters num_lists – This integer is the number of clusters that the inverted file (IVF) index uses to group the vector data. We recommend that numLists is set to document...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-8
Creates an Instance of AzureCosmosDBVectorSearch from a Connection String Parameters connection_string – The MongoDB vCore instance connection string namespace – The namespace (database.collection) embedding – The embedding utility **kwargs – Dynamic keyword arguments Returns an instance of the vector store classmethod...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-9
Defaults to 0.5. 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, **kwargs: Any) → List[Document][source]¶ Return docs selected using the maximal marginal relevance. Maximal marginal...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
a96a98c92f98-10
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...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
0c52a28c8bf8-0
langchain.vectorstores.clickhouse.Clickhouse¶ class langchain.vectorstores.clickhouse.Clickhouse(embedding: Embeddings, config: Optional[ClickhouseSettings] = None, **kwargs: Any)[source]¶ ClickHouse VectorSearch vector store. You need a clickhouse-connect python package, and a valid account to connect to ClickHouse. C...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
0c52a28c8bf8-1
amax_marginal_relevance_search(query[, k, ...]) Return docs selected using the maximal marginal relevance. 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_...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
0c52a28c8bf8-2
similarity_search_with_relevance_scores(query) Perform a similarity search with ClickHouse similarity_search_with_score(*args, **kwargs) Run similarity search with distance. __init__(embedding: Embeddings, config: Optional[ClickhouseSettings] = None, **kwargs: Any) → None[source]¶ ClickHouse Wrapper to LangChain embedd...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
0c52a28c8bf8-3
ids – Optional list of ids to associate with the texts. batch_size – Batch size of insertion metadata – Optional column data to be inserted Returns List of ids from adding the texts into the VectorStore. async adelete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool]¶ Delete by vector ID or other criteri...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
0c52a28c8bf8-4
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. Can include things like: k: Amount of documents to return (Default: 4) score_threshold: Minimum relevance threshold for similarity_score...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
0c52a28c8bf8-5
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]¶ Return docs most similar to q...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
0c52a28c8bf8-6
Return type Optional[bool] drop() → None[source]¶ Helper function: Drop data escape_str(value: str) → str[source]¶ classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶ Return VectorStore initialized from documents and embeddings. classmethod from_texts(texts: List[str], emb...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
0c52a28c8bf8-7
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 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 Documen...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
0c52a28c8bf8-8
where_str (Optional[str], optional) – where condition string. Defaults to None. NOTE – Please do not let end-user to fill this and always be aware of SQL injection. When dealing with metadatas, remember to use {self.metadata_column}.attribute instead of attribute alone. The default name for it is metadata. Returns List...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
0c52a28c8bf8-9
use {self.metadata_column}.attribute instead of attribute alone. The default name for it is metadata. Returns List of (Document, similarity) Return type List[Document] similarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶ Run similarity search with distance. Examples using Clickhouse¶ ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html
a81728c93802-0
langchain.vectorstores.deeplake.DeepLake¶ class langchain.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, num_workers: int = ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-1
... ) >>> >>> # 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 one. Defaults to _LANGCHAIN_DEFAULT_DEEPLAK...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-2
or connected to Deep Lake. Not for in-memory or local datasets. tensor_db - Hosted Managed Tensor Database that isresponsible for storage and query execution. Only for data stored in the Deep Lake Managed Database. Use runtime = {“db_engine”: True} during dataset creation. runtime (Dict, optional) – Parameters for crea...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-3
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 add to the vectorstore. aadd_texts(texts[, metadatas]) Run more texts through the embeddings and add to the vectorstore...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-4
delete([ids]) Delete the entities in the dataset. delete_dataset() Delete the collection. ds() force_delete_by_path(path) Force delete dataset by path. from_documents(documents, embedding, **kwargs) Return VectorStore initialized from documents and embeddings. from_texts(texts[, embedding, metadatas, ...]) Create a Dee...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-5
The DeepLakeVectorStore is located at the specified path. Examples >>> # Create a vector store with default tensors >>> deeplake_vectorstore = DeepLake( ... path = <path_for_storing_Data>, ... ) >>> >>> # Create a vector store in the Deep Lake Managed Tensor Database >>> data = DeepLake( ... path = "hub:/...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-6
location of the Vector Store. It is the default option. python - Pure-python implementation that runs on the client.WARNING: using this with big datasets can lead to memory issues. Data can be stored anywhere. compute_engine - C++ implementation of the Deep Lake ComputeEngine that runs on the client. Can be used for an...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-7
- “COS” corresponds to DistanceType.COSINE_SIMILARITY. additional_params: Additional parameters for fine-tuning the index. **kwargs – Other optional keyword arguments. Raises ValueError – If some condition is not met. async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-8
metadatas (Optional[List[dict]], optional) – Optional list of metadatas. ids (Optional[List[str]], optional) – Optional list of IDs. embedding_function (Optional[Embeddings], optional) – Embedding function to use to convert the text into embeddings. **kwargs (Any) – Any additional keyword arguments passed is not suppor...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-9
Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStoreRetriever¶ 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 “s...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-10
) # Only get the single most similar document from the dataset docsearch.as_retriever(search_kwargs={'k': 1}) # Use a filter to only retrieve documents from a specific paper docsearch.as_retriever( search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}} ) async asearch(query: str, search_type: str, **kwa...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-11
Delete the entities in the dataset. Parameters ids (Optional[List[str]], optional) – The document_ids to delete. Defaults to None. **kwargs – Other keyword arguments that subclasses might use. - filter (Optional[Dict[str, str]], optional): The filter to delete by. - delete_all (Optional[bool], optional): Whether to dro...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-12
dataset_path (str) – The full path to the dataset. Can be: Deep Lake cloud path of the form hub://username/dataset_name.To write to Deep Lake cloud datasets, ensure that you are logged in to Deep Lake (use ‘activeloop login’ from command line) AWS S3 path of the form s3://bucketname/path/to/dataset.Credentials are req...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-13
>>> data = vector_store.max_marginal_relevance_search( … query = <query_to_search>, … embedding_function = <embedding_function_for_query>, … k = <number_of_items_to_return>, … exec_option = <preferred_exec_option>, … ) Parameters query – Text to look up documents similar to. k – Number of Do...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-14
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: i...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-15
any data stored in or connected to Deep Lake. It cannot be used 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 runt...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-16
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...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-17
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.similarit...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-18
for data stored in the Deep Lake Managed Database. To store datasets in this database, specify runtime = {“db_engine”: True} during dataset creation. distance_metric (str): L2 for Euclidean, L1 for Nuclear,max for L-infinity distance, cos for cosine similarity, ‘dot’ for dot product. Defaults to L2. deep_memory (bool):...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-19
>>> data = vector_store.similarity_search_with_score( … query=<your_query>, … embedding=<your_embedding_function> … k=<number_of_items_to_return>, … exec_option=<preferred_exec_option>, … ) Parameters query (str) – Query text to search for. k (int) – Number of results to return. Defaults to 4. **kwargs ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
a81728c93802-20
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 d...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
11c02fe49fb4-0
langchain.vectorstores.redis.filters.RedisFilterExpression¶ class langchain.vectorstores.redis.filters.RedisFilterExpression(_filter: Optional[str] = None, operator: Optional[RedisFilterOperator] = None, left: Optional[RedisFilterExpression] = None, right: Optional[RedisFilterExpression] = None)[source]¶ A logical expr...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.filters.RedisFilterExpression.html
8d37689a5587-0
langchain.vectorstores.elasticsearch.ElasticsearchStore¶ class langchain.vectorstores.elasticsearch.ElasticsearchStore(index_name: str, *, embedding: ~typing.Optional[~langchain.schema.embeddings.Embeddings] = None, es_connection: ~typing.Optional[Elasticsearch] = None, es_url: ~typing.Optional[str] = None, es_cloud_id...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-1
es_connection – Optional pre-existing Elasticsearch connection. vector_query_field – Optional. Name of the field to store the embedding vectors in. query_field – Optional. Name of the field to store the texts in. strategy – Optional. Retrieval strategy to use when searching the index. Defaults to ApproxRetrievalStrateg...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-2
If you want to use the Brute force / Exact strategy for searching vectors, you can pass in the ExactRetrievalStrategy to the ElasticsearchStore constructor. Example from langchain.vectorstores import ElasticsearchStore from langchain.embeddings.openai import OpenAIEmbeddings vectorstore = ElasticsearchStore( embedd...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-3
add_documents(documents, **kwargs) Run more documents through the embeddings and add to the vectorstore. add_embeddings(text_embeddings[, metadatas, ...]) Add the given texts and embeddings to the vectorstore. add_texts(texts[, metadatas, ids, ...]) Run more texts through the embeddings and add to the vectorstore. adel...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-4
from_texts(texts[, embedding, metadatas, ...]) Construct ElasticsearchStore wrapper from raw documents. get_user_agent() max_marginal_relevance_search(query[, k, ...]) Return docs selected using the maximal marginal relevance. max_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-5
embed the query text within the stack. Requires embedding model to be deployed to Elasticsearch. hybrid – Optional. If True, will perform a hybrid search using both the knn query and a text query. Defaults to False. rrf – Optional. rrf is Reciprocal Rank Fusion. When hybrid is True, and rrf is True, then rrf: {}. and r...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-6
within the stack. Requires embedding model to be deployed to Elasticsearch. __init__(index_name: str, *, embedding: ~typing.Optional[~langchain.schema.embeddings.Embeddings] = None, es_connection: ~typing.Optional[Elasticsearch] = None, es_url: ~typing.Optional[str] = None, es_cloud_id: ~typing.Optional[str] = None, es...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-7
(List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added texts. Return type List[str] add_embeddings(text_embeddings: Iterable[Tuple[str, List[float]]], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, refresh_indices: bool = True, create_index_if_not_e...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-8
refresh_indices – Whether to refresh the Elasticsearch indices after adding the texts. create_index_if_not_exists – Whether to create the Elasticsearch index if it doesn’t already exist. *bulk_kwargs – Additional arguments to pass to Elasticsearch bulk. - chunk_size: Optional. Number of texts to add to the index at a t...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-9
as_retriever(**kwargs: Any) → VectorStoreRetriever¶ 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]) ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-10
docsearch.as_retriever(search_kwargs={'k': 1}) # Use a filter to only retrieve documents from a specific paper 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 u...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-11
Run similarity search with distance asynchronously. static connect_to_elasticsearch(*, es_url: Optional[str] = None, cloud_id: Optional[str] = None, api_key: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None) → Elasticsearch[source]¶ delete(ids: Optional[List[str]] = None, refresh_ind...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-12
es_connection – Optional pre-existing Elasticsearch connection. vector_query_field – Optional. Name of the field to store the embedding vectors in. query_field – Optional. Name of the field to store the texts in. bulk_kwargs – Optional. Additional arguments to pass to Elasticsearch bulk. classmethod from_texts(texts: L...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-13
strategy to use. Defaults to “COSINE”. can be one of “COSINE”, “EUCLIDEAN_DISTANCE”, “DOT_PRODUCT”. bulk_kwargs – Optional. Additional arguments to pass to Elasticsearch bulk. static get_user_agent() → str[source]¶ max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, fields...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-14
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 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 Documen...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
8d37689a5587-15
Return Elasticsearch documents most similar to query, along with scores. Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. filter – Array of Elasticsearch filter clauses to apply to the query. Returns List of Documents most similar to the embedding and s...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ElasticsearchStore.html
1fc5e8e9327a-0
langchain.vectorstores.starrocks.has_mul_sub_str¶ langchain.vectorstores.starrocks.has_mul_sub_str(s: str, *args: Any) → bool[source]¶ Check if a string has multiple substrings. :param s: The string to check :param *args: The substrings to check for in the string Returns True if all substrings are present in the string...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.has_mul_sub_str.html
5996468194e5-0
langchain.vectorstores.sklearn.ParquetSerializer¶ class langchain.vectorstores.sklearn.ParquetSerializer(persist_path: str)[source]¶ Serializes data in Apache Parquet format using the pyarrow package. Methods __init__(persist_path) extension() The file extension suggested by this serializer (without dot). load() Loads ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.ParquetSerializer.html
b27397df202a-0
langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever¶ class langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever[source]¶ Bases: BaseRetriever Retriever that uses Azure Cognitive Search. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
b27397df202a-1
Subclasses should override this method if they can batch more efficiently; e.g., if the underlying runnable uses an API which supports a batch mode. async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[s...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
b27397df202a-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
b27397df202a-3
e.g., if the underlying runnable uses an API which supports a batch mode. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. config_schema(*, include: Optional[Sequence[str]] = None) → Type[BaseModel]¶ The type of config this runnable accepts specified as a pydantic m...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
b27397df202a-4
exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, i...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
b27397df202a-5
Get a pydantic model that can be used to validate output to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic output schema that depends on which configuration the runnable is invoked with. This method allows to get an output schema for a specific co...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
b27397df202a-6
Returns The output of the runnable. classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclu...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
b27397df202a-7
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of stream, which calls invoke. Subclasses should override t...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
b27397df202a-8
fallback in order, upon failures. with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶ Bind lifecycle listeners to a Runnable, returning a new Runnable. on_start: Called before the runnable starts running, with the Run ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
b27397df202a-9
The type of output this runnable produces specified as a type annotation. property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶ List configurable fields for this runnable. property input_schema: Type[pydantic.main.BaseModel]¶ The type of input this runnable accepts specified as a pydantic ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
cd32967808bb-0
langchain.vectorstores.zep.ZepVectorStore¶ class langchain.vectorstores.zep.ZepVectorStore(collection_name: str, api_url: str, *, api_key: Optional[str] = None, config: Optional[CollectionConfig] = None, embedding: Optional[Embeddings] = None)[source]¶ Zep vector store. It provides methods for adding texts or documents...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
cd32967808bb-1
Return VectorStore initialized from documents and embeddings. afrom_texts(texts, embedding[, metadatas]) Return VectorStore initialized from texts and embeddings. amax_marginal_relevance_search(query[, k, ...]) Return docs selected using the maximal marginal relevance. amax_marginal_relevance_search_by_vector(...) Retu...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
cd32967808bb-2
similarity_search_by_vector(embedding[, k, ...]) Return docs most similar to embedding vector. similarity_search_with_relevance_scores(query) Return docs and relevance scores in the range [0, 1]. similarity_search_with_score(query[, k, ...]) Run similarity search with distance. __init__(collection_name: str, api_url: s...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
cd32967808bb-3
Run more texts through the embeddings and add to the vectorstore. Parameters texts – Iterable of strings to add to the vectorstore. metadatas – Optional list of metadatas associated with the texts. document_ids – Optional list of document ids associated with the texts. kwargs – vectorstore specific parameters Returns L...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
cd32967808bb-4
Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStoreRetriever¶ 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 “s...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
cd32967808bb-5
) # Only get the single most similar document from the dataset docsearch.as_retriever(search_kwargs={'k': 1}) # Use a filter to only retrieve documents from a specific paper docsearch.as_retriever( search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}} ) async asearch(query: str, search_type: str, metad...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
cd32967808bb-6
Raises ValueError – If no UUIDs are provided. classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶ Return VectorStore initialized from documents and embeddings. classmethod from_texts(texts: List[str], embedding: Optional[Embeddings] = None, metadatas: Optional[List[dict]] ...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
cd32967808bb-7
Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. Parameters query – Text 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. Zep determines this automatically and this para...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
cd32967808bb-8
Returns List of Documents selected by maximal marginal relevance. search(query: str, search_type: str, metadata: Optional[Dict[str, Any]] = None, k: int = 3, **kwargs: Any) → List[Document][source]¶ Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, metadata: Option...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
cd32967808bb-9
Run similarity search with distance. Examples using ZepVectorStore¶ Zep
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html
2f690b24f704-0
langchain.vectorstores.redis.schema.HNSWVectorField¶ class langchain.vectorstores.redis.schema.HNSWVectorField[source]¶ Bases: RedisVectorField Schema for HNSW vector fields in Redis. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parse...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.HNSWVectorField.html
2f690b24f704-1
exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, i...
lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.HNSWVectorField.html