id stringlengths 14 15 | text stringlengths 35 2.51k | source stringlengths 61 154 |
|---|---|---|
7fd9d4a411bb-4 | Construct OpenSearchVectorSearch wrapper from raw documents.
Example
from langchain import OpenSearchVectorSearch
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
opensearch_vector_search = OpenSearchVectorSearch.from_texts(
texts,
embeddings,
opensearch_url="http://localhos... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html |
7fd9d4a411bb-5 | Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html |
7fd9d4a411bb-6 | Return docs most similar to query.
By default, supports Approximate Search.
Also supports Script Scoring and Painless Scripting.
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.
Optional Args:vector_field: Doc... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html |
7fd9d4a411bb-7 | pre_filter: script_score query to pre-filter documents before identifying
nearest neighbors; default: {“match_all”: {}}
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 sim... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html |
0fb9fad24615-0 | langchain.vectorstores.elastic_vector_search.ElasticKnnSearch¶
class langchain.vectorstores.elastic_vector_search.ElasticKnnSearch(index_name: str, embedding: Embeddings, es_connection: Optional['Elasticsearch'] = None, es_cloud_id: Optional[str] = None, es_user: Optional[str] = None, es_password: Optional[str] = None,... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
0fb9fad24615-1 | Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ...])
Run more texts through the embeddings and add to the vectorstore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadata... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
0fb9fad24615-2 | Performs a k-nearest neighbor (k-NN) search on the Elasticsearch index.
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)
R... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
0fb9fad24615-3 | Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, refresh_indices: bool = True, ids: Optional[List[str]] = None, **kwargs: Any) → List[str]¶
Run more texts through the embeddings and add to the vectorstore.
Parameters
texts – Iterable o... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
0fb9fad24615-4 | 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.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
0fb9fad24615-5 | from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
elastic_vector_search = ElasticVectorSearch.from_texts(
texts,
embeddings,
elasticsearch_url="http://localhost:9200"
)
knn_hybrid_search(query: Optional[str] = None, k: Optional[int] = 10, query_vector: Optional[List[float]] =... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
0fb9fad24615-6 | knn_boost – The boost factor for the k-NN part of the search.
query_boost – The boost factor for the text-based part of the search.
fields – The fields to include in the source of each hit. If None, all fields are
included. Defaults to None.
vector_query_field – Field name to use in knn search if not default ‘vector’
q... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
0fb9fad24615-7 | size – The number of search hits to return. Defaults to 10.
source – Whether to include the source of each hit in the results.
fields – The fields to include in the source of each hit. If None, all
fields are included.
vector_query_field – Field name to use in knn search if not default ‘vector’
Returns
The search resul... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
0fb9fad24615-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.elastic_vector_search.ElasticKnnSearch.html |
0fb9fad24615-9 | 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_with_score(query: str, k: int = 4, filter: Optional[dict] = None, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html |
c7dadc343456-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]¶
Bases: VectorStore
A simple in-memory vector s... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
c7dadc343456-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.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas, ...])
Re... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
c7dadc343456-2 | 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])
async aadd_documents(documents: List[Document], **... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
c7dadc343456-3 | Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
Return VectorStore initialized from texts and embeddings.
async amax_marginal_relevance_search(query: str, k: int = 4, fetch_... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
c7dadc343456-4 | Parameters
ids – List of ids to delete.
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.
classmetho... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
c7dadc343456-5 | Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
:param embedding: Embedding to look up documents similar to.
:param k: Number of Documents to return. Defaults to 4.
:param fetch_k: Number of Documents to fetch to pass to MMR algorithm.
:param lambda_mult: Number betw... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
c7dadc343456-6 | filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, *, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶ | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
b1fb3ac3f56e-0 | langchain.vectorstores.tair.Tair¶
class langchain.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]¶
Bases: VectorStore
Wrapper around Tair Vector store.
Methods
__i... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tair.Tair.html |
b1fb3ac3f56e-1 | create_index_if_not_exist(dim, ...)
delete(ids)
Delete by vector ID.
drop_index([index_name])
Drop an existing index.
from_documents(documents, embedding[, ...])
Return VectorStore initialized from documents and embeddings.
from_existing_index(embedding[, index_name, ...])
Connect to an existing Tair index.
from_texts(... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tair.Tair.html |
b1fb3ac3f56e-2 | Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][source]¶
Ad... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tair.Tair.html |
b1fb3ac3f56e-3 | 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.tair.Tair.html |
b1fb3ac3f56e-4 | 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.vectorstores.tair.Tair.html |
b1fb3ac3f56e-5 | 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.vectorstores.tair.Tair.html |
b1fb3ac3f56e-6 | filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score) | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tair.Tair.html |
ffbc91e68cc4-0 | langchain.vectorstores.clickhouse.ClickhouseSettings¶
class langchain.vectorstores.clickhouse.ClickhouseSettings(_env_file: Optional[Union[str, PathLike, List[Union[str, PathLike]], Tuple[Union[str, PathLike], ...]]] = '<object object>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = N... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.ClickhouseSettings.html |
ffbc91e68cc4-1 | table (str) : Table name to operate on.
Defaults to ‘vector_table’.
metric (str)Metric to compute distance,supported are (‘angular’, ‘euclidean’, ‘manhattan’, ‘hamming’,
‘dot’). Defaults to ‘angular’.
https://github.com/spotify/annoy/blob/main/src/annoymodule.cc#L149-L169
column_map (Dict)Column type map to project col... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.ClickhouseSettings.html |
ffbc91e68cc4-2 | model Config[source]¶
Bases: object
env_file = '.env'¶
env_file_encoding = 'utf-8'¶
env_prefix = 'clickhouse_'¶ | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.ClickhouseSettings.html |
58a3e6a445c6-0 | langchain.vectorstores.starrocks.get_named_result¶
langchain.vectorstores.starrocks.get_named_result(connection: Any, query: str) → List[dict[str, Any]][source]¶
Get a named result from a query.
:param connection: The connection to the database
:param query: The query to execute
Returns
The result of the query
Return t... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.get_named_result.html |
746345447ed0-0 | langchain.vectorstores.sklearn.JsonSerializer¶
class langchain.vectorstores.sklearn.JsonSerializer(persist_path: str)[source]¶
Bases: BaseSerializer
Serializes data in json using the json package from python standard library.
Methods
__init__(persist_path)
extension()
The file extension suggested by this serializer (wi... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.JsonSerializer.html |
a03d20dae571-0 | langchain.vectorstores.atlas.AtlasDB¶
class langchain.vectorstores.atlas.AtlasDB(name: str, embedding_function: Optional[Embeddings] = None, api_key: Optional[str] = None, description: str = 'A description for your project', is_public: bool = True, reset_project_if_exists: bool = False)[source]¶
Bases: VectorStore
Wrap... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
a03d20dae571-1 | Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ids, refresh])
Run more texts through the embeddings and add to the vectorstore.
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.atlas.AtlasDB.html |
a03d20dae571-2 | similarity_search(query[, k])
Run similarity search with AtlasDB
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].
async aadd_documents(documents: List[Document], **kwargs: Any) →... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
a03d20dae571-3 | Default True.
Returns
List of IDs of the added texts.
Return type
List[str]
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, metad... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
a03d20dae571-4 | Return docs most similar to query.
create_index(**kwargs: Any) → Any[source]¶
Creates an index in your project.
See
https://docs.nomic.ai/atlas_api.html#nomic.project.AtlasProject.create_index
for full detail.
delete(ids: List[str]) → Optional[bool]¶
Delete by vector ID.
Parameters
ids – List of ids to delete.
Returns
... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
a03d20dae571-5 | index_kwargs (Optional[dict]) – Dict of kwargs for index creation.
See https://docs.nomic.ai/atlas_api.html
Returns
Nomic’s neural database and finest rhizomatic instrument
Return type
AtlasDB
classmethod from_texts(texts: List[str], embedding: Optional[Embeddings] = None, metadatas: Optional[List[dict]] = None, ids: O... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
a03d20dae571-6 | Returns
Nomic’s neural database and finest rhizomatic instrument
Return type
AtlasDB
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for sim... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
a03d20dae571-7 | 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 AtlasDB
Parameters
query (str) – Query text to search for.
k (int) – Number of results to return. Defaults to 4.
Returns
List of documents most sim... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
464d295e40e8-0 | langchain.vectorstores.redis.Redis¶
class langchain.vectorstores.redis.Redis(redis_url: str, index_name: str, embedding_function: ~typing.Callable, content_key: str = 'content', metadata_key: str = 'metadata', vector_key: str = 'content_vector', relevance_score_fn: ~typing.Optional[~typing.Callable[[float], float]] = <... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.Redis.html |
464d295e40e8-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)
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
R... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.Redis.html |
464d295e40e8-2 | 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 most similar to query using specified search type.
similarity... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.Redis.html |
464d295e40e8-3 | 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, batch_size: int = 1000, **kwargs: Any) → List[str][source]¶
Add more texts to the vectorstore.
Parameters
texts (Iterable[str]) – Iterable... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.Redis.html |
464d295e40e8-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) → RedisVector... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.Redis.html |
464d295e40e8-5 | Returns
Whether or not the drop was successful.
Return type
bool
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_existing_index(embedding: Embeddings, index_name: str, content_key: str = 'co... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.Redis.html |
464d295e40e8-6 | Adds the documents to the newly created Redis index.
Returns the keys of the newly created documents.
This is intended to be a quick way to get started.
.. rubric:: Example
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs sel... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.Redis.html |
464d295e40e8-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, **kwargs: Any) → List[Document][source]¶
Returns the most simi... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.Redis.html |
464d295e40e8-8 | :param :
:param the smaller the angle:
:param the higher the similarity.:
Returns
A list of documents that are most similar to the query text,
including the match score for each document.
Return type
List[Document]
Note
If there are no documents that satisfy the score_threshold value,
an empty list is returned.
similar... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.Redis.html |
8fdf10a9d2b5-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. | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.utils.maximal_marginal_relevance.html |
ca57076be4ae-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 |
fb089540d155-0 | langchain.vectorstores.vectara.VectaraRetriever¶
class langchain.vectorstores.vectara.VectaraRetriever(*, vectorstore: Vectara, search_type: str = 'similarity', search_kwargs: dict = None)[source]¶
Bases: VectorStoreRetriever
Create a new model by parsing and validating input data from keyword arguments.
Raises Validat... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
fb089540d155-1 | Asynchronously get documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
Returns
List of relevant documents
get_relevant_documents(query: str, *, callbacks: Callbacks = None, **kwargs: Any) → List[Document]¶
Retrieve documents relevant... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
88045e737c7a-0 | langchain.vectorstores.hologres.Hologres¶
class langchain.vectorstores.hologres.Hologres(connection_string: str, embedding_function: Embeddings, ndims: int = 1536, table_name: str = 'langchain_pg_embedding', pre_delete_table: bool = False, logger: Optional[Logger] = None)[source]¶
Bases: VectorStore
VectorStore impleme... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html |
88045e737c7a-1 | 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_retriever(**kwargs)
asearch(query, search_type,... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html |
88045e737c7a-2 | similarity_search(query[, k, filter])
Run similarity search with Hologres with distance.
similarity_search_by_vector(embedding[, k, ...])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html |
88045e737c7a-3 | kwargs – vectorstore specific parameters
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶
Run more texts through the embeddings and add to the vectorstore.
Parameters
texts – Iterable of strings to add to the vectorstore.
metada... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html |
88045e737c7a-4 | 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.vectorstores.hologres.Hologres.html |
88045e737c7a-5 | “Either pass it as a parameter
or set the HOLOGRES_CONNECTION_STRING environment variable.
classmethod from_embeddings(text_embeddings: List[Tuple[str, List[float]]], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ndims: int = 1536, table_name: str = 'langchain_pg_embedding', ids: Optional[List[str]] = ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html |
88045e737c7a-6 | Return VectorStore initialized from texts and embeddings.
Postgres connection string is required
“Either pass it as a parameter
or set the HOLOGRES_CONNECTION_STRING environment variable.
classmethod get_connection_string(kwargs: Dict[str, Any]) → str[source]¶
max_marginal_relevance_search(query: str, k: int = 4, fetch... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html |
88045e737c7a-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, filter: Optional[dict] = None, **kwargs: Any) → List[Document]... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.hologres.Hologres.html |
88045e737c7a-8 | 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.vectorstores.hologres.Hologres.html |
e14504155518-0 | langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch¶
class langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch(doc_index: BaseDocIndex, embedding: Embeddings)[source]¶
Bases: DocArrayIndex
Wrapper around in-memory storage for exact search.
To use it, you should have the docarray package with v... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
e14504155518-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.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
e14504155518-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.in_memory.DocArrayInMemorySearch.html |
e14504155518-3 | Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
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) → Lis... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
e14504155518-4 | Defaults to “cosine_sim”.
**kwargs – Other keyword arguments to be passed to the get_doc_cls method.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[Dict[Any, Any]]] = None, **kwargs: Any) → DocArrayInMemorySearch[source]¶
Create an DocArrayInMemorySearch store and insert data.
... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
e14504155518-5 | Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevan... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
e14504155518-6 | Returns
List of Documents most similar to the query vector.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to re... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
91132ea32b8b-0 | langchain.vectorstores.redis.RedisVectorStoreRetriever¶
class langchain.vectorstores.redis.RedisVectorStoreRetriever(*, vectorstore: Redis, search_type: str = 'similarity', search_kwargs: dict = None, k: int = 4, score_threshold: float = 0.4)[source]¶
Bases: VectorStoreRetriever, BaseModel
Create a new model by parsing... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.RedisVectorStoreRetriever.html |
91132ea32b8b-1 | model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.RedisVectorStoreRetriever.html |
b5246c4c1136-0 | langchain.vectorstores.azuresearch.AzureSearch¶
class langchain.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_language: str = 'en-us', *... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
b5246c4c1136-1 | Return docs most similar to query.
delete(ids)
Delete by vector ID.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas, ...])
Return VectorStore initialized from texts and embeddings.
hybrid_search(query[, k])
Returns the ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
b5246c4c1136-2 | (List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(docu... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
b5246c4c1136-3 | Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
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) → Lis... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
b5246c4c1136-4 | Returns the most similar indexed documents to the query text.
Parameters
query (str) – The query text for which to find similar documents.
k (int) – The number of documents to return. Default is 4.
Returns
A list of documents that are most similar to the query text.
Return type
List[Document]
hybrid_search_with_score(q... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
b5246c4c1136-5 | 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.azuresearch.AzureSearch.html |
b5246c4c1136-6 | 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.vectorstores.azuresearch.AzureSearch.html |
b5246c4c1136-7 | k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query and score for each | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
249cd9d129bb-0 | langchain.vectorstores.milvus.Milvus¶
class langchain.vectorstores.milvus.Milvus(embedding_function: Embeddings, collection_name: str = 'LangChainCollection', connection_args: Optional[dict[str, Any]] = None, consistency_level: str = 'Session', index_params: Optional[dict] = None, search_params: Optional[dict] = None, ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-1 | “https://ok.s3.south.com:19530”.
host (str): The host of Milvus instance. Default at “localhost”,PyMilvus will fill in the default host if only port is provided.
port (str/int): The port of Milvus instance. Default at 19530, PyMilvuswill fill in the default port if only host is provided.
user (str): Use which user to c... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-2 | here are a few of the options:
address (str): The actual address of Milvusinstance. Example address: “localhost:19530”
uri (str): The uri of Milvus instance. Example uri:“http://randomwebsite:19530”,
“tcp:foobarsite:19530”,
“https://ok.s3.south.com:19530”.
host (str): The host of Milvus instance. Default at “localhost”... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-3 | aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, timeout, ...])
Insert text data into Milvus.
afrom_documents(documents, embedding, **kwar... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-4 | search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k, param, expr, ...])
Perform a similarity search against the query string.
similarity_search_by_vector(embedding[, k, ...])
Perform a similarity search against the query string.
similarity_sear... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-5 | Insert text data into Milvus.
Inserting data when the collection has not be made yet will result
in creating a new Collection. The data of the first entity decides
the schema of the new collection, the dim is extracted from the first
embedding and the columns are decided by the first metadata dict.
Metada keys will nee... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-6 | 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.milvus.Milvus.html |
249cd9d129bb-7 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = 'LangChainCollection', connection_args: dict[str, Any] = {'host': 'localhost', 'password': '', 'port': '19530', 'secure': False, 'u... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-8 | Returns
Milvus Vector Store
Return type
Milvus
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document][source]¶
Perform a search and return results that are... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-9 | Parameters
embedding (str) – The embedding vector being searched.
k (int, optional) – How many results to give. Defaults to 4.
fetch_k (int, optional) – Total results to select k from.
Defaults to 20.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-10 | Returns
Document results for search.
Return type
List[Document]
similarity_search_by_vector(embedding: List[float], k: int = 4, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document][source]¶
Perform a similarity search against the query string.
Paramete... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-11 | Perform a search on a query string and return results with score.
For more information about the search parameters, take a look at the pymilvus
documentation found here:
https://milvus.io/api-reference/pymilvus/v2.2.6/Collection/search().md
Parameters
query (str) – The text being searched.
k (int, optional) – The amoun... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
249cd9d129bb-12 | Defaults to None.
kwargs – Collection.search() keyword arguments.
Returns
Result doc and score.
Return type
List[Tuple[Document, float]] | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
3e67be62930b-0 | langchain.vectorstores.matching_engine.MatchingEngine¶
class langchain.vectorstores.matching_engine.MatchingEngine(project_id: str, index: MatchingEngineIndex, endpoint: MatchingEngineIndexEndpoint, embedding: Embeddings, gcs_client: storage.Client, gcs_bucket_name: str, credentials: Optional[Credentials] = None)[sourc... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.matching_engine.MatchingEngine.html |
3e67be62930b-1 | gcs_client¶
The GCS client.
gcs_bucket_name¶
The GCS bucket name.
credentials¶
Created GCP credentials.
Type
Optional
Methods
__init__(project_id, index, endpoint, ...[, ...])
Vertex Matching Engine implementation of the vector store.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.matching_engine.MatchingEngine.html |
3e67be62930b-2 | Takes the object creation out of the constructor.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas])
Use from components instead.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marg... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.matching_engine.MatchingEngine.html |
3e67be62930b-3 | 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 of strings to add to the vectorstore.
metadatas – Option... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.matching_engine.MatchingEngine.html |
3e67be62930b-4 | 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.vectorstores.matching_engine.MatchingEngine.html |
3e67be62930b-5 | texts. (embedding the) –
Returns
A configured MatchingEngine with the texts added to the index.
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.matching_engine.MatchingEngine.html |
3e67be62930b-6 | 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.matching_engine.MatchingEngine.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.