id stringlengths 14 15 | text stringlengths 13 2.7k | source stringlengths 60 181 |
|---|---|---|
762f6923c127-0 | langchain_community.vectorstores.analyticdb.AnalyticDB¶
class langchain_community.vectorstores.analyticdb.AnalyticDB(connection_string: str, embedding_function: Embeddings, embedding_dimension: int = 1536, collection_name: str = 'langchain_document', pre_delete_collection: bool = False, logger: Optional[Logger] = None,... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.analyticdb.AnalyticDB.html |
762f6923c127-1 | afrom_documents(documents, embedding, **kwargs)
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.
am... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.analyticdb.AnalyticDB.html |
762f6923c127-2 | search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k, filter])
Run similarity search with AnalyticDB with distance.
similarity_search_by_vector(embedding[, k, ...])
Return docs most similar to embedding vector.
similarity_search_with_relevance_s... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.analyticdb.AnalyticDB.html |
762f6923c127-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, batch_size: int = 500, **kwargs: Any) → List[str][source]¶
Run more texts through the embeddings and add to the vectorstore.
Parameters
texts – Iterable ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.analyticdb.AnalyticDB.html |
762f6923c127-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_community.vectorstores.analyticdb.AnalyticDB.html |
762f6923c127-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_community.vectorstores.analyticdb.AnalyticDB.html |
762f6923c127-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.
classmethod connection_string_from_db_params(driver: str, host: str, port: int, database: str, user: str, password: str) → ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.analyticdb.AnalyticDB.html |
762f6923c127-7 | Either pass it as a parameter
or set the PG_CONNECTION_STRING environment variable.
classmethod get_connection_string(kwargs: Dict[str, Any]) → str[source]¶
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 ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.analyticdb.AnalyticDB.html |
762f6923c127-8 | 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, **kwargs: Any) → List[Document]... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.analyticdb.AnalyticDB.html |
762f6923c127-9 | filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, filter: Optional[dict] = None) → List[Tuple[Document, float]][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.analyticdb.AnalyticDB.html |
0d380f48e0ee-0 | langchain_core.vectorstores.VectorStoreRetriever¶
class langchain_core.vectorstores.VectorStoreRetriever[source]¶
Bases: BaseRetriever
Base Retriever class for VectorStore.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a... | https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStoreRetriever.html |
0d380f48e0ee-1 | 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[Document], **kwargs: Any) → List[str][source]¶
Add documents to vector... | https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStoreRetriever.html |
0d380f48e0ee-2 | 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_types: Optional[Sequence[str]] = None, include_tags: Option... | https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStoreRetriever.html |
0d380f48e0ee-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_core.vectorstores.VectorStoreRetriever.html |
0d380f48e0ee-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_core.vectorstores.VectorStoreRetriever.html |
0d380f48e0ee-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_core.vectorstores.VectorStoreRetriever.html |
0d380f48e0ee-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_core.vectorstores.VectorStoreRetriever.html |
0d380f48e0ee-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_core.vectorstores.VectorStoreRetriever.html |
0d380f48e0ee-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_core.vectorstores.VectorStoreRetriever.html |
0d380f48e0ee-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_core.vectorstores.VectorStoreRetriever.html |
f515a04aa05c-0 | langchain_community.vectorstores.astradb.AstraDB¶
class langchain_community.vectorstores.astradb.AstraDB(*, embedding: Embeddings, collection_name: str, token: Optional[str] = None, api_endpoint: Optional[str] = None, astra_db_client: Optional[Any] = None, namespace: Optional[str] = None, metric: Optional[str] = None, ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-1 | api_endpoint (Optional[str]): full URL to the API endpoint,
such as "https://<DB-ID>-us-east1.apps.astra.datastax.com".
astra_db_client (Optional[Any]): *alternative to token+api_endpoint*,
you can pass an already-created 'astrapy.db.AstraDB' instance.
namespace (Optional[str]): namespace (aka k... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-2 | bulk_insert_batch_concurrency = 80
bulk_insert_overwrite_concurrency = 10
A bit of experimentation is required to nail the best results here,
depending on both the machine/network specs and the expected workload
(specifically, how often a write is an update of an existing id).
Remember you can pass concurrency sett... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-3 | 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.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs an... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-4 | max_marginal_relevance_search(query[, k, ...])
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. :type query: str :param k: Number of Documents to return. :ty... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-5 | Run similarity search with distance.
similarity_search_with_score_by_vector(embedding)
Return docs most similar to embedding vector.
similarity_search_with_score_id(query[, k, ...])
similarity_search_with_score_id_by_vector(...)
Return docs most similar to embedding vector.
__init__(*, embedding: Embeddings, collection... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-6 | 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, *, batch_size: Optional[int] = None, batch_concurrency: Optional[int] = None, overwrite_concurrency: Optional[int] = None, **kwargs: Any) → List[str][sou... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-7 | Returns
List of ids of the added texts.
Return type
List[str]
async adelete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool]¶
Delete by vector ID or other criteria.
Parameters
ids – List of ids to delete.
**kwargs – Other keyword arguments that subclasses might use.
Returns
True if deletion is successfu... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-8 | “similarity_score_threshold”.
search_kwargs (Optional[Dict]) – Keyword arguments to pass to the
search function. Can include things like:
k: Amount of documents to return (Default: 4)
score_threshold: Minimum relevance threshold
for similarity_score_threshold
fetch_k: Amount of documents to pass to MMR algorithm (Defau... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-9 | 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 query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embeddin... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-10 | Return type
Optional[bool]
delete_by_document_id(document_id: str) → bool[source]¶
Remove a single document from the store, given its document_id (str).
Return True if a document has indeed been deleted, False if ID not found.
delete_collection() → None[source]¶
Completely delete the collection from the database (as op... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-11 | Returns
an AstraDb vectorstore.
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, filter: Optional[Dict[str, str]] = None, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similar... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-12 | 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[str, str]] = None, **kwargs: Any) → List[Document][source... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
f515a04aa05c-13 | Run similarity search with distance.
similarity_search_with_score_by_vector(embedding: List[float], k: int = 4, filter: Optional[Dict[str, str]] = None) → List[Tuple[Document, float]][source]¶
Return docs most similar to embedding vector.
Parameters
embedding (str) – Embedding to look up documents similar to.
k (int) –... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.astradb.AstraDB.html |
36e69dad61d1-0 | langchain_community.vectorstores.redis.schema.HNSWVectorField¶
class langchain_community.vectorstores.redis.schema.HNSWVectorField[source]¶
Bases: RedisVectorField
Schema for HNSW vector fields in Redis.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.HNSWVectorField.html |
36e69dad61d1-1 | 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 copy of the model
Returns
new model instance
dict(*, i... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.HNSWVectorField.html |
36e69dad61d1-2 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.HNSWVectorField.html |
935ddfe4ef17-0 | langchain_community.vectorstores.singlestoredb.SingleStoreDB¶
class langchain_community.vectorstores.singlestoredb.SingleStoreDB(embedding: Embeddings, *, distance_strategy: DistanceStrategy = DistanceStrategy.DOT_PRODUCT, table_name: str = 'embeddings', content_field: str = 'content', metadata_field: str = 'metadata',... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-1 | Defaults to “vector”.
pool (Following arguments pertain to the connection) –
pool_size (int, optional) – Determines the number of active connections in
the pool. Defaults to 5.
max_overflow (int, optional) – Determines the maximum number of connections
allowed beyond the pool_size. Defaults to 10.
timeout (float, opti... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-2 | Automatically enabled if ssl_ca is specified.
ssl_verify_identity (bool, optional) – Verifies the server’s identity.
conv (dict[int, Callable], optional) – A dictionary of data conversion
functions.
credential_type (str, optional) – Specifies the type of authentication to
use: auth.PASSWORD, auth.JWT, or auth.BROWSER_S... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-3 | vectorstore = SingleStoreDB(OpenAIEmbeddings())
Attributes
embeddings
Access the query embedding object if available.
Methods
__init__(embedding, *[, distance_strategy, ...])
Initialize with necessary components.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
a... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-4 | Run similarity search with distance asynchronously.
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, ...])
Create a SingleStoreDB vectorstore from raw documents. This... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-5 | Initialize with necessary components.
Parameters
embedding (Embeddings) – A text embedding model.
distance_strategy (DistanceStrategy, optional) – Determines the strategy employed for calculating
the distance between vectors in the embedding space.
Defaults to DOT_PRODUCT.
Available options are:
- DOT_PRODUCT: Computes... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-6 | connections, 80 for HTTP connections, and 443 for HTTPS connections.
database (str, optional) – Database name.
the (Additional optional arguments provide further customization over) –
connection –
pure_python (bool, optional) – Toggles the connector mode. If True,
operates in pure Python mode.
local_infile (bool, opt... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-7 | vectorstore = SingleStoreDB(
OpenAIEmbeddings(),
host="https://user:password@127.0.0.1:3306/database"
)
Advanced Usage:
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import SingleStoreDB
vectorstore = SingleStoreDB(
OpenAIEmbeddings(),
distance_strateg... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-8 | (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, embeddings: Optional[List[List[float]]] = None, **kwargs: Any) → List[str][source]¶
Add more texts to the vectorstore.
... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-9 | 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_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-10 | 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_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-11 | 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]¶
Delete by vector ID or other criteria.
Parameters
... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-12 | Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-13 | Returns the most similar indexed documents to the query text.
Uses cosine similarity.
Parameters
query (str) – The query text for which to find similar documents.
k (int) – The number of documents to return. Default is 4.
filter (dict) – A dictionary of metadata fields and values to filter by.
Returns
A list of documen... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
935ddfe4ef17-14 | k – Number of Documents to return. Defaults to 4.
filter – A dictionary of metadata fields and values to filter by.
Defaults to None.
Returns
List of Documents most similar to the query and score for each
Examples using SingleStoreDB¶
SingleStoreDB | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.singlestoredb.SingleStoreDB.html |
d61052cb1ed0-0 | langchain_community.vectorstores.tair.Tair¶
class langchain_community.vectorstores.tair.Tair(embedding_function: Embeddings, url: str, index_name: str, content_key: str = 'content', metadata_key: str = 'metadata', search_params: Optional[dict] = None, **kwargs: Any)[source]¶
Tair vector store.
Attributes
embeddings
Acc... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tair.Tair.html |
d61052cb1ed0-1 | 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.
create_index_if_not_exist(dim, ...)
delete([ids])
Delete ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tair.Tair.html |
d61052cb1ed0-2 | 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 added texts.
Return type
List[str]
async aadd_texts(texts: Iterable[s... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tair.Tair.html |
d61052cb1ed0-3 | 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_community.vectorstores.tair.Tair.html |
d61052cb1ed0-4 | )
# 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_community.vectorstores.tair.Tair.html |
d61052cb1ed0-5 | **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... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tair.Tair.html |
d61052cb1ed0-6 | Connect to an existing Tair index.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, index_name: str = 'langchain', content_key: str = 'content', metadata_key: str = 'metadata', **kwargs: Any) → Tair[source]¶
Return VectorStore initialized from texts and embeddings.... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tair.Tair.html |
d61052cb1ed0-7 | 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(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Re... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tair.Tair.html |
d61052cb1ed0-8 | 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.
Examples using Tair¶
Tair | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tair.Tair.html |
4633a3c8958f-0 | langchain_community.vectorstores.redis.schema.RedisVectorField¶
class langchain_community.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 can... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.RedisVectorField.html |
4633a3c8958f-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.RedisVectorField.html |
4633a3c8958f-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.RedisVectorField.html |
22c7db9822ef-0 | langchain_community.vectorstores.myscale.MyScaleWithoutJSON¶
class langchain_community.vectorstores.myscale.MyScaleWithoutJSON(embedding: Embeddings, config: Optional[MyScaleSettings] = None, must_have_cols: List[str] = [], **kwargs: Any)[source]¶
MyScale vector store without metadata column
This is super handy if you ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleWithoutJSON.html |
22c7db9822ef-1 | amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
Return VectorStoreRetriever initialized from this VectorStore.
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleWithoutJSON.html |
22c7db9822ef-2 | similarity_search_with_score(*args, **kwargs)
Run similarity search with distance.
__init__(embedding: Embeddings, config: Optional[MyScaleSettings] = None, must_have_cols: List[str] = [], **kwargs: Any) → None[source]¶
Building a myscale vector store without metadata column
embedding (Embeddings): embedding model
conf... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleWithoutJSON.html |
22c7db9822ef-3 | Parameters
texts – Iterable of strings to add to the vectorstore.
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, **k... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleWithoutJSON.html |
22c7db9822ef-4 | 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]) – Keyword arguments to pass to the
search function. Can include things like:
k: Amount of documents to return (Defa... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleWithoutJSON.html |
22c7db9822ef-5 | 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 using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
R... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleWithoutJSON.html |
22c7db9822ef-6 | Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
drop() → None¶
Helper function: Drop data
escape_str(value: str) → str¶
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from docu... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleWithoutJSON.html |
22c7db9822ef-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.MyScaleWithoutJSON.html |
22c7db9822ef-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.MyScaleWithoutJSON.html |
22c7db9822ef-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.MyScaleWithoutJSON.html |
5845f3d06945-0 | langchain_community.vectorstores.azuresearch.AzureSearch¶
class langchain_community.vectorstores.azuresearch.AzureSearch(azure_search_endpoint: str, azure_search_key: str, index_name: str, embedding_function: Callable, search_type: str = 'hybrid', semantic_configuration_name: Optional[str] = None, semantic_query_langua... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-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_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-2 | Return docs most similar to query with an hybrid query.
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].
similari... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-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_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-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_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-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_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-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) → Optional[bool]¶
Delete by vector ID or other criteria.
Parameters
... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-7 | Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query and score for each
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return doc... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-8 | 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.
semantic_hybrid_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Returns the most... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-9 | Return docs most similar to query.
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azuresearch.AzureSearch.html |
5845f3d06945-10 | 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 similar to the query and score for each
Examples using AzureSearch¶
Azure Cognitive Search | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azuresearch.AzureSearch.html |
5dd4fa6ff13d-0 | langchain_community.vectorstores.lancedb.LanceDB¶
class langchain_community.vectorstores.lancedb.LanceDB(connection: Any, embedding: Embeddings, vector_key: Optional[str] = 'vector', id_key: Optional[str] = 'id', text_key: Optional[str] = 'text')[source]¶
LanceDB vector store.
To use, you should have lancedb python pac... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.lancedb.LanceDB.html |
5dd4fa6ff13d-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_community.vectorstores.lancedb.LanceDB.html |
5dd4fa6ff13d-2 | similarity_search_with_score(*args, **kwargs)
Run similarity search with distance.
__init__(connection: Any, embedding: Embeddings, vector_key: Optional[str] = 'vector', id_key: Optional[str] = 'id', text_key: Optional[str] = 'text')[source]¶
Initialize with Lance DB connection
async aadd_documents(documents: List[Docu... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.lancedb.LanceDB.html |
5dd4fa6ff13d-3 | Delete by vector ID or other criteria.
Parameters
ids – List of ids to delete.
**kwargs – Other keyword arguments that subclasses might use.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
async classmethod afrom_documents(documents: List[Document], embedding... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.lancedb.LanceDB.html |
5dd4fa6ff13d-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_community.vectorstores.lancedb.LanceDB.html |
5dd4fa6ff13d-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 and r... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.lancedb.LanceDB.html |
5dd4fa6ff13d-6 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, connection: Any = None, vector_key: Optional[str] = 'vector', id_key: Optional[str] = 'id', text_key: Optional[str] = 'text', **kwargs: Any) → LanceDB[sou... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.lancedb.LanceDB.html |
5dd4fa6ff13d-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(... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.lancedb.LanceDB.html |
5dd4fa6ff13d-8 | 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.
Examples using LanceDB¶
LanceDB | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.lancedb.LanceDB.html |
737e603f8c23-0 | langchain_community.vectorstores.redis.schema.FlatVectorField¶
class langchain_community.vectorstores.redis.schema.FlatVectorField[source]¶
Bases: RedisVectorField
Schema for flat vector fields in Redis.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.FlatVectorField.html |
737e603f8c23-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.FlatVectorField.html |
737e603f8c23-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.FlatVectorField.html |
4f3064ac4e2d-0 | langchain_community.vectorstores.xata.XataVectorStore¶
class langchain_community.vectorstores.xata.XataVectorStore(api_key: str, db_url: str, embedding: Embeddings, table_name: str)[source]¶
Xata vector store.
It assumes you have a Xata database
created with the right schema. See the guide at:
https://integrations.lang... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.xata.XataVectorStore.html |
4f3064ac4e2d-1 | 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.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs an... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.xata.XataVectorStore.html |
4f3064ac4e2d-2 | Initialize with Xata client.
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 added texts.
Return type
List[str]
async... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.xata.XataVectorStore.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.