id
stringlengths
14
15
text
stringlengths
13
2.7k
source
stringlengths
60
181
05d5a7be3e11-10
0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Documents to return. Defaults to 4. **kwargs – kwargs to be passed to similarity search. Should include: score_threshold: Optional, a floating point value between 0 to 1 to filter the resulting set of retrieved docs Returns List of Tuples o...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pinecone.Pinecone.html
671ee5059b76-0
langchain_community.vectorstores.vectara.Vectara¶ class langchain_community.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 = 120, source: str = 'langchain')[source]¶ Vectara API vector store...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-1
Return VectorStore initialized from documents and embeddings. afrom_texts(texts, embedding[, metadatas]) Return VectorStore initialized from texts and embeddings. amax_marginal_relevance_search(query[, k, ...]) Return docs selected using the maximal marginal relevance. amax_marginal_relevance_search_by_vector(...) Retu...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-2
similarity_search(query[, k, lambda_val, ...]) 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_sear...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-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,...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-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_...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-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 ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-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_commun...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-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 ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
671ee5059b76-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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vectara.Vectara.html
3292fecfc8e5-0
langchain_community.vectorstores.timescalevector.TimescaleVector¶ class langchain_community.vectorstores.timescalevector.TimescaleVector(service_url: str, embedding: Embeddings, collection_name: str = 'langchain_store', num_dimensions: int = 1536, distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, pre_delet...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-1
Attributes DEFAULT_INDEX_TYPE embeddings Access the query embedding object if available. Methods __init__(service_url, embedding[, ...]) aadd_documents(documents, **kwargs) Run more documents through the embeddings and add to the vectorstore. aadd_embeddings(texts, embeddings[, ...]) Add embeddings to the vectorstore. ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-2
Run similarity search with TimescaleVector with distance. 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(query[, k, ...]) R...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-3
Run similarity search with TimescaleVector 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[, k, ...]) Return docs most sim...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-4
kwargs – vectorstore specific parameters async aadd_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....
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-5
kwargs – vectorstore specific parameters Returns List of ids from adding the texts into the vectorstore. 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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-6
tvs = TimescaleVector.from_embeddings(text_embedding_pairs, embeddings) async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = 'langchain_store', distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, ids: Optional[List[str]] = None,...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-7
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.timescalevector.TimescaleVector.html
3292fecfc8e5-8
Return docs most similar to query using specified search type. async asimilarity_search(query: str, k: int = 4, filter: Optional[Union[dict, list]] = None, predicates: Optional[Predicates] = None, **kwargs: Any) → List[Document][source]¶ Run similarity search with TimescaleVector with distance. Parameters query (str) –...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-9
filter the resulting set of retrieved docs Returns List of Tuples of (doc, similarity_score) async asimilarity_search_with_score(query: str, k: int = 4, filter: Optional[Union[dict, list]] = None, predicates: Optional[Predicates] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶ Return docs most similar to...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-10
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] drop_index() → None[source]¶ drop_tables() → None[source]¶ classmethod...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-11
return the instance of the store without inserting any new embeddings classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = 'langchain_store', distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, ids: Optional[List[str]] = None, pre_dele...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-12
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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
3292fecfc8e5-13
Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None. Returns List of Documents most similar to the query vector. similarity_search_with_relevance_scores(query: str, k: int = 4, **kwar...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.timescalevector.TimescaleVector.html
a0f61c2e9d97-0
langchain_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever¶ class langchain_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever[source]¶ Bases: BaseRetriever Retriever that uses Azure Cognitive Search. Create a new model by parsing and validating input data from keyword arguments. Raise...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
a0f61c2e9d97-1
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. async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[s...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
a0f61c2e9d97-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_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
a0f61c2e9d97-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_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
a0f61c2e9d97-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_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
a0f61c2e9d97-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_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
a0f61c2e9d97-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_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
a0f61c2e9d97-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_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
a0f61c2e9d97-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_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
a0f61c2e9d97-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_community.vectorstores.azuresearch.AzureSearchVectorStoreRetriever.html
964e98c55c8e-0
langchain_community.vectorstores.llm_rails.LLMRails¶ class langchain_community.vectorstores.llm_rails.LLMRails(datastore_id: Optional[str] = None, api_key: Optional[str] = None)[source]¶ Implementation of Vector Store using LLMRails. See https://llmrails.com/ Example from langchain_community.vectorstores import LLMRail...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRails.html
964e98c55c8e-1
Return docs selected using the maximal marginal relevance. amax_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. as_retriever(**kwargs) Return VectorStoreRetriever initialized from this VectorStore. asearch(query, search_type, **kwargs) Return docs most similar to quer...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRails.html
964e98c55c8e-2
Return LLMRails documents most similar to query, along with scores. __init__(datastore_id: Optional[str] = None, api_key: Optional[str] = None)[source]¶ Initialize with LLMRails API. async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and add to the vect...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRails.html
964e98c55c8e-3
see API docs for full list Returns List of ids associated with each of the files indexed 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 vect...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRails.html
964e98c55c8e-4
Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → LLMRailsRetriever[source]¶ 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”, ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRails.html
964e98c55c8e-5
) # Only get the single most similar document from the dataset docsearch.as_retriever(search_kwargs={'k': 1}) # Use a filter to only retrieve documents from a specific paper docsearch.as_retriever( search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}} ) async asearch(query: str, search_type: str, **kwa...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRails.html
964e98c55c8e-6
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] classmethod from_documents(documents: List[Document], embedding: Embed...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRails.html
964e98c55c8e-7
Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. Maximal marginal relevan...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRails.html
964e98c55c8e-8
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_community.vectorstores.llm_rails.LLMRails.html
8c0013d780ec-0
langchain_community.vectorstores.sklearn.BsonSerializer¶ class langchain_community.vectorstores.sklearn.BsonSerializer(persist_path: str)[source]¶ Serializes data in binary json using the bson python package. Methods __init__(persist_path) extension() The file extension suggested by this serializer (without dot). load(...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.sklearn.BsonSerializer.html
4fade9618f4d-0
langchain_community.vectorstores.cassandra.Cassandra¶ class langchain_community.vectorstores.cassandra.Cassandra(embedding: Embeddings, session: Session, keyspace: str, table_name: str, ttl_seconds: Optional[int] = None)[source]¶ Wrapper around Apache Cassandra(R) for vector-store workloads. To use it, you need a recen...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.cassandra.Cassandra.html
4fade9618f4d-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) Return VectorStoreRetriever...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.cassandra.Cassandra.html
4fade9618f4d-2
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. :param k: Number of Documents to return. :param fetch_k: Numb...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.cassandra.Cassandra.html
4fade9618f4d-3
similarity_search_with_score_id_by_vector(...) Return docs most similar to embedding vector. __init__(embedding: Embeddings, session: Session, keyspace: str, table_name: str, ttl_seconds: Optional[int] = None) → None[source]¶ async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.cassandra.Cassandra.html
4fade9618f4d-4
batch_size (int) – Number of concurrent requests to send to the server. ttl_seconds (Optional[int], optional) – Optional time-to-live for the added texts. 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 ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.cassandra.Cassandra.html
4fade9618f4d-5
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.cassandra.Cassandra.html
4fade9618f4d-6
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.cassandra.Cassandra.html
4fade9618f4d-7
False otherwise, None if not implemented. Return type Optional[bool] delete_by_document_id(document_id: str) → None[source]¶ delete_collection() → None[source]¶ Just an alias for clear (to better align with other VectorStore implementations). classmethod from_documents(documents: List[Document], embedding: Embeddings, ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.cassandra.Cassandra.html
4fade9618f4d-8
Optional. 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, filter: Optional[Dict[str, str]] = None, **kwargs: Any) → List[Document][source]¶ Return docs selected using the maximal ma...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.cassandra.Cassandra.html
4fade9618f4d-9
Returns List of Documents most similar to the query vector. similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶ Return docs and relevance scores in the range [0, 1]. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Documents to re...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.cassandra.Cassandra.html
4fade9618f4d-10
Return docs most similar to embedding vector. Parameters embedding (str) – Embedding to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. Returns List of (Document, score, id), the most similar to the query vector. Examples using Cassandra¶ Cassandra
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.cassandra.Cassandra.html
f3de5a9cd882-0
langchain_community.vectorstores.clickhouse.has_mul_sub_str¶ langchain_community.vectorstores.clickhouse.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, Fal...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.clickhouse.has_mul_sub_str.html
18887f4946fa-0
langchain_core.vectorstores.VectorStore¶ class langchain_core.vectorstores.VectorStore[source]¶ Interface for vector store. Attributes embeddings Access the query embedding object if available. Methods __init__() 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_core.vectorstores.VectorStore.html
18887f4946fa-1
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]) Return VectorStore initialized from texts and embeddings. max_ma...
https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStore.html
18887f4946fa-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] abstract add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][so...
https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStore.html
18887f4946fa-3
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document][source]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → Vec...
https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStore.html
18887f4946fa-4
search_kwargs={'k': 5, 'fetch_k': 50} ) # Only retrieve documents that have a relevance score # Above a certain threshold docsearch.as_retriever( search_type="similarity_score_threshold", search_kwargs={'score_threshold': 0.8} ) # Only get the single most similar document from the dataset docsearch.as_retriever...
https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStore.html
18887f4946fa-5
Returns List of Tuples of (doc, similarity_score) async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]][source]¶ Run similarity search with distance asynchronously. delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool][source]¶ Delete by vector ID or other crite...
https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStore.html
18887f4946fa-6
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][source]¶ Return docs selected using the maximal marginal relevance. Maximal marginal...
https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStore.html
18887f4946fa-7
Return docs and relevance scores in the range [0, 1]. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Documents to return. Defaults to 4. **kwargs – kwargs to be passed to similarity search. Should include: score_threshold: Optional, a floating point value between 0 to 1 to filter the re...
https://api.python.langchain.com/en/latest/vectorstores/langchain_core.vectorstores.VectorStore.html
4e1e4c936773-0
langchain_community.vectorstores.docarray.base.DocArrayIndex¶ class langchain_community.vectorstores.docarray.base.DocArrayIndex(doc_index: BaseDocIndex, embedding: Embeddings)[source]¶ Base class for DocArray based vector stores. Initialize a vector store from DocArray’s DocIndex. Attributes doc_cls embeddings Access ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.base.DocArrayIndex.html
4e1e4c936773-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. delete([ids]) Delete by vector ID or other criteria. from...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.base.DocArrayIndex.html
4e1e4c936773-2
Returns List of IDs of the added texts. Return type List[str] async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶ Run more texts through the embeddings and add to the vectorstore. add_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documen...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.base.DocArrayIndex.html
4e1e4c936773-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.docarray.base.DocArrayIndex.html
4e1e4c936773-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.docarray.base.DocArrayIndex.html
4e1e4c936773-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.docarray.base.DocArrayIndex.html
4e1e4c936773-6
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) ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.base.DocArrayIndex.html
4e1e4c936773-7
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 in the range [0, 1]. 0 is dissimilar, 1 is most similar. Parameter...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.docarray.base.DocArrayIndex.html
435132137c14-0
langchain_community.vectorstores.tencentvectordb.ConnectionParams¶ class langchain_community.vectorstores.tencentvectordb.ConnectionParams(url: str, key: str, username: str = 'root', timeout: int = 10)[source]¶ Tencent vector DB Connection params. See the following documentation for details: https://cloud.tencent.com/d...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tencentvectordb.ConnectionParams.html
2f3c7785ef2b-0
langchain_community.vectorstores.myscale.MyScaleSettings¶ class langchain_community.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 HTT...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleSettings.html
2f3c7785ef2b-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)...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleSettings.html
2f3c7785ef2b-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,...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.MyScaleSettings.html
d4c7b41eefe8-0
langchain_community.vectorstores.redis.schema.read_schema¶ langchain_community.vectorstores.redis.schema.read_schema(index_schema: Optional[Union[Dict[str, List[Any]], str, PathLike]]) → Dict[str, Any][source]¶ Reads in the index schema from a dict or yaml file. Check if it is a dict and return RedisModel otherwise, ch...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.read_schema.html
fe39e63072d5-0
langchain_community.vectorstores.zep.ZepVectorStore¶ class langchain_community.vectorstores.zep.ZepVectorStore(collection_name: str, api_url: str, *, api_key: Optional[str] = None, config: Optional[CollectionConfig] = None, embedding: Optional[Embeddings] = None)[source]¶ Zep vector store. It provides methods for addin...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.ZepVectorStore.html
fe39e63072d5-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.zep.ZepVectorStore.html
fe39e63072d5-2
similarity_search(query[, k, metadata]) Return docs most similar to query. similarity_search_by_vector(embedding[, k, ...]) Return docs most similar to embedding vector. similarity_search_with_relevance_scores(query) Return docs and relevance scores in the range [0, 1]. similarity_search_with_score(query[, k, ...]) Run...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.ZepVectorStore.html
fe39e63072d5-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. document_ids – Optional list of document ids associated with the texts. kwargs – vectorstore specific parameters Returns L...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.ZepVectorStore.html
fe39e63072d5-4
Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStoreRetriever¶ Return VectorStoreRetriever initialized from this VectorStore. Parameters search_type (Optional[str]) – Defines the type of search that the Retriever should perform. Can be “similarity” (default), “mmr”, or “s...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.ZepVectorStore.html
fe39e63072d5-5
) # Only get the single most similar document from the dataset docsearch.as_retriever(search_kwargs={'k': 1}) # Use a filter to only retrieve documents from a specific paper docsearch.as_retriever( search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}} ) async asearch(query: str, search_type: str, metad...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.ZepVectorStore.html
fe39e63072d5-6
Raises ValueError – If no UUIDs are provided. 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: Optional[Embeddings] = None, metadatas: Optional[List[dict]] ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.ZepVectorStore.html
fe39e63072d5-7
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 algorithm. Zep determines this automatically and this para...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.ZepVectorStore.html
fe39e63072d5-8
Returns List of Documents selected by maximal marginal relevance. search(query: str, search_type: str, metadata: Optional[Dict[str, Any]] = None, k: int = 3, **kwargs: Any) → List[Document][source]¶ Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, metadata: Option...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.ZepVectorStore.html
fe39e63072d5-9
Run similarity search with distance. Examples using ZepVectorStore¶ Zep
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.zep.ZepVectorStore.html
edf0b9e534d9-0
langchain_community.vectorstores.chroma.Chroma¶ class langchain_community.vectorstores.chroma.Chroma(collection_name: str = 'langchain', embedding_function: Optional[Embeddings] = None, persist_directory: Optional[str] = None, client_settings: Optional[chromadb.config.Settings] = None, collection_metadata: Optional[Dic...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-1
afrom_texts(texts, embedding[, metadatas]) Return VectorStore initialized from texts and embeddings. amax_marginal_relevance_search(query[, k, ...]) Return docs selected using the maximal marginal relevance. amax_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. as_retr...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-2
Return docs most similar to query using specified search type. similarity_search(query[, k, filter]) Run similarity search with Chroma. similarity_search_by_vector(embedding[, k, ...]) Return docs most similar to embedding vector. similarity_search_by_vector_with_relevance_scores(...) Return docs most similar to embedd...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-3
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 texts. Return type List[str] add_images(uris: List[str], metadatas: Op...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-4
Returns True if deletion is successful, False otherwise, None if not implemented. Return type Optional[bool] async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶ Return VectorStore initialized from documents and embeddings. async classmethod afrom_texts(texts: List[s...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-5
lambda_mult: Diversity of results returned by MMR; 1 for minimum diversity and 0 for maximum. (Default: 0.5) filter: Filter by document metadata Returns Retriever class for VectorStore. Return type VectorStoreRetriever Examples: # Retrieve more documents with higher diversity # Useful if your dataset has many similar d...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-6
Return docs most similar to embedding vector. async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶ Return docs and relevance scores in the range [0, 1], asynchronously. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Docume...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-7
Otherwise, the data will be ephemeral in-memory. Parameters collection_name (str) – Name of the collection to create. persist_directory (Optional[str]) – Directory to persist the collection. ids (Optional[List[str]]) – List of document IDs. Defaults to None. documents (List[Document]) – List of documents to add to the ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-8
ids (Optional[List[str]]) – List of document IDs. Defaults to None. client_settings (Optional[chromadb.config.Settings]) – Chroma client settings collection_metadata (Optional[Dict]) – Collection configurations. Defaults to None. Returns Chroma vectorstore. Return type Chroma get(ids: Optional[OneOrMany[ID]] = None, wh...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-9
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 algorithm. lambda_mult – Number between 0 and 1 that deter...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-10
Persist the collection. This can be used to explicitly persist the data to disk. It will also be called automatically when the object is destroyed. 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 = ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html