id
stringlengths
14
15
text
stringlengths
44
2.47k
source
stringlengths
61
181
76872486d2b2-4
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.vectorstores.analyticdb.AnalyticDB.html
76872486d2b2-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 most ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.analyticdb.AnalyticDB.html
76872486d2b2-6
Either pass it as a parameter or set the PG_CONNECTION_STRING environment variable. classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, embedding_dimension: int = 1536, collection_name: str = 'langchain_document', ids: Optional[List[str]] = None, pre_delete_collection...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.analyticdb.AnalyticDB.html
76872486d2b2-7
Return docs selected using the maximal marginal relevance. 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 pa...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.analyticdb.AnalyticDB.html
76872486d2b2-8
Returns List of Documents most similar to the query vector. similarity_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]. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Documents to re...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.analyticdb.AnalyticDB.html
a547c6fdfb16-0
langchain.vectorstores.sklearn.BaseSerializer¶ class langchain.vectorstores.sklearn.BaseSerializer(persist_path: str)[source]¶ Base class for serializing data. Methods __init__(persist_path) extension() The file extension suggested by this serializer (without dot). load() Loads the data from the persist_path save(data)...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.BaseSerializer.html
86db094df847-0
langchain.vectorstores.redis.schema.RedisModel¶ class langchain.vectorstores.redis.schema.RedisModel[source]¶ Bases: BaseModel Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param content_key: str = 'conten...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisModel.html
86db094df847-1
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisModel.html
86db094df847-2
get_fields() → List[RedisField][source]¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisModel.html
86db094df847-3
property is_empty: bool¶ property metadata_keys: List[str]¶ property vector_dtype: numpy.dtype¶
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisModel.html
fc156e228899-0
langchain.vectorstores.hologres.HologresWrapper¶ class langchain.vectorstores.hologres.HologresWrapper(connection_string: str, ndims: int, table_name: str)[source]¶ Hologres API wrapper. Initialize the wrapper. Parameters connection_string – Hologres connection string. ndims – Number of dimensions of the embedding outp...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.HologresWrapper.html
fd64d174dbee-0
langchain.vectorstores.redis.schema.FlatVectorField¶ class langchain.vectorstores.redis.schema.FlatVectorField[source]¶ Bases: RedisVectorField Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param algorithm...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.FlatVectorField.html
fd64d174dbee-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.FlatVectorField.html
fd64d174dbee-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.FlatVectorField.html
b119e9effe6d-0
langchain.vectorstores.supabase.SupabaseVectorStore¶ class langchain.vectorstores.supabase.SupabaseVectorStore(client: supabase.client.Client, embedding: Embeddings, table_name: str, query_name: Union[str, None] = None)[source]¶ Supabase Postgres vector store. It assumes you have the pgvector extension installed and a ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.supabase.SupabaseVectorStore.html
b119e9effe6d-1
from supabase.client import create_client embeddings = OpenAIEmbeddings() supabase_client = create_client("my_supabase_url", "my_supabase_key") vector_store = SupabaseVectorStore( client=supabase_client, embedding=embeddings, table_name="documents", query_name="match_documents", ) Initialize with supaba...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.supabase.SupabaseVectorStore.html
b119e9effe6d-2
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 most similar to query. delete([ids]) Delete by vector IDs. from_documents(documents, embedding, **kwarg...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.supabase.SupabaseVectorStore.html
b119e9effe6d-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.vectorstores.supabase.SupabaseVectorStore.html
b119e9effe6d-4
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.vectorstores.supabase.SupabaseVectorStore.html
b119e9effe6d-5
) # 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.vectorstores.supabase.SupabaseVectorStore.html
b119e9effe6d-6
Return VectorStore initialized from documents and embeddings. classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, client: Optional[supabase.client.Client] = None, table_name: Optional[str] = 'documents', query_name: Union[str, None] = 'match_documents', ids: Optional[...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.supabase.SupabaseVectorStore.html
b119e9effe6d-7
embedding vector(1536), similarity float) LANGUAGE plpgsql AS $$ # variable_conflict use_column BEGINRETURN query SELECT id, content, metadata, embedding, 1 -(docstore.embedding <=> query_embedding) AS similarity FROMdocstore ORDER BYdocstore.embedding <=> query_embedding LIMIT match_count; END; $$; ``` max_marginal_re...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.supabase.SupabaseVectorStore.html
b119e9effe6d-8
Return docs most similar to embedding vector. Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. Returns List of Documents most similar to the query vector. similarity_search_by_vector_returning_embeddings(query: List[float], k: int, filter: Optional[Dict...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.supabase.SupabaseVectorStore.html
60685ec9d2ac-0
langchain.vectorstores.pgvector.DistanceStrategy¶ class langchain.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 = 'inner'¶
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgvector.DistanceStrategy.html
f79125706173-0
langchain.vectorstores.awadb.AwaDB¶ class langchain.vectorstores.awadb.AwaDB(table_name: str = 'langchain_awadb', embedding: Optional[Embeddings] = None, log_and_data_dir: Optional[str] = None, client: Optional[awadb.Client] = None, **kwargs: Any)[source]¶ AwaDB vector store. Initialize with AwaDB client.If table_name ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-1
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_type, **kwargs) Return docs most similar to quer...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-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, ...]) The most k similar documents and scores of the specified query. update(ids, te...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-3
Run more texts through the embeddings and add to the vectorstore. 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 text...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-4
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStore...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-5
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_threshold", search_kwargs={'score_threshold': 0.8} ) # Only get the single most similar document from the dataset docsearch.as_retriever...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-6
True if deletion is successful. False otherwise, None if not implemented. Return type Optional[bool] classmethod from_documents(documents: List[Document], embedding: Optional[Embeddings] = None, table_name: str = 'langchain_awadb', log_and_data_dir: Optional[str] = None, client: Optional[awadb.Client] = None, **kwargs:...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-7
table_name (str) – Name of the table to create. log_and_data_dir (Optional[str]) – Directory of logging and persistence. client (Optional[awadb.Client]) – AwaDB client Returns AwaDB vectorstore. Return type AwaDB get(ids: Optional[List[str]] = None, text_in_page_content: Optional[str] = None, meta_filter: Optional[dict...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-8
Return docs selected using the maximal marginal relevance. 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...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-9
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, text_in_page_content: Optional[str] = None, meta_filter: Optional[dict] = None,...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-10
k – Number of Documents to return. Defaults to 4. text_in_page_content – Filter by the text in page_content of Document. meta_filter – Filter by metadata. Defaults to None. not_incude_fields_in_metadata – Not include meta fields of each document. Returns List of Documents which are the most similar to the query vector....
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f79125706173-11
0 is dissimilar, 1 is the most similar. update(ids: List[str], texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][source]¶ Update the documents which have the specified ids. Parameters ids – The id list of the updating embedding vector. texts – The texts of the updating documents. ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
3fd9214daf50-0
langchain.vectorstores.tencentvectordb.ConnectionParams¶ class langchain.vectorstores.tencentvectordb.ConnectionParams(url: str, key: str, username: str = 'root', timeout: int = 10)[source]¶ Tencent vector DB Connection params. See the following documentation for details: https://cloud.tencent.com/document/product/1709...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tencentvectordb.ConnectionParams.html
3eaa275e784e-0
langchain.vectorstores.vald.Vald¶ class langchain.vectorstores.vald.Vald(embedding: Embeddings, host: str = 'localhost', port: int = 8080, grpc_options: Tuple = (('grpc.keepalive_time_ms', 10000), ('grpc.keepalive_timeout_ms', 10000)))[source]¶ Wrapper around Vald vector database. To use, you should have the vald-clien...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vald.Vald.html
3eaa275e784e-1
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_type, **kwargs) Return docs most similar to quer...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vald.Vald.html
3eaa275e784e-2
Run similarity search with distance. similarity_search_with_score_by_vector(embedding) __init__(embedding: Embeddings, host: str = 'localhost', port: int = 8080, grpc_options: Tuple = (('grpc.keepalive_time_ms', 10000), ('grpc.keepalive_timeout_ms', 10000)))[source]¶ async aadd_documents(documents: List[Document], **kw...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vald.Vald.html
3eaa275e784e-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.vectorstores.vald.Vald.html
3eaa275e784e-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.vectorstores.vald.Vald.html
3eaa275e784e-5
Return docs most similar to query. delete(ids: Optional[List[str]] = None, skip_strict_exist_check: bool = False, **kwargs: Any) → Optional[bool][source]¶ Parameters skip_strict_exist_check – Deprecated. This is not used basically. classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: A...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vald.Vald.html
3eaa275e784e-6
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, radius: float = - 1.0, epsilon: float = 0.01, timeout: int = 3000000000, **kwargs: Any) → List[Document][source]¶ Re...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vald.Vald.html
3eaa275e784e-7
Return docs most similar to embedding vector. Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. Returns List of Documents most similar to the query vector. similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Docume...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vald.Vald.html
6b37dc11e311-0
langchain.vectorstores.redis.base.Redis¶ class langchain.vectorstores.redis.base.Redis(redis_url: str, index_name: str, embedding: Embeddings, index_schema: Optional[Union[Dict[str, str], str, PathLike]] = None, vector_schema: Optional[Dict[str, Union[str, int]]] = None, relevance_score_fn: Optional[Callable[[float], f...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-1
redis_url="redis://localhost:6379", ) Initialize, create index, and load Documents with metadatards = Redis.from_texts( texts, # a list of strings metadata, # a list of metadata dicts embeddings, # an Embeddings object redis_url="redis://localhost:6379", ) Initialize, create index, and load Documents wi...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-2
metadata, # a list of metadata dicts embeddings, # an Embeddings object vector_schema=vector_schema, redis_url="redis://localhost:6379", ) Custom index schema can be supplied to change the way that the metadata is indexed. This is useful for you would like to use the hybrid querying (filtering) capability o...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-3
Otherwise, the schema for newly added samples will be incorrect and metadata will not be returned. Initialize with necessary components. Attributes DEFAULT_VECTOR_SCHEMA embeddings Access the query embedding object if available. schema Return the schema of the index. Methods __init__(redis_url, index_name, embedding[, ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-4
Return docs most similar to query. delete([ids]) Delete a Redis entry. drop_index(index_name, delete_documents, ...) Drop a Redis search index. from_documents(documents, embedding, **kwargs) Return VectorStore initialized from documents and embeddings. from_existing_index(embedding, index_name, ...) Connect to an exist...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-5
write_schema(path) Write the schema to a yaml file. __init__(redis_url: str, index_name: str, embedding: Embeddings, index_schema: Optional[Union[Dict[str, str], str, PathLike]] = None, vector_schema: Optional[Dict[str, Union[str, int]]] = None, relevance_score_fn: Optional[Callable[[float], float]] = None, **kwargs: A...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-6
metadatas (Optional[List[dict]], optional) – Optional list of metadatas. Defaults to None. embeddings (Optional[List[List[float]]], optional) – Optional pre-generated embeddings. Defaults to None. keys (List[str]) or ids (List[str]) – Identifiers of entries. Defaults to None. batch_size (int, optional) – Batch size to ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-7
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_threshold fetch_k: Amount of ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-8
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...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-9
Return VectorStore initialized from documents and embeddings. classmethod from_existing_index(embedding: Embeddings, index_name: str, schema: Union[Dict[str, str], str, PathLike], **kwargs: Any) → Redis[source]¶ Connect to an existing Redis index. Example from langchain.vectorstores import Redis from langchain.embeddin...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-10
Adds the documents to the newly created Redis index. This method will generate schema based on the metadata passed in if the index_schema is not defined. If the index_schema is defined, it will compare against the generated schema and warn if there are differences. If you are purposefully defining the schema for the me...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-11
Returns Redis VectorStore instance. Return type Redis Raises ValueError – If the number of metadatas does not match the number of texts. ImportError – If the redis python package is not installed. classmethod from_texts_return_keys(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, index_n...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-12
Parameters texts (List[str]) – List of texts to add to the vectorstore. embedding (Embeddings) – Embeddings to use for the vectorstore. metadatas (Optional[List[dict]], optional) – Optional list of metadata dicts to add to the vectorstore. Defaults to None. index_name (Optional[str], optional) – Optional name of the in...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-13
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 (RedisFilterExpression, optional) – Optional metadata filter. Defaults to None. return_metadata (bool, optional) – Whether ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-14
Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, filter: Optional[RedisFilterExpression] = None, return_metadata: bool = True, distance_threshold: Optional[float] = None, **kwargs: Any) → List[Document][source]¶ Run similarity search Parameters query (str) – The q...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-15
Return type List[Document] similarity_search_limit_score(query: str, k: int = 4, score_threshold: float = 0.2, **kwargs: Any) → List[Document][source]¶ [Deprecated] Returns the most similar indexed documents to the query text within the score_threshold range. Deprecated: Use similarity_search with distance_threshold i...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
6b37dc11e311-16
similarity_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]. 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 simil...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html
1f625eda9869-0
langchain.vectorstores.neo4j_vector.sort_by_index_name¶ langchain.vectorstores.neo4j_vector.sort_by_index_name(lst: List[Dict[str, Any]], index_name: str) → List[Dict[str, Any]][source]¶ Sort first element to match the index_name if exists
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.sort_by_index_name.html
e958b7277936-0
langchain.vectorstores.scann.normalize¶ langchain.vectorstores.scann.normalize(x: ndarray) → ndarray[source]¶ Normalize vectors to unit length.
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.normalize.html
1eef1a004677-0
langchain.vectorstores.starrocks.StarRocks¶ class langchain.vectorstores.starrocks.StarRocks(embedding: Embeddings, config: Optional[StarRocksSettings] = None, **kwargs: Any)[source]¶ StarRocks vector store. You need a pymysql python package, and a valid account to connect to StarRocks. Right now StarRocks has only imp...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
1eef1a004677-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_...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
1eef1a004677-2
similarity_search_with_score(*args, **kwargs) Run similarity search with distance. __init__(embedding: Embeddings, config: Optional[StarRocksSettings] = None, **kwargs: Any) → None[source]¶ StarRocks Wrapper to LangChain embedding_function (Embeddings): config (StarRocksSettings): Configuration to StarRocks Client asyn...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
1eef1a004677-3
Returns List of ids from adding the texts into the VectorStore. 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[str], embedding: Embeddings, metadatas: Option...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
1eef1a004677-4
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...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
1eef1a004677-5
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 most similar to query. delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool]¶ Delete by vector ID or other criteria. Parameter...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
1eef1a004677-6
Returns StarRocks Index max_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. Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. Para...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
1eef1a004677-7
Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, where_str: Optional[str] = None, **kwargs: Any) → List[Document][source]¶ Perform a similarity search with StarRocks Parameters query (str) – query string k (int, optional) – Top K neighbors to retrieve. Defaults to...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
1eef1a004677-8
Perform a similarity search with StarRocks 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. When deali...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
20ee238ba585-0
langchain.vectorstores.tigris.Tigris¶ class langchain.vectorstores.tigris.Tigris(client: TigrisClient, embeddings: Embeddings, index_name: str)[source]¶ Tigris vector store. Initialize Tigris vector store. Attributes embeddings Access the query embedding object if available. search_index Methods __init__(client, embedd...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tigris.Tigris.html
20ee238ba585-1
Return docs most similar to embedding vector. asimilarity_search_with_relevance_scores(query) Return docs most similar to query. delete([ids]) Delete by vector ID or other criteria. from_documents(documents, embedding, **kwargs) Return VectorStore initialized from documents and embeddings. from_texts(texts, embedding[,...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tigris.Tigris.html
20ee238ba585-2
Run more texts through the embeddings and add to the vectorstore. 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 text...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tigris.Tigris.html
20ee238ba585-3
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStore...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tigris.Tigris.html
20ee238ba585-4
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_threshold", search_kwargs={'score_threshold': 0.8} ) # Only get the single most similar document from the dataset docsearch.as_retriever...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tigris.Tigris.html
20ee238ba585-5
Return VectorStore initialized from documents and embeddings. classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, client: Optional[TigrisClient] = None, index_name: Optional[str] = None, **kwargs: Any) → Tigris[source]¶ Return VectorSt...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tigris.Tigris.html
20ee238ba585-6
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.vectorstores.tigris.Tigris.html
20ee238ba585-7
Returns List of Tuples of (doc, similarity_score) similarity_search_with_score(query: str, k: int = 4, filter: Optional[TigrisFilter] = None) → List[Tuple[Document, float]][source]¶ Run similarity search with Chroma with distance. Parameters query (str) – Query text to search for. k (int) – Number of results to return....
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tigris.Tigris.html
f167b8b3366e-0
langchain.vectorstores.redis.schema.RedisDistanceMetric¶ class langchain.vectorstores.redis.schema.RedisDistanceMetric(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶ l2 = 'L2'¶ cosine = 'COSINE'¶ ip = 'IP'¶
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisDistanceMetric.html
bccf3596f04d-0
langchain.vectorstores.hologres.Hologres¶ class langchain.vectorstores.hologres.Hologres(connection_string: str, embedding_function: Embeddings, ndims: int = 1536, table_name: str = 'langchain_pg_embedding', pre_delete_table: bool = False, logger: Optional[Logger] = None)[source]¶ Hologres API vector store. connection_...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html
bccf3596f04d-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html
bccf3596f04d-2
search(query, search_type, **kwargs) Return docs most similar to query using specified search type. similarity_search(query[, k, filter]) Run similarity search with Hologres with distance. similarity_search_by_vector(embedding[, k, ...]) Return docs most similar to embedding vector. similarity_search_with_relevance_sco...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html
bccf3596f04d-3
Returns List of IDs of the added texts. Return type List[str] add_embeddings(texts: Iterable[str], embeddings: List[List[float]], metadatas: List[dict], ids: List[str], **kwargs: Any) → None[source]¶ Add embeddings to the vectorstore. Parameters texts – Iterable of strings to add to the vectorstore. embeddings – List o...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html
bccf3596f04d-4
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStore...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html
bccf3596f04d-5
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_threshold", search_kwargs={'score_threshold': 0.8} ) # Only get the single most similar document from the dataset docsearch.as_retriever...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html
bccf3596f04d-6
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.vectorstores.hologres.Hologres.html
bccf3596f04d-7
faiss = Hologres.from_embeddings(text_embedding_pairs, embeddings) classmethod from_existing_index(embedding: Embeddings, ndims: int = 1536, table_name: str = 'langchain_pg_embedding', pre_delete_table: bool = False, **kwargs: Any) → Hologres[source]¶ Get intsance of an existing Hologres store.This method will return t...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html
bccf3596f04d-8
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]¶ Return docs selected using the maximal marginal relevance. Maximal marginal relevan...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html
bccf3596f04d-9
Return docs most similar to embedding vector. Parameters embedding – Embedding to look up documents similar to. k – 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 the query vector. similarity_search_with_r...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html
40cd6a2530e6-0
langchain.vectorstores.pgembedding.CollectionStore¶ class langchain.vectorstores.pgembedding.CollectionStore(**kwargs)[source]¶ Collection store. A simple constructor that allows initialization from kwargs. Sets attributes on the constructed instance using the names and values in kwargs. Only keys that are present as a...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.CollectionStore.html
1a752bd7b4c4-0
langchain.vectorstores.starrocks.debug_output¶ langchain.vectorstores.starrocks.debug_output(s: Any) → None[source]¶ Print a debug message if DEBUG is True. :param s: The message to print
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.debug_output.html
951a95fa9e8d-0
langchain.vectorstores.myscale.MyScale¶ class langchain.vectorstores.myscale.MyScale(embedding: Embeddings, config: Optional[MyScaleSettings] = None, **kwargs: Any)[source]¶ MyScale vector store. You need a clickhouse-connect python package, and a valid account to connect to MyScale. MyScale can not only search with si...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScale.html
951a95fa9e8d-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.vectorstores.myscale.MyScale.html
951a95fa9e8d-2
MyScale Wrapper to LangChain embedding (Embeddings): config (MyScaleSettings): Configuration to MyScale Client Other keyword arguments will pass into [clickhouse-connect](https://docs.myscale.com/) async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScale.html
951a95fa9e8d-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.vectorstores.myscale.MyScale.html
951a95fa9e8d-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.vectorstores.myscale.MyScale.html
951a95fa9e8d-5
Return docs most similar to query. delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool]¶ 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 im...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScale.html