id
stringlengths
14
15
text
stringlengths
13
2.7k
source
stringlengths
60
181
5e4d2d404ca7-1
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False,...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.RedisField.html
c64d493b7c24-0
langchain_community.vectorstores.myscale.MyScale¶ class langchain_community.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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScale.html
c64d493b7c24-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_community.vectorstores.myscale.MyScale.html
c64d493b7c24-2
similarity_search_with_relevance_scores(query) Perform a similarity search with MyScale similarity_search_with_score(*args, **kwargs) Run similarity search with distance. __init__(embedding: Embeddings, config: Optional[MyScaleSettings] = None, **kwargs: Any) → None[source]¶ MyScale Wrapper to LangChain embedding (Embe...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScale.html
c64d493b7c24-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScale.html
c64d493b7c24-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScale.html
c64d493b7c24-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScale.html
c64d493b7c24-6
False otherwise, None if not implemented. 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. cl...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScale.html
c64d493b7c24-7
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 determines the degree of diversity among the results with 0 corresponding to max...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScale.html
c64d493b7c24-8
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 dealing with metadatas, remember to use {self.metadata_column}.attribute instead of at...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScale.html
c64d493b7c24-9
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 most similar to the query text and cosine distance in float for ea...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScale.html
b5c0e29123c4-0
langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch¶ class langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch(collection: Collection[CosmosDBDocumentType], embedding: Embeddings, *, index_name: str = 'vectorSearchIndex', text_key: str = 'textContent', embedding_key: str = ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-3
Run more documents through the embeddings and add to the vectorstore. Parameters (List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added texts. Return type List[str] async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶ Run...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-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_...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-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 ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
b5c0e29123c4-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azure_cosmos_db.AzureCosmosDBVectorSearch.html
aae7f7968774-0
langchain_community.vectorstores.elasticsearch.ApproxRetrievalStrategy¶ class langchain_community.vectorstores.elasticsearch.ApproxRetrievalStrategy(query_model_id: Optional[str] = None, hybrid: Optional[bool] = False, rrf: Optional[Union[dict, bool]] = True)[source]¶ Approximate retrieval strategy using the HNSW algor...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ApproxRetrievalStrategy.html
aae7f7968774-1
Create the mapping for the Elasticsearch index. query(query_vector: Optional[List[float]], query: Optional[str], k: int, fetch_k: int, vector_query_field: str, text_field: str, filter: List[dict], similarity: Optional[DistanceStrategy]) → Dict[source]¶ Executes when a search is performed on the store. Parameters query_...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ApproxRetrievalStrategy.html
3ed7269f3832-0
langchain_community.vectorstores.tiledb.get_vector_index_uri_from_group¶ langchain_community.vectorstores.tiledb.get_vector_index_uri_from_group(group: Any) → str[source]¶
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tiledb.get_vector_index_uri_from_group.html
b28a5b329184-0
langchain_community.vectorstores.qdrant.Qdrant¶ class langchain_community.vectorstores.qdrant.Qdrant(client: Any, collection_name: str, embeddings: Optional[Embeddings] = None, content_payload_key: str = 'page_content', metadata_payload_key: str = 'metadata', distance_strategy: str = 'COSINE', vector_name: Optional[str...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-1
Return VectorStore initialized from documents and embeddings. afrom_texts(texts, embedding[, metadatas, ...]) Construct Qdrant wrapper from a list of texts. amax_marginal_relevance_search(query[, k, ...]) Return docs selected using the maximal marginal relevance. amax_marginal_relevance_search_by_vector(...)
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-2
amax_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. 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. Defaults to 4. :param...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-3
amax_marginal_relevance_search_with_score_by_vector(...) Return docs selected using the maximal marginal relevance. 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. Defaults t...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-4
Return docs selected using the maximal marginal relevance. max_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. max_marginal_relevance_search_with_score_by_vector(...) Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for s...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-5
Return docs most similar to query using specified search type. similarity_search(query[, k, filter, ...]) Return docs most similar to query. 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 t...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-6
uuid-like strings. batch_size – How many vectors upload per-request. Default: 64 Returns List of ids from adding the texts into the vectorstore. async classmethod aconstruct_instance(texts: List[str], embedding: Embeddings, location: Optional[str] = None, url: Optional[str] = None, port: Optional[int] = 6333, grpc_port...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-7
(List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added texts. Return type List[str] add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[Sequence[str]] = None, batch_size: int = 64, **kwargs: Any) → List[str][source]¶ Run more texts through t...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-8
Return VectorStore initialized from documents and embeddings. async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[Sequence[str]] = None, location: Optional[str] = None, url: Optional[str] = None, port: Optional[int] = 6333, grpc_port: int = 6334, ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-9
embedding – A subclass of Embeddings, responsible for text vectorization. metadatas – An optional list of metadata. If provided it has to be of the same length as a list of texts. ids – Optional list of ids to associate with the texts. Ids have to be uuid-like strings. location – If :memory: - use in-memory Qdrant inst...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-10
Default: “Cosine” content_payload_key – A payload key used to store the content of the document. Default: “page_content” metadata_payload_key – A payload key used to store the metadata of the document. Default: “metadata” vector_name – Name of the vector to be used internally in Qdrant. Default: None batch_size – How m...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-11
This is a user-friendly interface that: 1. Creates embeddings, one for each text 2. Initializes the Qdrant database as an in-memory docstore by default (and overridable to a remote docstore) Adds the text embeddings to the Qdrant database This is intended to be a quick way to get started. Example from langchain_communi...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-12
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 – Read consistency of the search. Defines how many replicas should be queried before returning the result. Values: - int - numbe...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-13
to maximum diversity and 1 to minimum diversity. Defaults to 0.5. filter – Filter by metadata. Defaults to None. search_params – Additional search params score_threshold – 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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-14
:param k: Number of Documents to return. Defaults to 4. :param fetch_k: Number of Documents to fetch to pass to MMR algorithm. Defaults to 20. Parameters 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. D...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-15
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_threshold", search_kwargs={'score_threshold': 0.8} ) # Only get the single most simil...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-16
Parameters embedding – Embedding vector to look up documents similar to. k – Number of Documents to return. Defaults to 4. filter – Filter by metadata. Defaults to None. search_params – Additional search params offset – Offset of the first result to return. May be used to paginate results. Note: large offset values may...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-17
filter the resulting set of retrieved docs Returns List of Tuples of (doc, similarity_score) async asimilarity_search_with_score(query: str, k: int = 4, filter: Optional[MetadataFilter] = None, search_params: Optional[common_types.SearchParams] = None, offset: int = 0, score_threshold: Optional[float] = None, consisten...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-18
Returns List of documents most similar to the query text and distance for each. async asimilarity_search_with_score_by_vector(embedding: List[float], k: int = 4, filter: Optional[MetadataFilter] = None, search_params: Optional[common_types.SearchParams] = None, offset: int = 0, score_threshold: Optional[float] = None, ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-19
Returns List of documents most similar to the query text and distance for each. classmethod construct_instance(texts: List[str], embedding: Embeddings, location: Optional[str] = None, url: Optional[str] = None, port: Optional[int] = 6333, grpc_port: int = 6334, prefer_grpc: bool = False, https: Optional[bool] = None, a...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-20
True if deletion is successful, False otherwise, None if not implemented. Return type Optional[bool] 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: Embedd...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-21
Construct Qdrant wrapper from a list of texts. Parameters texts – A list of texts to be indexed in Qdrant. embedding – A subclass of Embeddings, responsible for text vectorization. metadatas – An optional list of metadata. If provided it has to be of the same length as a list of texts. ids – Optional list of ids to ass...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-22
collection_name – Name of the Qdrant collection to be used. If not provided, it will be created randomly. Default: None distance_func – Distance function. One of: “Cosine” / “Euclid” / “Dot”. Default: “Cosine” content_payload_key – A payload key used to store the content of the document. Default: “page_content” metadat...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-23
optimizers_config – Params for optimizer wal_config – Params for Write-Ahead-Log quantization_config – Params for quantization, if None - quantization will be disabled init_from – Use data stored in another collection to initialize this collection force_recreate – Force recreating the collection **kwargs – Additional a...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-24
of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. filter – Filter by metadata. Defaults to None. search_params – Additional search params score_threshold – Define a minimal score threshold for the result. If defined, less similar results will not be re...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-25
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. filter – Filter by meta...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-26
Return docs selected using the maximal marginal relevance. 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. Defaults to 4. :param fetch_k: Number of Documents to fetch to pass...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-27
Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, filter: Optional[MetadataFilter] = None, search_params: Optional[common_types.SearchParams] = None, offset: int = 0, score_threshold: Optional[float] = None, consistency: Optional[common_types.ReadConsistency] = Non...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-28
Returns List of Documents most similar to the query. similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[MetadataFilter] = None, search_params: Optional[common_types.SearchParams] = None, offset: int = 0, score_threshold: Optional[float] = None, consistency: Optional[common_types.ReadConsis...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-29
Returns List of Documents most similar to the query. 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. D...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-30
consistency – 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 ’majority’ - query all replicas, but return values present in themajority of replicas ’quorum’ - query the maj...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
b28a5b329184-31
queried before returning the result. Values: - int - number of replicas to query, values should present in all queried replicas ’majority’ - query all replicas, but return values present in themajority of replicas ’quorum’ - query the majority of replicas, return values present inall of them ’all’ - query all replicas,...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.qdrant.Qdrant.html
6ebceb6984bb-0
langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever¶ class langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever[source]¶ Bases: VectorStoreRetriever Retriever for Redis VectorStore. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
6ebceb6984bb-1
Default implementation runs ainvoke in parallel using asyncio.gather. The default implementation of batch works well for IO bound runnables. 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. add_documents(documents: List[...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
6ebceb6984bb-2
Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_typ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
6ebceb6984bb-3
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
6ebceb6984bb-4
Default values are respected, but no other validation is performed. 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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
6ebceb6984bb-5
This method allows to get an input schema for a specific configuration. Parameters config – A config to use when generating the schema. Returns A pydantic model that can be used to validate input. classmethod get_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langcha...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
6ebceb6984bb-6
and passed as arguments to the handlers defined in callbacks. Returns List of relevant documents invoke(input: str, config: Optional[RunnableConfig] = None) → List[Document]¶ Transform a single input into an output. Override to implement. Parameters input – The input to the runnable. config – A config to use when invok...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
6ebceb6984bb-7
by calling invoke() with each input. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = No...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
6ebceb6984bb-8
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: Sequence[Runnable[Input, Output]], *, exceptions_to_handle: Tuple[Type[BaseException], ...] = (<class 'Exception'>,)) → RunnableWithFallbacksT[Input, Output]¶ Add fallbacks to a runnable, returning a new Runnable. Parameters fallbacks – A se...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
6ebceb6984bb-9
between retries stop_after_attempt – The maximum number of attempts to make before giving up Returns A new Runnable that retries the original runnable on exceptions. with_types(*, input_type: Optional[Type[Input]] = None, output_type: Optional[Type[Output]] = None) → Runnable[Input, Output]¶ Bind input and output types...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.base.RedisVectorStoreRetriever.html
f12293fb330b-0
langchain_community.vectorstores.usearch.USearch¶ class langchain_community.vectorstores.usearch.USearch(embedding: Embeddings, index: Any, docstore: Docstore, ids: List[str])[source]¶ USearch vector store. To use, you should have the usearch python package installed. Initialize with necessary components. Attributes em...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.usearch.USearch.html
f12293fb330b-1
asimilarity_search_by_vector(embedding[, k]) Return docs most similar to embedding vector. asimilarity_search_with_relevance_scores(query) Return docs and relevance scores in the range [0, 1], asynchronously. asimilarity_search_with_score(*args, **kwargs) Run similarity search with distance asynchronously. delete([ids]...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.usearch.USearch.html
f12293fb330b-2
Run more documents through the embeddings and add to the vectorstore. Parameters (List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added texts. Return type List[str] async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶ Run...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.usearch.USearch.html
f12293fb330b-3
Return VectorStore initialized from documents and embeddings. async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶ Return VectorStore initialized from texts and embeddings. async amax_marginal_relevance_search(query: str, k: int = 4, fetch_...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.usearch.USearch.html
f12293fb330b-4
Return type VectorStoreRetriever Examples: # Retrieve more documents with higher diversity # Useful if your dataset has many similar documents docsearch.as_retriever( search_type="mmr", search_kwargs={'k': 6, 'lambda_mult': 0.25} ) # Fetch more documents for the MMR algorithm to consider # But only return the t...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.usearch.USearch.html
f12293fb330b-5
Return docs and relevance scores in the range [0, 1], asynchronously. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Documents to return. Defaults to 4. **kwargs – kwargs to be passed to similarity search. Should include: score_threshold: Optional, a floating point value between 0 to 1 ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.usearch.USearch.html
f12293fb330b-6
embeddings = OpenAIEmbeddings() usearch = USearch.from_texts(texts, embeddings) 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 similari...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.usearch.USearch.html
f12293fb330b-7
Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶ Return docs most similar to query. Parameters query – Text to look up documents similar to. k – Number of Documents to return. Defaults to 4. Returns List of Documents most s...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.usearch.USearch.html
3c7e4cafe166-0
langchain_community.vectorstores.redis.schema.TextFieldSchema¶ class langchain_community.vectorstores.redis.schema.TextFieldSchema[source]¶ Bases: RedisField Schema for text fields in Redis. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot b...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.TextFieldSchema.html
3c7e4cafe166-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_community.vectorstores.redis.schema.TextFieldSchema.html
3c7e4cafe166-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_community.vectorstores.redis.schema.TextFieldSchema.html
77b37f4edc25-0
langchain_community.vectorstores.elasticsearch.BaseRetrievalStrategy¶ class langchain_community.vectorstores.elasticsearch.BaseRetrievalStrategy[source]¶ Base class for Elasticsearch retrieval strategies. Methods __init__() before_index_setup(client, text_field, ...) Executes before the index is created. index(dims_len...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.BaseRetrievalStrategy.html
77b37f4edc25-1
Returns The Elasticsearch settings and mappings for the strategy. Return type Dict abstract query(query_vector: Optional[List[float]], query: Optional[str], *, k: int, fetch_k: int, vector_query_field: str, text_field: str, filter: List[dict], similarity: Optional[DistanceStrategy]) → Dict[source]¶ Executes when a sear...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.BaseRetrievalStrategy.html
7b6c0046bd78-0
langchain_community.vectorstores.elasticsearch.ElasticsearchStore¶ class langchain_community.vectorstores.elasticsearch.ElasticsearchStore(index_name: str, *, embedding: ~typing.Optional[~langchain_core.embeddings.Embeddings] = None, es_connection: ~typing.Optional[Elasticsearch] = None, es_url: ~typing.Optional[str] =...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-2
fastest and most memory efficient algorithm. 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_community.vectorstores import ElasticsearchStore from langchain_community.embeddings.openai imp...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-3
aadd_texts(texts[, metadatas]) Run more texts through the embeddings and add to the vectorstore. 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(tex...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-4
Delete documents from the Elasticsearch index. from_documents(documents[, embedding, ...]) Construct ElasticsearchStore wrapper from documents. from_texts(texts[, embedding, metadatas, ...]) Construct ElasticsearchStore wrapper from raw documents. get_user_agent() max_marginal_relevance_search(query[, k, ...]) Return d...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-5
if query_model_id is used, do not provide an embedding function. Parameters query_model_id – Optional. ID of the model to use to 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 q...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-6
within the stack. Requires embedding model to be deployed to Elasticsearch. __init__(index_name: str, *, embedding: ~typing.Optional[~langchain_core.embeddings.Embeddings] = None, es_connection: ~typing.Optional[Elasticsearch] = None, es_url: ~typing.Optional[str] = None, es_cloud_id: ~typing.Optional[str] = None, es_u...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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]) ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
7b6c0046bd78-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ElasticsearchStore.html
3ec1fb53491e-0
langchain_community.vectorstores.surrealdb.SurrealDBStore¶ class langchain_community.vectorstores.surrealdb.SurrealDBStore(embedding_function: Embeddings, **kwargs: Any)[source]¶ SurrealDB as Vector Store. To use, you should have the surrealdb python package installed. Parameters embedding_function – Embedding function...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.surrealdb.SurrealDBStore.html
3ec1fb53491e-1
Run more documents through the embeddings and add to the vectorstore. add_texts(texts[, metadatas]) Add list of text along with embeddings to the vector store adelete([ids]) Delete by document ID asynchronously. afrom_documents(documents, embedding, **kwargs) Return VectorStore initialized from documents and embeddings...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.surrealdb.SurrealDBStore.html
3ec1fb53491e-2
Return docs selected using the maximal marginal relevance. search(query, search_type, **kwargs) Return docs most similar to query using specified search type. similarity_search(query[, k]) Run similarity search on query similarity_search_by_vector(embedding[, k]) Run similarity search on query embedding similarity_sear...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.surrealdb.SurrealDBStore.html
3ec1fb53491e-3
Add list of text along with embeddings to the vector store Parameters texts (Iterable[str]) – collection of text to add to the database Returns List of ids for the newly inserted documents async adelete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool][source]¶ Delete by document ID asynchronously. Param...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.surrealdb.SurrealDBStore.html