id stringlengths 14 15 | text stringlengths 44 2.47k | source stringlengths 61 181 |
|---|---|---|
22422b7bea80-8 | vectorstore = Neo4jVector.from_embeddings(
text_embedding_pairs, embeddings)
classmethod from_existing_graph(embedding: Embeddings, node_label: str, embedding_node_property: str, text_node_properties: List[str], *, keyword_index_name: Optional[str] = 'keyword', index_name: str = 'vector', search_type: SearchType = ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
22422b7bea80-9 | and password and optional database parameters along with
the index_name definition.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, ids: Optional[List[str]] = None, **kwargs: Any) → Neo4jVector[source]... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
22422b7bea80-10 | 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.vectorstores.neo4j_vector.Neo4jVector.html |
22422b7bea80-11 | Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Run similarity search with Neo4jVector.
Parameters
query (str) – Query text to search for.
k (int) – Number of results to return. Defaults to 4.
Returns
List of Documents mos... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
22422b7bea80-12 | Returns
List of Documents most similar to the query and score for each
similarity_search_with_score_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Perform a similarity search in the Neo4j database using a
given vector and return the top k similar documents with thei... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
b8c1673da5ed-0 | langchain.vectorstores.faiss.dependable_faiss_import¶
langchain.vectorstores.faiss.dependable_faiss_import(no_avx2: Optional[bool] = None) → Any[source]¶
Import faiss if available, otherwise raise error.
If FAISS_NO_AVX2 environment variable is set, it will be considered
to load FAISS with no AVX2 optimization.
Paramet... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.dependable_faiss_import.html |
891804a1d2c6-0 | langchain.vectorstores.clarifai.Clarifai¶
class langchain.vectorstores.clarifai.Clarifai(user_id: Optional[str] = None, app_id: Optional[str] = None, pat: Optional[str] = None, number_of_docs: Optional[int] = None, api_base: Optional[str] = None)[source]¶
Clarifai AI vector store.
To use, you should have the clarifai p... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html |
891804a1d2c6-1 | Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ids])
Add texts to the Clarifai vectorstore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore init... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html |
891804a1d2c6-2 | similarity_search(query[, k])
Run similarity search using Clarifai.
similarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k, ...])
Run similarity ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html |
891804a1d2c6-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.clarifai.Clarifai.html |
891804a1d2c6-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.clarifai.Clarifai.html |
891804a1d2c6-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.clarifai.Clarifai.html |
891804a1d2c6-6 | False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Optional[Embeddings] = None, user_id: Optional[str] = None, app_id: Optional[str] = None, pat: Optional[str] = None, number_of_docs: Optional[int] = None, api_base: Optional[str] = None,... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html |
891804a1d2c6-7 | None. (Defaults to) –
api_base (Optional[str]) – API base. Defaults to None.
metadatas (Optional[List[dict]]) – Optional list of metadatas.
None. –
Returns
Clarifai vectorstore.
Return type
Clarifai
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → Lis... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html |
891804a1d2c6-8 | to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, **kwargs: Any... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html |
891804a1d2c6-9 | Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, filter: Optional[dict] = None, namespace: Optional[str] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Run similarity search with score using Clarifai.
Parameters
query (str) – Query text to search for... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html |
f73981315e47-0 | langchain.vectorstores.epsilla.Epsilla¶
class langchain.vectorstores.epsilla.Epsilla(client: Any, embeddings: Embeddings, db_path: Optional[str] = '/tmp/langchain-epsilla', db_name: Optional[str] = 'langchain_store')[source]¶
Wrapper around Epsilla vector database.
As a prerequisite, you need to install pyepsilla packa... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-1 | add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ...])
Embed texts and add them to the database.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-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, collection_name])
Return the documents that are semantically most relevant to the query.
similarity_search_by_vector(embedding[, k])... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-3 | Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, collection_name: Optional[str] = '', drop_old: Optional[bool] = False, **kwargs: Any) → List[str][source]¶
Embed texts and add them to the database.
Parameters
texts (Iterable[str]) – Th... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-4 | Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
Return VectorStoreRetriever initialized from this VectorStore.
Parameters
search_type (Optional[str]) – Defines the type of search that
the Retriever should perform.
Can be “similarity” (default), “mmr”, or
“s... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-5 | )
# Only get the single most similar document from the dataset
docsearch.as_retriever(search_kwargs={'k': 1})
# Use a filter to only retrieve documents from a specific paper
docsearch.as_retriever(
search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}}
)
async asearch(query: str, search_type: str, **kwa... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-6 | False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, client: Any = None, db_path: Optional[str] = '/tmp/langchain-epsilla', db_name: Optional[str] = 'langchain_store', collection_name: Optional[str] = 'langchain_collection', dr... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-7 | Returns
Epsilla vector store.
Return type
Epsilla
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, client: Any = None, db_path: Optional[str] = '/tmp/langchain-epsilla', db_name: Optional[str] = 'langchain_store', collection_name: Optional[str] = 'langchain_collect... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-8 | to retrieve data from.
If not provided, the default collection will be used.
response_fields (Optional[List[str]]) – List of field names in the result.
If not specified, all available fields will be responded.
Returns
A list of the retrieved data.
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20,... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-9 | to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, collection_na... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
f73981315e47-10 | filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶
Run similarity search with distance.
use_collection(collection_name: str) → None[source]¶
Set default collection to use.
Parameters
collect... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
210ea0d36b36-0 | langchain.vectorstores.vearch.Vearch¶
class langchain.vectorstores.vearch.Vearch(embedding_function: Embeddings, path_or_url: Optional[str] = None, table_name: str = 'langchain_vearch', db_name: str = 'cluster_client_db', flag: int = 1, **kwargs: Any)[source]¶
Initialize vearch vector store
flag 1 for cluster,0 for sta... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
210ea0d36b36-1 | 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 the documents which have the specified ids.
from_documents(... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
210ea0d36b36-2 | Initialize vearch vector store
flag 1 for cluster,0 for standalone
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the ad... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
210ea0d36b36-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.vearch.Vearch.html |
210ea0d36b36-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.vearch.Vearch.html |
210ea0d36b36-5 | False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, path_or_url: Optional[str] = None, table_name: str = 'langchain_vearch', db_name: str = 'cluster_client_db', flag: int = 1, **kwargs: Any) → Vearch[source]¶
Return Vearch Vec... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
210ea0d36b36-6 | 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.vectorstores.vearch.Vearch.html |
210ea0d36b36-7 | The most k similar documents and scores of the specified query.
:param embeddings: embedding vector of the query.
:param k: The k most similar documents to the text query.
:param min_score: the score of similar documents to the text query
Returns
The k most similar documents to the specified text query.
0 is dissimilar... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
c631cb165281-0 | langchain.vectorstores.sklearn.JsonSerializer¶
class langchain.vectorstores.sklearn.JsonSerializer(persist_path: str)[source]¶
Serializes data in json using the json package from python standard library.
Methods
__init__(persist_path)
extension()
The file extension suggested by this serializer (without dot).
load()
Loa... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.JsonSerializer.html |
68be13346316-0 | langchain.vectorstores.usearch.USearch¶
class langchain.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
embeddings
Access the ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.usearch.USearch.html |
68be13346316-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.usearch.USearch.html |
68be13346316-2 | 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 more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documen... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.usearch.USearch.html |
68be13346316-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.usearch.USearch.html |
68be13346316-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.usearch.USearch.html |
68be13346316-5 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[Dict]] = None, ids: Optional[ndarray] = None, metric: str = 'cos', **kwargs: Any) → USearch[source]¶
Construct USearch wrapper from raw documents.
This is a user friendl... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.usearch.USearch.html |
68be13346316-6 | 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.usearch.USearch.html |
68be13346316-7 | query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_wit... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.usearch.USearch.html |
9d1fab74a318-0 | langchain.vectorstores.zep.ZepVectorStore¶
class langchain.vectorstores.zep.ZepVectorStore(collection_name: str, api_url: str, *, api_key: Optional[str] = None, config: Optional[CollectionConfig] = None, embedding: Optional[Embeddings] = None)[source]¶
Zep vector store.
It provides methods for adding texts or documents... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html |
9d1fab74a318-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.zep.ZepVectorStore.html |
9d1fab74a318-2 | Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k, ...])
Run similarity search with distance.
__init__(collection_name: str, api_url: str, *, api_key: Optional[str] = None, config: Optional[CollectionConfig] = None, embedding: Optional[Embeddings] = None) → None[source]¶
async... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html |
9d1fab74a318-3 | document_ids – Optional list of document ids associated with the texts.
kwargs – vectorstore specific parameters
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 d... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html |
9d1fab74a318-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.zep.ZepVectorStore.html |
9d1fab74a318-5 | Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, metadata: Optional... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html |
9d1fab74a318-6 | Parameters
texts (List[str]) – The list of texts to add to the vectorstore.
embedding (Optional[Embeddings]) – Optional embedding function to use to
embed the texts.
metadatas (Optional[List[Dict[str, Any]]]) – Optional list of metadata
associated with the texts.
collection_name (str) – The name of the collection in th... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html |
9d1fab74a318-7 | 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, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal r... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html |
9d1fab74a318-8 | Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
metadata – Optional, metadata filter
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... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zep.ZepVectorStore.html |
53e447ad812b-0 | langchain.vectorstores.elasticsearch.ExactRetrievalStrategy¶
class langchain.vectorstores.elasticsearch.ExactRetrievalStrategy[source]¶
Exact retrieval strategy using the script_score query.
Methods
__init__()
before_index_setup(client, text_field, ...)
Executes before the index is created.
index(dims_length, vector_qu... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ExactRetrievalStrategy.html |
53e447ad812b-1 | fetch_k – The number of results to fetch initially.
vector_query_field – The field containing the vector
representations in the index.
text_field – The field containing the text data in the index.
filter – List of filter clauses to apply to the query.
similarity – The similarity strategy to use, or None if not using on... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ExactRetrievalStrategy.html |
977f68f1859f-0 | langchain.vectorstores.singlestoredb.SingleStoreDBRetriever¶
class langchain.vectorstores.singlestoredb.SingleStoreDBRetriever[source]¶
Bases: VectorStoreRetriever
Retriever for SingleStoreDB vector stores.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the inp... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDBRetriever.html |
977f68f1859f-1 | Default implementation of abatch, which calls ainvoke N times.
Subclasses should override this method if they can batch more efficiently.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Add documents to vectorstore.
async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Opt... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDBRetriever.html |
977f68f1859f-2 | Subclasses should override this method if they support streaming output.
async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names: Optional[Sequence[... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDBRetriever.html |
977f68f1859f-3 | Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
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, exclu... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDBRetriever.html |
977f68f1859f-4 | namespace is [“langchain”, “llms”, “openai”]
get_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[str] = None, **kwargs: Any) → List[Document]¶
Retrieve documents relevant to a query.
:param query: string to fi... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDBRetriever.html |
977f68f1859f-5 | classmethod lc_id() → List[str]¶
A unique identifier for this class for serialization purposes.
The unique identifier is a list of strings that describes the path
to the object.
map() → Runnable[List[Input], List[Output]]¶
Return a new Runnable that maps a list of inputs to a list of outputs,
by calling invoke() with e... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDBRetriever.html |
977f68f1859f-6 | classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
classmethod validate(value: Any) → Model¶
with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶
Bind config to a Runnable, returning a new Runna... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDBRetriever.html |
f92e05d6105a-0 | langchain.vectorstores.docarray.base.DocArrayIndex¶
class langchain.vectorstores.docarray.base.DocArrayIndex(doc_index: BaseDocIndex, embedding: Embeddings)[source]¶
Base class for DocArray based vector stores.
Initialize a vector store from DocArray’s DocIndex.
Attributes
doc_cls
embeddings
Access the query embedding ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
f92e05d6105a-1 | 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[, metadatas])
Return VectorStore initialized fr... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
f92e05d6105a-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.docarray.base.DocArrayIndex.html |
f92e05d6105a-3 | Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
Return VectorStoreRetriever initialized from this VectorStore.
Parameters
search_type (Optional[str]) – Defines the type of search that
the Retriever should perform.
Can be “similarity” (default), “mmr”, or
“s... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
f92e05d6105a-4 | )
# Only get the single most similar document from the dataset
docsearch.as_retriever(search_kwargs={'k': 1})
# Use a filter to only retrieve documents from a specific paper
docsearch.as_retriever(
search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}}
)
async asearch(query: str, search_type: str, **kwa... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
f92e05d6105a-5 | Return VectorStore initialized from texts and embeddings.
max_marginal_relevance_search(query: str, 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 relevance optimizes for similarity to query AN... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
f92e05d6105a-6 | 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.vectorstores.docarray.base.DocArrayIndex.html |
f92e05d6105a-7 | List of documents most similar to the query text and
cosine distance in float for each.
Lower score represents more similarity. | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
66a084be808e-0 | langchain.vectorstores.myscale.has_mul_sub_str¶
langchain.vectorstores.myscale.has_mul_sub_str(s: str, *args: Any) → bool[source]¶
Check if a string contains multiple substrings.
:param s: string to check.
:param *args: substrings to check.
Returns
True if all substrings are in the string, False otherwise. | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.has_mul_sub_str.html |
07e8a076488c-0 | langchain.vectorstores.sklearn.SKLearnVectorStore¶
class langchain.vectorstores.sklearn.SKLearnVectorStore(embedding: Embeddings, *, persist_path: Optional[str] = None, serializer: Literal['json', 'bson', 'parquet'] = 'json', metric: str = 'cosine', **kwargs: Any)[source]¶
Simple in-memory vector store based on the sci... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
07e8a076488c-1 | 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 ID or other criteria.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
07e8a076488c-2 | similarity_search(query[, k])
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 the range [0, 1].
similarity_search_with_score(query, *[, k])
Run similarity searc... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
07e8a076488c-3 | Parameters
texts – Iterable of strings to add to the vectorstore.
metadatas – Optional list of metadatas associated with the texts.
kwargs – vectorstore specific parameters
Returns
List of ids from adding the texts into the vectorstore.
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings,... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
07e8a076488c-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.sklearn.SKLearnVectorStore.html |
07e8a076488c-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.sklearn.SKLearnVectorStore.html |
07e8a076488c-6 | :param fetch_k: Number of Documents to fetch to pass to MMR algorithm.
:param 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 releva... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
07e8a076488c-7 | 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[Document, float]]¶
Return docs and relevance scores ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
e87fb9b0d95f-0 | langchain.vectorstores.pgvector.BaseModel¶
class langchain.vectorstores.pgvector.BaseModel(**kwargs: Any)[source]¶
Base model for the SQL stores.
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.pgvector.BaseModel.html |
2894a4b3eab6-0 | langchain.vectorstores.scann.ScaNN¶
class langchain.vectorstores.scann.ScaNN(embedding: Embeddings, index: Any, docstore: Docstore, index_to_docstore_id: Dict[int, str], relevance_score_fn: Optional[Callable[[float], float]] = None, normalize_L2: bool = False, distance_strategy: DistanceStrategy = DistanceStrategy.EUCL... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.ScaNN.html |
2894a4b3eab6-1 | Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Retu... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.ScaNN.html |
2894a4b3eab6-2 | search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k, filter, fetch_k])
Return docs most similar to query.
similarity_search_by_vector(embedding[, k, ...])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(que... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.ScaNN.html |
2894a4b3eab6-3 | (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, **kwargs: Any) → List[str][source]¶
Run more texts ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.ScaNN.html |
2894a4b3eab6-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.scann.ScaNN.html |
2894a4b3eab6-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.scann.ScaNN.html |
2894a4b3eab6-6 | Returns
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_embeddings(text_embeddings: List[... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.ScaNN.html |
2894a4b3eab6-7 | scann = ScaNN.from_texts(texts, embeddings)
classmethod load_local(folder_path: str, embedding: Embeddings, index_name: str = 'index', **kwargs: Any) → ScaNN[source]¶
Load ScaNN index, docstore, and index_to_docstore_id from disk.
Parameters
folder_path – folder path to load index, docstore,
and index_to_docstore_id fr... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.ScaNN.html |
2894a4b3eab6-8 | 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.vectorstores.scann.ScaNN.html |
2894a4b3eab6-9 | 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.
fetch_k – (Optional[int]) Number of Documents to fetch before filtering.
Defaults to 20.
Returns
List of Documents most similar to... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.ScaNN.html |
2894a4b3eab6-10 | L2 distance in float. Lower score represents more similarity.
similarity_search_with_score_by_vector(embedding: List[float], k: int = 4, filter: Optional[Dict[str, Any]] = None, fetch_k: int = 20, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return docs most similar to query.
Parameters
embedding – Embedding ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.scann.ScaNN.html |
d02dd37acaf2-0 | langchain.vectorstores.dingo.Dingo¶
class langchain.vectorstores.dingo.Dingo(embedding: Embeddings, text_key: str, *, client: Any = None, index_name: Optional[str] = None, host: Optional[List[str]] = None, user: str = 'root', password: str = '123123', self_id: bool = False)[source]¶
Dingo vector store.
To use, you shou... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dingo.Dingo.html |
d02dd37acaf2-1 | Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
Return VectorStoreRetriever initialized from this VectorStore.
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilar... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dingo.Dingo.html |
d02dd37acaf2-2 | Return Dingo documents most similar to query, along with scores.
__init__(embedding: Embeddings, text_key: str, *, client: Any = None, index_name: Optional[str] = None, host: Optional[List[str]] = None, user: str = 'root', password: str = '123123', self_id: bool = False)[source]¶
Initialize with Dingo client.
async aad... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dingo.Dingo.html |
d02dd37acaf2-3 | ids – Optional list of ids to associate with the texts.
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(te... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dingo.Dingo.html |
d02dd37acaf2-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.dingo.Dingo.html |
d02dd37acaf2-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) → Any[source]¶
Delete by vector IDs or filter.
:param ids: List of... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dingo.Dingo.html |
d02dd37acaf2-6 | texts,
embeddings,
index_name=”langchain-demo”
)
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, search_params: Optional[dict] = None, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimiz... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dingo.Dingo.html |
d02dd37acaf2-7 | Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, search_params: Optional[dict] = None, timeout: Optional[int] =... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dingo.Dingo.html |
d02dd37acaf2-8 | Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, search_params: Optional[dict] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return Dingo documents most similar to query, along with scores.
Parameters
query – Text to l... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dingo.Dingo.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.