id stringlengths 14 16 | text stringlengths 13 2.7k | source stringlengths 57 178 |
|---|---|---|
4e51e8e9a98f-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.FlatVectorField.html |
3f91a4fa0123-0 | langchain.vectorstores.tiledb.dependable_tiledb_import¶
langchain.vectorstores.tiledb.dependable_tiledb_import() → Any[source]¶
Import tiledb-vector-search if available, otherwise raise error. | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tiledb.dependable_tiledb_import.html |
8cda56f19dd4-0 | langchain.vectorstores.bageldb.Bagel¶
class langchain.vectorstores.bageldb.Bagel(cluster_name: str = 'langchain', client_settings: Optional[bagel.config.Settings] = None, embedding_function: Optional[Embeddings] = None, cluster_metadata: Optional[Dict] = None, client: Optional[bagel.Client] = None, relevance_score_fn: ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-2 | Return docs most similar to embedding vector.
similarity_search_by_vector_with_relevance_scores(...)
Return docs most similar to embedding vector and similarity score.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k, where])
Run... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-3 | Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, embeddings: Optional[List[List[float]]] = None, **kwargs: Any) → List[str][source]¶
Add texts along with their corresponding embeddings and optional
meta... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-6 | Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶
Run similarity search with distance asynchronously.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → None[source]¶
Delete by IDs.
Parameters
ids – List of ids to delet... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-7 | Returns
Bagel vectorstore.
Return type
Bagel
classmethod from_texts(texts: List[str], embedding: Optional[Embeddings] = None, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, cluster_name: str = 'langchain', client_settings: Optional[bagel.config.Settings] = None, cluster_metadata: Optional[Dict... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-9 | Run a similarity search with BagelDB.
Parameters
query (str) – The query text to search for similar documents/texts.
k (int) – The number of results to return.
where (Optional[Dict[str, str]]) – Metadata filters to narrow down.
Returns
List of documents objects representing
the documents most similar to the query text.... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
8cda56f19dd4-10 | Run a similarity search with BagelDB and return documents with their
corresponding similarity scores.
Parameters
query (str) – The query text to search for similar documents.
k (int) – The number of results to return.
where (Optional[Dict[str, str]]) – Filter using metadata.
Returns
List of tuples, each containing a
Do... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.bageldb.Bagel.html |
cfea4caa65e0-0 | langchain.vectorstores.momento_vector_index.MomentoVectorIndex¶
class langchain.vectorstores.momento_vector_index.MomentoVectorIndex(embedding: Embeddings, client: PreviewVectorIndexClient, index_name: str = 'default', distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, text_field: str = 'text', ensure_index... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-1 | DistanceStrategy.EUCLIDEAN_DISTANCE, Momento uses the squared
Euclidean distance.
text_field (str, optional) – The name of the metadata field to store the
original text in. Defaults to “text”.
ensure_index_exists (bool, optional) – Whether to ensure that the index
exists before adding documents to it. Defaults to True.... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-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 and relevance scores in the range [0, 1], asynchronously.
asimilarity_search_with_score(*args, **kwargs... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-3 | Initialize a Vector Store backed by Momento Vector Index.
Parameters
embedding (Embeddings) – The embedding function to use.
configuration (VectorIndexConfiguration) – The configuration to initialize
the Vector Index with.
credential_provider (CredentialProvider) – The credential provider to
authenticate the Vector Ind... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-4 | Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][source]¶
Run more texts through the embeddings and add to the vectorstore.
Parameters
texts (Iterable[str]) – Iterable of strings to add to the vectorstore.
me... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-5 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-6 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-7 | Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶
Run similarity search with distance asynchronously.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool][source]¶
Delete by vector ID.
Parameters
ids (List[... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-8 | use. Defaults to DistanceStrategy.COSINE. If you select
DistanceStrategy.EUCLIDEAN_DISTANCE, Momento uses the squared
Euclidean distance.
ensure_index_exists (-) – Whether to ensure that the index
exists before adding documents to it. Defaults to True.
key (Additionally you can either pass in a client or an API) –
cli... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-9 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
cfea4caa65e0-10 | Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the re... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.momento_vector_index.MomentoVectorIndex.html |
dfdd8f1059a2-0 | langchain.vectorstores.semadb.SemaDB¶
class langchain.vectorstores.semadb.SemaDB(collection_name: str, vector_size: int, embedding: Embeddings, distance_strategy: DistanceStrategy = DistanceStrategy.EUCLIDEAN_DISTANCE, api_key: str = '')[source]¶
SemaDB vector store.
This vector store is a wrapper around the SemaDB dat... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.semadb.SemaDB.html |
dfdd8f1059a2-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.semadb.SemaDB.html |
dfdd8f1059a2-2 | similarity_search_with_score(query[, k])
Run similarity search with distance.
__init__(collection_name: str, vector_size: int, embedding: Embeddings, distance_strategy: DistanceStrategy = DistanceStrategy.EUCLIDEAN_DISTANCE, api_key: str = '')[source]¶
Initialise the SemaDB vector store.
async aadd_documents(documents:... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.semadb.SemaDB.html |
dfdd8f1059a2-3 | False otherwise, None if not implemented.
Return type
Optional[bool]
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: O... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.semadb.SemaDB.html |
dfdd8f1059a2-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.semadb.SemaDB.html |
dfdd8f1059a2-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 and relevance scores in the range [0, 1], asynchronously.
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Docume... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.semadb.SemaDB.html |
dfdd8f1059a2-6 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = '', vector_size: int = 0, api_key: str = '', distance_strategy: DistanceStrategy = DistanceStrategy.EUCLIDEAN_DISTANCE, **kwargs: A... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.semadb.SemaDB.html |
dfdd8f1059a2-7 | fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
search(... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.semadb.SemaDB.html |
dfdd8f1059a2-8 | Run similarity search with distance. | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.semadb.SemaDB.html |
ea910d6e15a1-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
ea910d6e15a1-1 | Return docs most similar to query using specified search type.
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 and relevance scores in the range [0, 1]... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
ea910d6e15a1-2 | The most k similar documents and scores of the specified query.
__init__(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) → None[source]¶
Initialize vearch vector store
flag 1 for cluster,0 for stan... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
ea910d6e15a1-3 | Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[s... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
ea910d6e15a1-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
ea910d6e15a1-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 and relevance scores in the range [0, 1], asynchronously.
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Docume... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
ea910d6e15a1-6 | Return Vearch VectorStore
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, 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 VectorStore
get(ids... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
ea910d6e15a1-7 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
ea910d6e15a1-8 | 0 is dissimilar, 1 is the most similar.
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.... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vearch.Vearch.html |
650992553e71-0 | langchain.vectorstores.redis.schema.RedisVectorField¶
class langchain.vectorstores.redis.schema.RedisVectorField[source]¶
Bases: RedisField
Base class for Redis vector fields.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to for... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisVectorField.html |
650992553e71-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisVectorField.html |
650992553e71-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisVectorField.html |
443668ca5c99-0 | langchain.vectorstores.utils.maximal_marginal_relevance¶
langchain.vectorstores.utils.maximal_marginal_relevance(query_embedding: ndarray, embedding_list: list, lambda_mult: float = 0.5, k: int = 4) → List[int][source]¶
Calculate maximal marginal relevance. | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.utils.maximal_marginal_relevance.html |
ec31c323d41c-0 | langchain.vectorstores.pgembedding.PGEmbedding¶
class langchain.vectorstores.pgembedding.PGEmbedding(connection_string: str, embedding_function: Embeddings, collection_name: str = 'langchain', collection_metadata: Optional[dict] = None, pre_delete_collection: bool = False, logger: Optional[Logger] = None)[source]¶
Post... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
ec31c323d41c-1 | add_texts(texts[, metadatas, ids])
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 VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return Vecto... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
ec31c323d41c-2 | from_texts(texts, embedding[, metadatas, ...])
Return VectorStore initialized from texts and embeddings.
get_collection(session)
get_connection_string(kwargs)
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return doc... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
ec31c323d41c-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
ec31c323d41c-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
ec31c323d41c-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
ec31c323d41c-6 | **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)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, floa... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
ec31c323d41c-7 | Return VectorStore initialized from documents and embeddings.
classmethod from_embeddings(text_embeddings: List[Tuple[str, List[float]]], embedding: Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = 'langchain', ids: Optional[List[str]] = None, pre_delete_collection: bool = False, **kwargs: Any... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
ec31c323d41c-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
ec31c323d41c-9 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
53a78777821d-0 | langchain.vectorstores.redis.schema.NumericFieldSchema¶
class langchain.vectorstores.redis.schema.NumericFieldSchema[source]¶
Bases: RedisField
Schema for numeric fields in Redis.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.NumericFieldSchema.html |
53a78777821d-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.NumericFieldSchema.html |
53a78777821d-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.NumericFieldSchema.html |
f9253236cb33-0 | langchain.vectorstores.redis.base.RedisVectorStoreRetriever¶
class langchain.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 if the input data ca... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
f9253236cb33-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[... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
f9253236cb33-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, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, incl... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
f9253236cb33-3 | 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.
bind(**kwargs: Any) → Runnable[Input, Output]¶
Bind arguments to a Runnable, returning a new Runnable.
config_schema(*, include: Optional[Sequence[str]] = None) → Type[Bas... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
f9253236cb33-4 | Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep – set to True to make a deep co... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
f9253236cb33-5 | Get a pydantic model that can be used to validate output to the runnable.
Runnables that leverage the configurable_fields and configurable_alternatives
methods will have a dynamic output schema that depends on which
configuration the runnable is invoked with.
This method allows to get an output schema for a specific co... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
f9253236cb33-6 | Returns
The output of the runnable.
classmethod is_lc_serializable() → bool¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclu... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
f9253236cb33-7 | classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶
Default implementation of stream, which calls invoke.
Subclasses should override t... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
f9253236cb33-8 | fallback in order, upon failures.
with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶
Bind lifecycle listeners to a Runnable, returning a new Runnable.
on_start: Called before the runnable starts running, with the Run ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
f9253236cb33-9 | The type of output this runnable produces specified as a type annotation.
allowed_search_types: ClassVar[Collection[str]] = ['similarity', 'similarity_distance_threshold', 'similarity_score_threshold', 'mmr']¶
Allowed search types.
property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶
List... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.RedisVectorStoreRetriever.html |
29a7a100cfeb-0 | langchain.vectorstores.redis.filters.check_operator_misuse¶
langchain.vectorstores.redis.filters.check_operator_misuse(func: Callable) → Callable[source]¶
Decorator to check for misuse of equality operators. | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.filters.check_operator_misuse.html |
e8d96ab41cfd-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]¶
Distance metrics for Redis vector fields.
l2 = 'L2'¶
cosine = 'COSINE'¶
ip = 'IP'¶ | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisDistanceMetric.html |
ab0f915fcc9a-0 | langchain.vectorstores.pinecone.Pinecone¶
class langchain.vectorstores.pinecone.Pinecone(index: Any, embedding: Union[Embeddings, Callable], text_key: str, namespace: Optional[str] = None, distance_strategy: Optional[DistanceStrategy] = DistanceStrategy.COSINE)[source]¶
Pinecone vector store.
To use, you should have th... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-1 | afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retr... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-2 | Return docs most similar to query using specified search type.
similarity_search(query[, k, filter, namespace])
Return pinecone documents most similar to query.
similarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
similarity_search_by_vector_with_score(...)
Return pinecone documents... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-3 | Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, namespace: Optional[str] = None, batch_size: int = 32, embedding_chunk_size: int = 1000, **kwargs: Any) → List[str][source]¶
Run more texts through the e... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-4 | Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
Return VectorStore initialized from texts and embeddings.
async amax_marginal_relevance_search(query: str, k: int = 4, fetch_... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-5 | Return type
VectorStoreRetriever
Examples:
# Retrieve more documents with higher diversity
# Useful if your dataset has many similar documents
docsearch.as_retriever(
search_type="mmr",
search_kwargs={'k': 6, 'lambda_mult': 0.25}
)
# Fetch more documents for the MMR algorithm to consider
# But only return the t... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-6 | Return docs and relevance scores in the range [0, 1], asynchronously.
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-7 | Load pinecone vectorstore from index name.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, batch_size: int = 32, text_key: str = 'text', namespace: Optional[str] = None, index_name: Optional[str] = None, upsert_kwargs: Optional[dic... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-8 | Returns
Pinecone Index instance.
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, filter: Optional[dict] = None, namespace: Optional[str] = None, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevan... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-9 | 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, filter: Optional[dict] = None, namespace: Optional[str] = None... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
ab0f915fcc9a-10 | 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 resulting set of retrieved docs
Returns
List of Tuples o... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html |
50129d359b3d-0 | langchain.vectorstores.utils.DistanceStrategy¶
class langchain.vectorstores.utils.DistanceStrategy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enumerator of the Distance strategies for calculating distances
between vectors.
EUCLIDEAN_DISTANCE = 'EUCLIDEAN_DISTANCE'¶
MAX... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.utils.DistanceStrategy.html |
46ec4f771cdc-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 | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.sort_by_index_name.html |
982762b7183b-0 | langchain.vectorstores.tiledb.get_documents_array_uri_from_group¶
langchain.vectorstores.tiledb.get_documents_array_uri_from_group(group: Any) → str[source]¶ | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tiledb.get_documents_array_uri_from_group.html |
5d1649a84fe7-0 | langchain.vectorstores.meilisearch.Meilisearch¶
class langchain.vectorstores.meilisearch.Meilisearch(embedding: Embeddings, client: Optional[Client] = None, url: Optional[str] = None, api_key: Optional[str] = None, index_name: str = 'langchain-demo', text_key: str = 'text', metadata_key: str = 'metadata')[source]¶
Meil... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-1 | Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ids])
Run more text... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-2 | from_texts(texts, embedding[, metadatas, ...])
Construct Meilisearch wrapper from raw documents.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
search(query,... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-3 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-4 | Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
Return VectorStore initialized from texts and embeddings.
async amax_marginal_relevance_search(query: str, k: int = 4, fetch_... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-5 | Return type
VectorStoreRetriever
Examples:
# Retrieve more documents with higher diversity
# Useful if your dataset has many similar documents
docsearch.as_retriever(
search_type="mmr",
search_kwargs={'k': 6, 'lambda_mult': 0.25}
)
# Fetch more documents for the MMR algorithm to consider
# But only return the t... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-6 | Return docs and relevance scores in the range [0, 1], asynchronously.
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-7 | Embeds documents.
Adds the documents to a provided Meilisearch index.
This is intended to be a quick way to get started.
Example
from langchain.vectorstores import Meilisearch
from langchain.embeddings import OpenAIEmbeddings
import meilisearch
# The environment should be the one specified next to the API key
# in your... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-8 | 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 pass to MMR algorithm.
lambda_mult – Number between 0 and 1 t... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-9 | Defaults to None.
Returns
List of Documents most similar to the queryvector and score for each.
Return type
List[Document]
similarity_search_by_vector_with_scores(embedding: List[float], k: int = 4, filter: Optional[Dict[str, Any]] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return meilisearch docume... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
5d1649a84fe7-10 | Parameters
query (str) – Query text for which to find similar documents.
k (int) – Number of documents to return. Defaults to 4.
filter (Optional[Dict[str, str]]) – Filter by metadata.
Defaults to None.
Returns
List of Documents most similar to the query
text and score for each.
Return type
List[Document]
Examples usin... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
3e75efd417f0-0 | langchain.vectorstores.pgembedding.BaseModel¶
class langchain.vectorstores.pgembedding.BaseModel(**kwargs: Any)[source]¶
Base model for all 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 presen... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.BaseModel.html |
30140726d7bb-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
30140726d7bb-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.
adelete([ids])
Delete by vector ID or other criteria.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
30140726d7bb-2 | get([collection_name, response_fields])
Get the collection.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
search(query, search_type, **kwargs)
Return docs m... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.epsilla.Epsilla.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.