id
stringlengths
14
16
text
stringlengths
31
2.41k
source
stringlengths
53
121
2b28b54605b7-22
Returns List of IDs of the added texts. Return type List[str] similarity_search_with_score_id_by_vector(embedding, k=4)[source] Return docs most similar to embedding vector. No support for filter query (on metadata) along with vector search. Parameters embedding (str) – Embedding to look up documents similar to. k (in...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-23
Return docs most similar to embedding vector. Parameters embedding (List[float]) – Embedding to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. kwargs (Any) – Returns List of Documents most similar to the query vector. Return type List[langchain.schema.Document] similarity_search_...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-24
Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. :param query: Text to look up documents similar to. :param k: Number of Documents to return. :param fetch_k: Number of Documents to fetch to pass to MMR algorithm. :param lambda_mult: Number between 0 and 1 that determi...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-25
Bases: langchain.vectorstores.base.VectorStore Wrapper around ChromaDB embeddings platform. To use, you should have the chromadb python package installed. Example from langchain.vectorstores import Chroma from langchain.embeddings.openai import OpenAIEmbeddings embeddings = OpenAIEmbeddings() vectorstore = Chroma("lang...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-26
Return docs most similar to embedding vector. :param embedding: Embedding to look up documents similar to. :type embedding: str :param k: Number of Documents to return. Defaults to 4. :type k: int :param filter: Filter by metadata. Defaults to None. :type filter: Optional[Dict[str, str]] Returns List of Documents most ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-27
lambda_mult (float) – 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. filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None. kwargs (Any) – Returns List of Documents selected by ma...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-28
where (Optional[Where]) – A Where type dict used to filter results by. E.g. {“color” : “red”, “price”: 4.20}. Optional. limit (Optional[int]) – The number of documents to return. Optional. offset (Optional[int]) – The offset to start returning results from. Useful for paging results with limit. Optional. where_document...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-29
collection_name (str) – Name of the collection to create. persist_directory (Optional[str]) – Directory to persist the collection. embedding (Optional[Embeddings]) – Embedding function. Defaults to None. metadatas (Optional[List[dict]]) – List of metadatas. Defaults to None. ids (Optional[List[str]]) – List of document...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-30
Bases: langchain.vectorstores.base.VectorStore Wrapper around ClickHouse vector database You need a clickhouse-connect python package, and a valid account to connect to ClickHouse. ClickHouse can not only search with simple vector indexes, it also supports complex query with multiple conditions, constraints and even su...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-31
Defaults to None. batch_size (int, optional) – Batchsize when transmitting data to ClickHouse. Defaults to 32. metadata (List[dict], optional) – metadata to texts. Defaults to None. into (Other keyword arguments will pass) – [clickhouse-connect](https://clickhouse.com/docs/en/integrations/python#clickhouse-connect-driv...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-32
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. embedding (List[float]) – kwargs (Any) – Returns List of (Document, similarity) Return type List[Document] similarity_search_with_relevance_scores(query, k=4...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-33
index_param (list): index build parameter. index_query_params(dict): index query parameters. database (str) : Database name to find the table. Defaults to ‘default’. table (str) : Table name to operate on. Defaults to ‘vector_table’. metric (str)Metric to compute distance,supported are (‘angular’, ‘euclidean’, ‘manhatt...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-34
Show JSON schema{ "title": "ClickhouseSettings", "description": "ClickHouse Client Configuration\n\nAttribute:\n clickhouse_host (str) : An URL to connect to MyScale backend.\n Defaults to 'localhost'.\n clickhouse_port (int) : URL port to connect with HTTP. Defaults to 8443.\n us...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-35
"type": "object", "properties": { "host": { "title": "Host", "default": "localhost", "env_names": "{'clickhouse_host'}", "type": "string" }, "port": { "title": "Port", "default": 8123, "env_names": "{'clickhouse_port'}", "type"...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-36
"type": "string" } }, "column_map": { "title": "Column Map", "default": { "id": "id", "uuid": "uuid", "document": "document", "embedding": "embedding", "metadata": "metadata" }, "env_names": "{'clickhous...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-37
port (int) table (str) username (Optional[str]) attribute column_map: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata': 'metadata', 'uuid': 'uuid'} attribute database: str = 'default' attribute host: str = 'localhost' attribute index_param: Optional[Union[List, Dict]] = ["'L...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-38
To use, you should have the deeplake python package installed. Example from langchain.vectorstores import DeepLake from langchain.embeddings.openai import OpenAIEmbeddings embeddings = OpenAIEmbeddings() vectorstore = DeepLake("langchain_store", embeddings.embed_query) Parameters dataset_path (str) – token (Optional[s...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-39
... ) >>> # Run tql search: >>> data = vector_store.tql_search( ... tql_query="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: ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-40
similarity_search_by_vector(embedding, k=4, **kwargs)[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>, ... ) ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-41
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. kwargs (Any) – Returns List of Documents most similar to the query vector. Return type List[Document] similarity_...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-42
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...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-43
“python”. - “python” - Pure-python implementation running on the client. Can be used for data stored anywhere. WARNING: using this option with big datasets is discouraged due to potential memory issues. ”compute_engine” - Performant C++ implementation of the DeepLake Compute Engine. Runs on the client and can be used f...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-44
lambda_mult (float) – Value between 0 and 1. 0 corresponds to maximum diversity and 1 to minimum. Defaults to 0.5. exec_option (str) – Supports 3 ways to perform searching. - “python” - Pure-python implementation running on the client. Can be used for data stored anywhere. WARNING: using this option with big datasets i...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-45
… exec_option = <preferred_exec_option>, … ) Parameters 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 ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-46
filter (Optional[Dict[str, str]], optional) – The filter to delete by. Defaults to None. delete_all (Optional[bool], optional) – Whether to drop the dataset. Defaults to None. Returns Whether the delete operation was successful. Return type bool classmethod force_delete_by_path(path)[source] Force delete dataset by pa...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-47
“cosine”, “ip”, and “l2”. Defaults to “cosine”. max_elements (int) – Maximum number of vectors that can be stored. Defaults to 1024. index (bool) – Whether an index should be built for this field. Defaults to True. ef_construction (int) – defines a construction time/accuracy trade-off. Defaults to 200. ef (int) – param...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-48
Return type langchain.vectorstores.docarray.hnsw.DocArrayHnswSearch class langchain.vectorstores.DocArrayInMemorySearch(doc_index, embedding)[source] Bases: langchain.vectorstores.docarray.base.DocArrayIndex Wrapper around in-memory storage for exact search. To use it, you should have the docarray package with version...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-49
Defaults to “cosine_sim”. kwargs (Any) – Returns DocArrayInMemorySearch Vector Store Return type langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch class langchain.vectorstores.ElasticVectorSearch(elasticsearch_url, index_name, embedding, *, ssl_verify=None)[source] Bases: langchain.vectorstores.base.Ve...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-50
Follow the prompts to reset the password The format for Elastic Cloud URLs is https://username:password@cluster_id.region_id.gcp.cloud.es.io:9243. Example from langchain import ElasticVectorSearch from langchain.embeddings import OpenAIEmbeddings embedding = OpenAIEmbeddings() elastic_host = "cluster_id.region_id.gcp.c...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-51
Return docs most similar to query. Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. filter (Optional[dict]) – kwargs (Any) – Returns List of Documents most similar to the query. Return type List[langchain.schema.Document] similarity_search_with_sco...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-52
elasticsearch_url (Optional[str]) – index_name (Optional[str]) – refresh_indices (bool) – kwargs (Any) – Return type langchain.vectorstores.elastic_vector_search.ElasticVectorSearch create_index(client, index_name, mapping)[source] Parameters client (Any) – index_name (str) – mapping (Dict) – Return type None c...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-53
Run more texts through the embeddings and add to the vectorstore. Parameters texts (Iterable[str]) – Iterable of strings to add to the vectorstore. metadatas (Optional[List[dict]]) – Optional list of metadatas associated with the texts. ids (Optional[List[str]]) – Optional list of unique IDs. kwargs (Any) – Returns Li...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-54
filter the resulting set of retrieved docs kwargs (Any) – Returns List of documents most similar to the query text and L2 distance in float for each. Lower score represents more similarity. Return type List[Tuple[langchain.schema.Document, float]] similarity_search_with_score(query, k=4, filter=None, fetch_k=20, **kwa...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-55
Return docs most similar to query. Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. filter (Optional[Dict[str, Any]]) – (Optional[Dict[str, str]]): Filter by metadata. Defaults to None. fetch_k (int) – (Optional[int]) Number of Documents to fetch bef...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-56
Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. Parameters embedding (List[float]) – Embedding to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. fetch_k (int) – Number o...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-57
Return type List[langchain.schema.Document] merge_from(target)[source] Merge another FAISS object with the current one. Add the target FAISS to the current one. Parameters target (langchain.vectorstores.faiss.FAISS) – FAISS object you wish to merge into the current one Returns None. Return type None classmethod from_t...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-58
faiss = FAISS.from_embeddings(text_embedding_pairs, embeddings) Parameters text_embeddings (List[Tuple[str, List[float]]]) – embedding (langchain.embeddings.base.Embeddings) – metadatas (Optional[List[dict]]) – ids (Optional[List[str]]) – kwargs (Any) – Return type langchain.vectorstores.faiss.FAISS save_local(fol...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-59
- NOTE: The table will be created when initializing the store (if not exists) So, make sure the user has the right permissions to create tables. pre_delete_table if True, will delete the table if it exists.(default: False) - Useful for testing. Parameters connection_string (str) – embedding_function (Embeddings) – nd...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-60
Run similarity search with Hologres with distance. Parameters query (str) – Query text to search for. k (int) – Number of results to return. Defaults to 4. filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None. kwargs (Any) – Returns List of Documents most similar to the query. Return type List[lang...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-61
Return type List[Tuple[langchain.schema.Document, float]] classmethod from_texts(texts, embedding, metadatas=None, ndims=1536, table_name='langchain_pg_embedding', ids=None, pre_delete_table=False, **kwargs)[source] Return VectorStore initialized from texts and embeddings. Postgres connection string is required “Eithe...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-62
metadatas (Optional[List[dict]]) – ndims (int) – table_name (str) – ids (Optional[List[str]]) – pre_delete_table (bool) – kwargs (Any) – Return type langchain.vectorstores.hologres.Hologres classmethod from_existing_index(embedding, ndims=1536, table_name='langchain_pg_embedding', pre_delete_table=False, **kwargs...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-63
Return connection string from database parameters. Parameters host (str) – port (int) – database (str) – user (str) – password (str) – Return type str class langchain.vectorstores.LanceDB(connection, embedding, vector_key='vector', id_key='id', text_key='text')[source] Bases: langchain.vectorstores.base.VectorSto...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-64
kwargs (Any) – Returns List of documents most similar to the query. Return type List[langchain.schema.Document] classmethod from_texts(texts, embedding, metadatas=None, connection=None, vector_key='vector', id_key='id', text_key='text', **kwargs)[source] Return VectorStore initialized from texts and embeddings. Param...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-65
gcs_bucket_name (str) – credentials (Optional[Credentials]) – add_texts(texts, metadatas=None, **kwargs)[source] Run more texts through the embeddings and add to the vectorstore. Parameters texts (Iterable[str]) – Iterable of strings to add to the vectorstore. metadatas (Optional[List[dict]]) – Optional list of meta...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-66
regional. (the same location as the GCS bucket and must be) – gcs_bucket_name (str) – The location where the vectors will be stored in created. (order for the index to be) – index_id (str) – The id of the created index. endpoint_id (str) – The id of the created endpoint. credentials_path (Optional[str]) – (Optional) ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-67
embedding and the columns are decided by the first metadata dict. Metada keys will need to be present for all inserted values. At the moment there is no None equivalent in Milvus. Parameters texts (Iterable[str]) – The texts to embed, it is assumed that they all fit in memory. metadatas (Optional[List[dict]]) – Metadat...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-68
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, optional) – How long to wait before timeout error. Defaults to None. kwargs (Any) – Collection.sear...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-69
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 ot return. Defaults to 4. param (dict) – The search params for the specified index. Defaults to None. expr ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-70
Returns Document results for search. Return type List[Document] max_marginal_relevance_search_by_vector(embedding, k=4, fetch_k=20, lambda_mult=0.5, param=None, expr=None, timeout=None, **kwargs)[source] Perform a search and return results that are reordered by MMR. Parameters embedding (str) – The embedding vector be...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-71
metadatas (Optional[List[dict]]) – Metadata for each text if it exists. Defaults to None. collection_name (str, optional) – Collection name to use. Defaults to “LangChainCollection”. connection_args (dict[str, Any], optional) – Connection args to use. Defaults to DEFAULT_MILVUS_CONNECTION. consistency_level (str, optio...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-72
Parameters texts (List[str]) – Text data. embedding (Embeddings) – Embedding function. metadatas (Optional[List[dict]]) – Metadata for each text if it exists. Defaults to None. collection_name (str, optional) – Collection name to use. Defaults to “LangChainCollection”. connection_args (dict[str, Any], optional) – Conne...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-73
distance_strategy (DistanceStrategy) – table_name (str) – content_field (str) – metadata_field (str) – vector_field (str) – pool_size (int) – max_overflow (int) – timeout (float) – kwargs (Any) – vector_field Pass the rest of the kwargs to the connection. connection_kwargs Add program name and version to con...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-74
Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. filter (Optional[dict]) – A dictionary of metadata fields and values to filter by. Defaults to None. Returns List of Documents most similar to the query and score for each Return type List[Tuple[langch...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-75
Return type langchain.vectorstores.singlestoredb.SingleStoreDBRetriever class langchain.vectorstores.Clarifai(user_id=None, app_id=None, pat=None, number_of_docs=None, api_base=None)[source] Bases: langchain.vectorstores.base.VectorStore Wrapper around Clarifai AI platform’s vector store. To use, you should have the c...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-76
Parameters query (str) – Query text to search for. k (int) – Number of results to return. Defaults to 4. filter (Optional[Dict[str, str]]) – Filter by metadata. None. (Defaults to) – namespace (Optional[str]) – kwargs (Any) – Returns List of documents most simmilar to the query text. Return type List[Document] simil...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-77
Returns Clarifai vectorstore. Return type Clarifai classmethod from_documents(documents, embedding=None, user_id=None, app_id=None, pat=None, number_of_docs=None, api_base=None, **kwargs)[source] Create a Clarifai vectorstore from a list of documents. Parameters user_id (str) – User ID. app_id (str) – App ID. document...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-78
Parameters texts (Iterable[str]) – Iterable of strings to add to the vectorstore. metadatas (Optional[List[dict]]) – Optional list of metadatas associated with the texts. ids (Optional[List[str]]) – Optional list of ids to associate with the texts. bulk_size (int) – Bulk API request count; Default: 500 kwargs (Any) – ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-79
subquery_clause: Query clause on the knn vector field; default: “must” lucene_filter: the Lucene algorithm decides whether to perform an exact k-NN search with pre-filtering or an approximate search with modified post-filtering. Optional Args for Script Scoring Search:search_type: “script_scoring”; default: “approximat...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-80
Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. fetch_k (int) – Number of Documents to fe...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-81
space_type: “l2”, “l1”, “cosinesimil”, “linf”, “innerproduct”; default: “l2” ef_search: Size of the dynamic list used during k-NN searches. Higher values lead to more accurate but slower searches; default: 512 ef_construction: Size of the dynamic list used during k-NN graph creation. Higher values lead to more accurate...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-82
Parameters collection (Collection[MongoDBDocumentType]) – embedding (Embeddings) – index_name (str) – text_key (str) – embedding_key (str) – classmethod from_connection_string(connection_string, namespace, embedding, **kwargs)[source] Parameters connection_string (str) – namespace (str) – embedding (langchain.e...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-83
fields. post_filter_pipeline (Optional[List[Dict]]) – Optional Pipeline of MongoDB aggregation stages following the knnBeta search. Returns List of Documents most similar to the query and score for each Return type List[Tuple[langchain.schema.Document, float]] similarity_search(query, k=4, pre_filter=None, post_filter_...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-84
embedding (Embeddings) – metadatas (Optional[List[dict]]) – collection (Optional[Collection[MongoDBDocumentType]]) – kwargs (Any) – Return type MongoDBAtlasVectorSearch class langchain.vectorstores.MyScale(embedding, config=None, **kwargs)[source] Bases: langchain.vectorstores.base.VectorStore Wrapper around MySca...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-85
Create Myscale wrapper with existing texts Parameters embedding_function (Embeddings) – Function to extract text embedding texts (Iterable[str]) – List or tuple of strings to be added config (MyScaleSettings, Optional) – Myscale configuration text_ids (Optional[Iterable], optional) – IDs for the texts. Defaults to None...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-86
Perform a similarity search with MyScale by vectors Parameters query (str) – query string k (int, optional) – Top K neighbors to retrieve. Defaults to 4. 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. W...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-87
Bases: pydantic.env_settings.BaseSettings MyScale Client Configuration Attribute: myscale_host (str)An URL to connect to MyScale backend.Defaults to ‘localhost’. myscale_port (int) : URL port to connect with HTTP. Defaults to 8443. username (str) : Username to login. Defaults to None. password (str) : Password to login...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-88
Show JSON schema{ "title": "MyScaleSettings", "description": "MyScale Client Configuration\n\nAttribute:\n myscale_host (str) : An URL to connect to MyScale backend.\n Defaults to 'localhost'.\n myscale_port (int) : URL port to connect with HTTP. Defaults to 8443.\n username (str)...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-89
}, "port": { "title": "Port", "default": 8443, "env_names": "{'myscale_port'}", "type": "integer" }, "username": { "title": "Username", "env_names": "{'myscale_username'}", "type": "string" }, "password": { "title": "P...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-90
}, "table": { "title": "Table", "default": "langchain", "env_names": "{'myscale_table'}", "type": "string" }, "metric": { "title": "Metric", "default": "cosine", "env_names": "{'myscale_metric'}", "type": "string" } }, ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-91
Bases: langchain.vectorstores.base.VectorStore Wrapper around Pinecone vector database. To use, you should have the pinecone-client python package installed. Example from langchain.vectorstores import Pinecone from langchain.embeddings.openai import OpenAIEmbeddings import pinecone # The environment should be the one s...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-92
k (int) – Number of Documents to return. Defaults to 4. filter (Optional[dict]) – Dictionary of argument(s) to filter on metadata namespace (Optional[str]) – Namespace to search in. Default will search in ‘’ namespace. Returns List of Documents most similar to the query and score for each Return type List[Tuple[langcha...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-93
Defaults to 0.5. filter (Optional[dict]) – namespace (Optional[str]) – kwargs (Any) – Returns List of Documents selected by maximal marginal relevance. Return type List[langchain.schema.Document] max_marginal_relevance_search(query, k=4, fetch_k=20, lambda_mult=0.5, filter=None, namespace=None, **kwargs)[source] Re...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-94
# in your Pinecone console pinecone.init(api_key="***", environment="...") embeddings = OpenAIEmbeddings() pinecone = Pinecone.from_texts( texts, embeddings, index_name="langchain-demo" ) Parameters texts (List[str]) – embedding (langchain.embeddings.base.Embeddings) – metadatas (Optional[List[dict]]) – ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-95
client = QdrantClient() collection_name = "MyCollection" qdrant = Qdrant(client, collection_name, embedding_function) Parameters client (Any) – collection_name (str) – embeddings (Optional[Embeddings]) – content_payload_key (str) – metadata_payload_key (str) – embedding_function (Optional[Callable]) – CONTENT_KEY...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-96
May be used to paginate results. Note: large offset values may cause performance issues. score_threshold (Optional[float]) – Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-97
If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned. consistency (Optional[common_types.ReadConsistency]) – Read consistency of the search...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-98
Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned. consistency (Optional[common_types.ReadConsistency]) – Read consistency of the search. Defines how many replicas should be queried before re...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-99
E.g. for cosine similarity only higher scores will be returned. consistency (Optional[common_types.ReadConsistency]) – Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: - int - number of replicas to query, values should present in all queried replicas ’majo...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-100
Return type List[langchain.schema.Document] classmethod from_texts(texts, embedding, metadatas=None, ids=None, location=None, url=None, port=6333, grpc_port=6334, prefer_grpc=False, https=None, api_key=None, prefix=None, timeout=None, host=None, path=None, collection_name=None, distance_func='Cosine', content_payload_k...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-101
Default: False https (Optional[bool]) – If true - use HTTPS(SSL) protocol. Default: None api_key (Optional[str]) – API key for authentication in Qdrant Cloud. Default: None prefix (Optional[str]) – If not None - add prefix to the REST URL path. Example: service/v1 will result in http://localhost:6333/service/v1/{qdrant...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-102
Defines how many copies of each shard will be created. Have effect only in distributed mode. write_consistency_factor (Optional[int]) – Write consistency factor for collection. Default is 1, minimum is 1. Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-103
This is intended to be a quick way to get started. Example from langchain import Qdrant from langchain.embeddings import OpenAIEmbeddings embeddings = OpenAIEmbeddings() qdrant = Qdrant.from_texts(texts, embeddings, "localhost") class langchain.vectorstores.Redis(redis_url, index_name, embedding_function, content_key='...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-104
embeddings. Defaults to None. keys (List[str]) or ids (List[str]) – Identifiers of entries. Defaults to None. batch_size (int, optional) – Batch size to use for writes. Defaults to 1000. kwargs (Any) – Returns List of ids added to the vectorstore Return type List[str] similarity_search(query, k=4, **kwargs)[source] R...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-105
k (int) – score_threshold (float) – kwargs (Any) – Note If there are no documents that satisfy the score_threshold value, an empty list is returned. similarity_search_with_score(query, k=4)[source] Return docs most similar to query. Parameters query (str) – Text to look up documents similar to. k (int) – Number of ...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-106
Return type Tuple[langchain.vectorstores.redis.Redis, List[str]] classmethod from_texts(texts, embedding, metadatas=None, index_name=None, content_key='content', metadata_key='metadata', vector_key='content_vector', **kwargs)[source] Create a Redis vectorstore from raw documents. This is a user-friendly interface that...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-107
Connect to an existing Redis index. Parameters embedding (langchain.embeddings.base.Embeddings) – index_name (str) – content_key (str) – metadata_key (str) – vector_key (str) – kwargs (Any) – Return type langchain.vectorstores.redis.Redis as_retriever(**kwargs)[source] Parameters kwargs (Any) – Return type lang...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-108
Parameters client (Any) – embeddings (Embeddings) – collection_name (str) – text_key (str) – embedding_key (str) – add_texts(texts, metadatas=None, ids=None, batch_size=32, **kwargs)[source] Run more texts through the embeddings and add to the vectorstore Args: texts: Iterable of strings to add to the vectorstore...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-109
Return type langchain.vectorstores.rocksetdb.Rockset class DistanceFunction(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source] Bases: enum.Enum COSINE_SIM = 'COSINE_SIM' EUCLIDEAN_DIST = 'EUCLIDEAN_DIST' DOT_PRODUCT = 'DOT_PRODUCT' order_by()[source] Return type str simila...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-110
kwargs (Any) – Return type List[Document] similarity_search_by_vector(embedding, k=4, distance_func=DistanceFunction.COSINE_SIM, where_str=None, **kwargs)[source] Accepts a query_embedding (vector), and returns documents with similar embeddings. Parameters embedding (List[float]) – k (int) – distance_func (Distance...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-111
Return type None persist()[source] Return type None add_texts(texts, metadatas=None, ids=None, **kwargs)[source] Run more texts through the embeddings and add to the vectorstore. Parameters texts (Iterable[str]) – Iterable of strings to add to the vectorstore. metadatas (Optional[List[dict]]) – Optional list of metad...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-112
to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. Parameters embedding (List[float]) – k (int) – fetch_k (int) – lambda_mult (float) – kwargs (Any) – Return type List[langchain.schema.Document] max_marginal_relevance_search(query, k=...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-113
persist_path (Optional[str]) – kwargs (Any) – Return type langchain.vectorstores.sklearn.SKLearnVectorStore class langchain.vectorstores.StarRocks(embedding, config=None, **kwargs)[source] Bases: langchain.vectorstores.base.VectorStore Wrapper around StarRocks vector database You need a pymysql python package, and a...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-114
List of ids from adding the texts into the VectorStore. Return type List[str] classmethod from_texts(texts, embedding, metadatas=None, config=None, text_ids=None, batch_size=32, **kwargs)[source] Create StarRocks wrapper with existing texts Parameters embedding_function (Embeddings) – Function to extract text embeddin...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-115
Returns List of Documents Return type List[Document] similarity_search_by_vector(embedding, k=4, where_str=None, **kwargs)[source] Perform a similarity search with StarRocks by vectors Parameters query (str) – query string k (int, optional) – Top K neighbors to retrieve. Defaults to 4. where_str (Optional[str], option...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-116
Bases: langchain.vectorstores.base.VectorStore VectorStore for a Supabase postgres database. Assumes you have the pgvector extension installed and a match_documents (or similar) function. For more details: https://js.langchain.com/docs/modules/indexes/vector_stores/integrations/supabase You can implement your own match...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-117
Parameters texts (List[str]) – embedding (Embeddings) – metadatas (Optional[List[dict]]) – client (Optional[supabase.client.Client]) – table_name (Optional[str]) – query_name (Union[str, None]) – ids (Optional[List[str]]) – kwargs (Any) – Return type SupabaseVectorStore add_vectors(vectors, documents, ids)[sour...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-118
**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 kwargs (Any) – Returns List of Tuples of (doc, similarity_score) Return type List[Tuple[langchain.schema.Document, float]] similarity_searc...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-119
Return type List[langchain.schema.Document] max_marginal_relevance_search(query, k=4, fetch_k=20, lambda_mult=0.5, **kwargs)[source] Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. Parameters query (str) – T...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-120
Parameters ids (List[str]) – List of ids to delete. Return type None class langchain.vectorstores.Tair(embedding_function, url, index_name, content_key='content', metadata_key='metadata', search_params=None, **kwargs)[source] Bases: langchain.vectorstores.base.VectorStore Wrapper around Tair Vector store. Parameters e...
https://api.python.langchain.com/en/stable/modules/vectorstores.html
2b28b54605b7-121
Return type List[Document] classmethod from_texts(texts, embedding, metadatas=None, index_name='langchain', content_key='content', metadata_key='metadata', **kwargs)[source] Return VectorStore initialized from texts and embeddings. Parameters texts (List[str]) – embedding (langchain.embeddings.base.Embeddings) – met...
https://api.python.langchain.com/en/stable/modules/vectorstores.html