id stringlengths 14 16 | text stringlengths 13 2.7k | source stringlengths 57 178 |
|---|---|---|
2f690b24f704-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.HNSWVectorField.html |
4a213e7da035-0 | langchain.vectorstores.myscale.MyScaleSettings¶
class langchain.vectorstores.myscale.MyScaleSettings[source]¶
Bases: BaseSettings
MyScale client configuration.
Attribute:
myscale_host (str)An URL to connect to MyScale backend.Defaults to ‘localhost’.
myscale_port (int) : URL port to connect with HTTP. Defaults to 8443.... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleSettings.html |
4a213e7da035-1 | param index_param: Optional[Dict[str, str]] = None¶
param index_type: str = 'MSTG'¶
param metric: str = 'Cosine'¶
param password: Optional[str] = None¶
param port: int = 8443¶
param table: str = 'langchain'¶
param username: Optional[str] = None¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any)... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleSettings.html |
4a213e7da035-2 | Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False,... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleSettings.html |
1c70d9fa6250-0 | langchain.vectorstores.vectara.VectaraRetriever¶
class langchain.vectorstores.vectara.VectaraRetriever[source]¶
Bases: VectorStoreRetriever
Retriever class for Vectara.
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 val... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
1c70d9fa6250-1 | param vectorstore: Vectara [Required]¶
Vectara vectorstore.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Add documents to vectorstore.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Opti... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
1c70d9fa6250-2 | and passed as arguments to the handlers defined in callbacks.
Parameters
metadata – Optional metadata associated with the retriever. Defaults to None
This metadata will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Returns
List of relevant documents
async ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
1c70d9fa6250-3 | The jsonpatch ops can be applied in order to construct state.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which buffers input and calls astream.
Subclasses should override this method if th... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
1c70d9fa6250-4 | classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
1c70d9fa6250-5 | Get a pydantic model that can be used to validate input to the runnable.
Runnables that leverage the configurable_fields and configurable_alternatives
methods will have a dynamic input schema that depends on which
configuration the runnable is invoked with.
This method allows to get an input schema for a specific confi... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
1c70d9fa6250-6 | and passed as arguments to the handlers defined in callbacks.
Parameters
metadata – Optional metadata associated with the retriever. Defaults to None
This metadata will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Returns
List of relevant documents
invoke... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
1c70d9fa6250-7 | to the object.
map() → Runnable[List[Input], List[Output]]¶
Return a new Runnable that maps a list of inputs to a list of outputs,
by calling invoke() with each input.
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool =... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
1c70d9fa6250-8 | classmethod validate(value: Any) → Model¶
with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶
Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks: Sequence[Runnable[Input, Output]], *, exceptions_to_handle: Tuple[Type[BaseException], ...] = (<class 'E... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
1c70d9fa6250-9 | Create a new Runnable that retries the original runnable on exceptions.
Parameters
retry_if_exception_type – A tuple of exception types to retry on
wait_exponential_jitter – Whether to add jitter to the wait time
between retries
stop_after_attempt – The maximum number of attempts to make before giving up
Returns
A new ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
d44672069156-0 | langchain.vectorstores.vectara.Vectara¶
class langchain.vectorstores.vectara.Vectara(vectara_customer_id: Optional[str] = None, vectara_corpus_id: Optional[str] = None, vectara_api_key: Optional[str] = None, vectara_api_timeout: int = 60, source: str = 'langchain')[source]¶
Vectara API vector store.
See (https://vectar... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
d44672069156-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.vectara.Vectara.html |
d44672069156-2 | Return Vectara documents most similar to query, along with scores.
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, ...])
Return Vectara d... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
d44672069156-3 | Vectara provides a way to add documents directly via our API where
pre-processing and chunking occurs internally in an optimal way
This method provides a way to use that API in LangChain
Parameters
files_list – Iterable of strings, each representing a local file path.
Files could be text, HTML, PDF, markdown, doc/docx,... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
d44672069156-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.vectara.Vectara.html |
d44672069156-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.vectara.Vectara.html |
d44672069156-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.vectara.Vectara.html |
d44672069156-7 | vectara_api_key=api_key,
)
classmethod from_texts(texts: List[str], embedding: Optional[Embeddings] = None, metadatas: Optional[List[dict]] = None, **kwargs: Any) → Vectara[source]¶
Construct Vectara wrapper from raw documents.
This is intended to be a quick way to get started.
.. rubric:: Example
from langchain.vector... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
d44672069156-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.vectara.Vectara.html |
d44672069156-9 | Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query vector.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
d44672069156-10 | If defined, results with score less than this value will be
filtered out.
n_sentence_context – number of sentences before/after the matching segment
to add, defaults to 2
Returns
List of Documents most similar to the query and score for each.
Examples using Vectara¶
Vectara
Chat Over Documents with Vectara
Vectara Text... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
eea659590e98-0 | langchain.vectorstores.neo4j_vector.Neo4jVector¶
class langchain.vectorstores.neo4j_vector.Neo4jVector(embedding: Embeddings, *, search_type: SearchType = SearchType.VECTOR, username: Optional[str] = None, password: Optional[str] = None, url: Optional[str] = None, keyword_index_name: Optional[str] = 'keyword', database... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-1 | documents=docs,
url=url
username=username,
password=password,
)
Attributes
embeddings
Access the query embedding object if available.
Methods
__init__(embedding, *[, search_type, ...])
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-2 | 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_new_index()
This method constructs a Cypher query ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-3 | Check if the vector index exists in the Neo4j database and returns its embedding dimension.
search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k])
Run similarity search with Neo4jVector.
similarity_search_by_vector(embedding[, k])
Return docs mo... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-4 | (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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-5 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-6 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-7 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-8 | False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, ids: Optional[List[str]] = None, **kwargs: Any) → Neo4jVector[source]¶
Return Neo4jVector initialized from docu... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-9 | Initialize and return a Neo4jVector instance from an existing graph.
This method initializes a Neo4jVector instance using the provided
parameters and the existing graph. It validates the existence of
the indices and creates new ones if they don’t exist.
Returns:
Neo4jVector: An instance of Neo4jVector initialized with ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-10 | and password and optional database parameters.
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 similarity to query AND diversity
among s... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-11 | This method sends a Cypher query to the connected Neo4j database
and returns the results as a list of dictionaries.
Parameters
query (str) – The Cypher query to execute.
params (dict, optional) – Dictionary of query parameters. Defaults to {}.
Returns
List of dictionaries containing the query results.
Return type
List[... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-12 | 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 most similar to the query vector.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Docume... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
eea659590e98-13 | as a list of tuples, each containing a Document object and
its similarity score.
Parameters
embedding (List[float]) – The embedding vector to compare against.
k (int, optional) – The number of top similar documents to retrieve.
Returns
A list of tuples, each containinga Document object and its similarity score.
Return ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.Neo4jVector.html |
cea776ab14d8-0 | langchain.vectorstores.redis.base.Redis¶
class langchain.vectorstores.redis.base.Redis(redis_url: str, index_name: str, embedding: Embeddings, index_schema: Optional[Union[Dict[str, str], str, PathLike]] = None, vector_schema: Optional[Dict[str, Union[int, str]]] = None, relevance_score_fn: Optional[Callable[[float], f... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-1 | from langchain.embeddings import OpenAIEmbeddings
rds = Redis.from_documents(
documents, # a list of Document objects from loaders or created
embeddings, # an Embeddings object
redis_url="redis://localhost:6379",
)
Initialize, create index, and load Documents with metadatards = Redis.from_texts(
texts, ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-2 | FLAT (knn) which is the default
vector_schema = {
"algorithm": "HNSW"
}
rds = Redis.from_texts(
texts, # a list of strings
metadata, # a list of metadata dicts
embeddings, # an Embeddings object
vector_schema=vector_schema,
redis_url="redis://localhost:6379",
)
Custom index schema can be supplie... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-3 | redis_url="redis://localhost:6379",
)
When connecting to an existing index where a custom schema has been applied, it’s
important to pass in the same schema to the from_existing_index method.
Otherwise, the schema for newly added samples will be incorrect and metadata
will not be returned.
Initialize with necessary com... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-4 | 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.redis.base.Redis.html |
cea776ab14d8-5 | Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k, ...])
Run similarity search with vector distance.
write_schema(path)
Write the schema to a yaml file.
__init__(redis_url: str, index_name: str, embedding: Embeddings, index_schema: Optional[Union[Dict[str, str], str, PathLike]... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-6 | Add more texts to the vectorstore.
Parameters
texts (Iterable[str]) – Iterable of strings/text to add to the vectorstore.
metadatas (Optional[List[dict]], optional) – Optional list of metadatas.
Defaults to None.
embeddings (Optional[List[List[float]]], optional) – Optional pre-generated
embeddings. Defaults to None.
k... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-7 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-8 | 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.redis.base.Redis.html |
cea776ab14d8-9 | 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.
static delete(ids: Optional[List[str]] = None, **kwargs: Any) → bool[source]¶
Delete a Redis entry.
Parameters
ids – List o... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-10 | redis_url="redis://username:password@localhost:6379"
)
Parameters
embedding (Embeddings) – Embedding model class (i.e. OpenAIEmbeddings)
for embedding queries.
index_name (str) – Name of the index to connect to.
schema (Union[Dict[str, str], str, os.PathLike]) – Schema of the index
and the vector schema. Can be a dict,... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-11 | always present in the langchain schema.
Example
from langchain.vectorstores import Redis
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
redisearch = RediSearch.from_texts(
texts,
embeddings,
redis_url="redis://username:password@localhost:6379"
)
Parameters
texts (List[str]... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-12 | Create a Redis vectorstore from raw documents.
This is a user-friendly interface that:
Embeds documents.
Creates a new Redis index if it doesn’t already exist
Adds the documents to the newly created Redis index.
Returns the keys of the newly created documents once stored.
This method will generate schema based on the m... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-13 | vector schema to use. Defaults to None.
**kwargs (Any) – Additional keyword arguments to pass to the Redis client.
Returns
Tuple of the Redis instance and the keys ofthe newly created documents.
Return type
Tuple[Redis, List[str]]
Raises
ValueError – If the number of metadatas does not match the number of texts.
max_ma... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-14 | A list of Documents selected by maximal marginal relevance.
Return type
List[Document]
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 rel... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-15 | between selected documents and the query vector. Defaults to None.
Returns
A list of documents that are most similar to the querytext.
Return type
List[Document]
similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[RedisFilterExpression] = None, return_metadata: bool = True, distance_thresho... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-16 | Return type
List[Document]
Note
If there are no documents that satisfy the score_threshold value,
an empty list is returned.[Deprecated] Returns the most similar indexed documents to the query text within the
score_threshold range.
Deprecated: Use similarity_search with distance_threshold instead.
Parameters
query (str... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
cea776ab14d8-17 | Run similarity search with vector distance.
The “scores” returned from this function are the raw vector
distances from the query vector. For similarity scores, use
similarity_search_with_relevance_scores.
Parameters
query (str) – The query text for which to find similar documents.
k (int) – The number of documents to r... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.Redis.html |
79af04d6b4c4-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.dependable_faiss_import.html |
ee643b10728f-0 | langchain.vectorstores.myscale.has_mul_sub_str¶
langchain.vectorstores.myscale.has_mul_sub_str(s: str, *args: Any) → bool[source]¶
Check if a string contains multiple substrings.
:param s: string to check.
:param *args: substrings to check.
Returns
True if all substrings are in the string, False otherwise. | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.has_mul_sub_str.html |
e0630fb4e4a2-0 | langchain.vectorstores.annoy.Annoy¶
class langchain.vectorstores.annoy.Annoy(embedding_function: Callable, index: Any, metric: str, docstore: Docstore, index_to_docstore_id: Dict[int, str])[source]¶
Annoy vector store.
To use, you should have the annoy python package installed.
Example
from langchain.vectorstores impor... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-2 | Return docs most similar to docstore_index.
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, ...])
Return docs most similar to query.... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-3 | Run more texts through the embeddings and add to the vectorstore.
Parameters
texts – Iterable of strings to add to the vectorstore.
metadatas – Optional list of metadatas associated with the texts.
kwargs – vectorstore specific parameters
Returns
List of ids from adding the texts into the vectorstore.
async adelete(ids... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-4 | Return VectorStoreRetriever initialized from this VectorStore.
Parameters
search_type (Optional[str]) – Defines the type of search that
the Retriever should perform.
Can be “similarity” (default), “mmr”, or
“similarity_score_threshold”.
search_kwargs (Optional[Dict]) – Keyword arguments to pass to the
search function. ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-6 | False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_embeddings(text_embeddings: List[Tuple[str, List[float]]], embedding: Emb... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-7 | Construct Annoy wrapper from raw documents.
Parameters
texts – List of documents to index.
embedding – Embedding function to use.
metadatas – List of metadata dictionaries to associate with documents.
metric – Metric to use for indexing. Defaults to “angular”.
trees – Number of trees to use for indexing. Defaults to 10... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-8 | 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.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-9 | prefault – Whether to pre-load the index into memory.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, search_k: int = - 1, **kwargs: Any) → List[Document][source]¶
Return docs most similar to q... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-10 | Returns
List of Documents most similar to the embedding.
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 retur... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
e0630fb4e4a2-11 | Returns
List of Documents most similar to the query and score for each
similarity_search_with_score_by_vector(embedding: List[float], k: int = 4, search_k: int = - 1) → List[Tuple[Document, float]][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documen... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
fe874c9f6d9e-0 | langchain.vectorstores.annoy.dependable_annoy_import¶
langchain.vectorstores.annoy.dependable_annoy_import() → Any[source]¶
Import annoy if available, otherwise raise error. | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.dependable_annoy_import.html |
a0c9ff5a5b9e-0 | langchain.vectorstores.myscale.MyScaleWithoutJSON¶
class langchain.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 are working to a SQL... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
a0c9ff5a5b9e-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
a0c9ff5a5b9e-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
a0c9ff5a5b9e-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
a0c9ff5a5b9e-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
a0c9ff5a5b9e-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
a0c9ff5a5b9e-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
a0c9ff5a5b9e-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
a0c9ff5a5b9e-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
a0c9ff5a5b9e-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleWithoutJSON.html |
bec52ce7c675-0 | langchain.vectorstores.baiducloud_vector_search.BESVectorStore¶
class langchain.vectorstores.baiducloud_vector_search.BESVectorStore(index_name: str, bes_url: str, user: Optional[str] = None, password: Optional[str] = None, embedding: Optional[Embeddings] = None, **kwargs: Optional[dict])[source]¶
Baidu Elasticsearch v... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.baiducloud_vector_search.BESVectorStore.html |
bec52ce7c675-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.baiducloud_vector_search.BESVectorStore.html |
bec52ce7c675-2 | similarity_search(query[, k, filter])
Return documents 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[, filter])
Re... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.baiducloud_vector_search.BESVectorStore.html |
bec52ce7c675-3 | Run more texts through the embeddings and add to the vectorstore.
Parameters
texts – Iterable of strings to add to the vectorstore.
metadatas – Optional list of metadatas associated with the texts.
Returns
List of ids from adding the texts into the vectorstore.
async adelete(ids: Optional[List[str]] = None, **kwargs: A... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.baiducloud_vector_search.BESVectorStore.html |
bec52ce7c675-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.baiducloud_vector_search.BESVectorStore.html |
bec52ce7c675-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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.baiducloud_vector_search.BESVectorStore.html |
bec52ce7c675-6 | Delete documents from the index.
Parameters
ids – List of ids of documents to delete
classmethod from_documents(documents: List[Document], embedding: Optional[Embeddings] = None, **kwargs: Any) → BESVectorStore[source]¶
Construct BESVectorStore wrapper from documents.
Parameters
documents – List of documents to add to ... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.baiducloud_vector_search.BESVectorStore.html |
bec52ce7c675-7 | to maximum diversity and 1 to minimum diversity.
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 max... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.baiducloud_vector_search.BESVectorStore.html |
bec52ce7c675-8 | 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 most similar to the query vector.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Docume... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.baiducloud_vector_search.BESVectorStore.html |
0b7bb6fcf74c-0 | langchain.vectorstores.neo4j_vector.check_if_not_null¶
langchain.vectorstores.neo4j_vector.check_if_not_null(props: List[str], values: List[Any]) → None[source]¶
Check if the values are not None or empty string | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.check_if_not_null.html |
63710d9809d5-0 | langchain.vectorstores.marqo.Marqo¶
class langchain.vectorstores.marqo.Marqo(client: marqo.Client, index_name: str, add_documents_settings: Optional[Dict[str, Any]] = None, searchable_attributes: Optional[List[str]] = None, page_content_builder: Optional[Callable[[Dict[str, Any]], str]] = None)[source]¶
Marqo vector st... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.marqo.Marqo.html |
63710d9809d5-1 | add_texts(texts[, metadatas])
Upload texts with metadata (properties) to Marqo.
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 VectorStore initialized fr... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.marqo.Marqo.html |
63710d9809d5-2 | Return Marqo initialized from texts.
get_indexes()
Helper to see your available indexes in marqo, useful if the from_texts method was used without an index name specified
get_number_of_documents()
Helper to see the number of documents in the index
marqo_bulk_similarity_search(queries[, k])
Return documents from Marqo u... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.marqo.Marqo.html |
63710d9809d5-3 | Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶
Run... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.marqo.Marqo.html |
63710d9809d5-4 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.marqo.Marqo.html |
63710d9809d5-5 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.marqo.Marqo.html |
63710d9809d5-6 | 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... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.marqo.Marqo.html |
63710d9809d5-7 | Returns
A list of results for each query.
Return type
List[List[Document]]
bulk_similarity_search_with_score(queries: Iterable[Union[str, Dict[str, float]]], k: int = 4, **kwargs: Any) → List[List[Tuple[Document, float]]][source]¶
Return documents from Marqo that are similar to the query as well as
their scores using a... | lang/api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.marqo.Marqo.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.