id
stringlengths
14
15
text
stringlengths
13
2.7k
source
stringlengths
60
181
edefbf8a0d8f-2
Initialize with sqlite client with vss extension. async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and add to the vectorstore. Parameters (List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added texts. Return...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.sqlitevss.SQLiteVSS.html
edefbf8a0d8f-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_community.vectorstores.sqlitevss.SQLiteVSS.html
edefbf8a0d8f-4
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.sqlitevss.SQLiteVSS.html
edefbf8a0d8f-5
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.sqlitevss.SQLiteVSS.html
edefbf8a0d8f-6
this embedding function returns. Needed for the virtual table DDL. 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 A...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.sqlitevss.SQLiteVSS.html
edefbf8a0d8f-7
Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶ Return docs most similar to query. similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document][source]¶ Return docs most similar to embedd...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.sqlitevss.SQLiteVSS.html
69784eb6b7e2-0
langchain_community.vectorstores.nucliadb.NucliaDB¶ class langchain_community.vectorstores.nucliadb.NucliaDB(knowledge_box: str, local: bool, api_key: Optional[str] = None, backend: Optional[str] = None)[source]¶ NucliaDB vector store. Initialize the NucliaDB client. Parameters knowledge_box – the Knowledge Box id. loc...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.nucliadb.NucliaDB.html
69784eb6b7e2-1
amax_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. as_retriever(**kwargs) Return VectorStoreRetriever initialized from this VectorStore. asearch(query, search_type, **kwargs) Return docs most similar to query using specified search type. asimilarity_search(query[, k...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.nucliadb.NucliaDB.html
69784eb6b7e2-2
similarity_search_with_score(*args, **kwargs) Run similarity search with distance. __init__(knowledge_box: str, local: bool, api_key: Optional[str] = None, backend: Optional[str] = None) → None[source]¶ Initialize the NucliaDB client. Parameters knowledge_box – the Knowledge Box id. local – Whether to use a local Nucli...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.nucliadb.NucliaDB.html
69784eb6b7e2-3
Delete by vector ID or other criteria. Parameters ids – List of ids to delete. **kwargs – Other keyword arguments that subclasses might use. Returns True if deletion is successful, False otherwise, None if not implemented. Return type Optional[bool] async classmethod afrom_documents(documents: List[Document], embedding...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.nucliadb.NucliaDB.html
69784eb6b7e2-4
score_threshold: Minimum relevance threshold for similarity_score_threshold fetch_k: Amount of documents to pass to MMR algorithm (Default: 20) lambda_mult: Diversity of results returned by MMR; 1 for minimum diversity and 0 for maximum. (Default: 0.5) filter: Filter by document metadata Returns Retriever class for Vec...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.nucliadb.NucliaDB.html
69784eb6b7e2-5
Return docs most similar to query. async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶ Return docs most similar to embedding vector. async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶ Return docs and r...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.nucliadb.NucliaDB.html
69784eb6b7e2-6
Return VectorStore initialized from texts and embeddings. 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 divers...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.nucliadb.NucliaDB.html
69784eb6b7e2-7
Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶ 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 vect...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.nucliadb.NucliaDB.html
2aef8d49c70d-0
langchain_community.vectorstores.scann.ScaNN¶ class langchain_community.vectorstores.scann.ScaNN(embedding: Embeddings, index: Any, docstore: Docstore, index_to_docstore_id: Dict[int, str], relevance_score_fn: Optional[Callable[[float], float]] = None, normalize_L2: bool = False, distance_strategy: DistanceStrategy = D...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.ScaNN.html
2aef8d49c70d-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.scann.ScaNN.html
2aef8d49c70d-2
Return docs selected using the maximal marginal relevance. save_local(folder_path[, index_name]) Save ScaNN index, docstore, and index_to_docstore_id to disk. search(query, search_type, **kwargs) Return docs most similar to query using specified search type. similarity_search(query[, k, filter, fetch_k]) Return docs mo...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.ScaNN.html
2aef8d49c70d-3
Run more texts through the embeddings and add to the vectorstore. add_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and add to the vectorstore. Parameters (List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added text...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.ScaNN.html
2aef8d49c70d-4
False otherwise, None if not implemented. Return type Optional[bool] async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶ Return VectorStore initialized from documents and embeddings. async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: O...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.ScaNN.html
2aef8d49c70d-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.scann.ScaNN.html
2aef8d49c70d-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.scann.ScaNN.html
2aef8d49c70d-7
Embeds documents. Creates an in memory docstore Initializes the ScaNN database This is intended to be a quick way to get started. Example from langchain_community.vectorstores import ScaNN from langchain_community.embeddings import OpenAIEmbeddings embeddings = OpenAIEmbeddings() text_embeddings = embeddings.embed_docu...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.ScaNN.html
2aef8d49c70d-8
index_name – for saving with a specific index file name 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 diversit...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.ScaNN.html
2aef8d49c70d-9
Save ScaNN index, docstore, and index_to_docstore_id to disk. Parameters folder_path – folder path to save index, docstore, and index_to_docstore_id to. 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: i...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.ScaNN.html
2aef8d49c70d-10
Return docs and relevance scores in the range [0, 1]. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Documents to return. Defaults to 4. **kwargs – kwargs to be passed to similarity search. Should include: score_threshold: Optional, a floating point value between 0 to 1 to filter the re...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.ScaNN.html
2aef8d49c70d-11
Defaults to 20. **kwargs – kwargs to be passed to similarity search. Can include: score_threshold: Optional, a floating point value between 0 to 1 to filter the resulting set of retrieved docs Returns List of documents most similar to the query text and L2 distance in float for each. Lower score represents more similar...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.ScaNN.html
54ebe41807de-0
langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch¶ class langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch(embedding: Embeddings, config: AlibabaCloudOpenSearchSettings, **kwargs: Any)[source]¶ Alibaba Cloud OpenSearch vector store. Attributes embeddings Acces...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
54ebe41807de-1
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...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
54ebe41807de-2
similarity_search_with_score(*args, **kwargs) Run similarity search with distance. __init__(embedding: Embeddings, config: AlibabaCloudOpenSearchSettings, **kwargs: Any) → None[source]¶ async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and add to the v...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
54ebe41807de-3
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[str], emb...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
54ebe41807de-4
lambda_mult: Diversity of results returned by MMR; 1 for minimum diversity and 0 for maximum. (Default: 0.5) filter: Filter by document metadata Returns Retriever class for VectorStore. Return type VectorStoreRetriever Examples: # Retrieve more documents with higher diversity # Useful if your dataset has many similar d...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
54ebe41807de-5
Return docs most similar to embedding vector. async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶ Return docs and relevance scores in the range [0, 1], asynchronously. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Docume...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
54ebe41807de-6
Returns True if deletion is successful, False otherwise, None if not implemented. Return type Optional[bool] delete_documents_with_document_id(id_list: List[str]) → bool[source]¶ Delete documents based on their IDs. Parameters id_list – List of document IDs. Returns Whether the deletion was successful or not. delete_do...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
54ebe41807de-7
Returns Alibaba cloud opensearch vector store instance. Return type AlibabaCloudOpenSearch inner_embedding_query(embedding: List[float], search_filter: Optional[Dict[str, Any]] = None, k: int = 4) → Dict[str, Any][source]¶ max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
54ebe41807de-8
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]¶ Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, search_filter...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
f60ae0b8c0ea-0
langchain_community.vectorstores.neo4j_vector.check_if_not_null¶ langchain_community.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
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.neo4j_vector.check_if_not_null.html
9940b0707565-0
langchain_community.vectorstores.annoy.dependable_annoy_import¶ langchain_community.vectorstores.annoy.dependable_annoy_import() → Any[source]¶ Import annoy if available, otherwise raise error.
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.annoy.dependable_annoy_import.html
aadd6e72bc44-0
langchain_community.vectorstores.redis.schema.NumericFieldSchema¶ class langchain_community.vectorstores.redis.schema.NumericFieldSchema[source]¶ Bases: RedisField Schema for numeric fields in Redis. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.NumericFieldSchema.html
aadd6e72bc44-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.NumericFieldSchema.html
aadd6e72bc44-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.NumericFieldSchema.html
00bee98801a4-0
langchain_community.vectorstores.myscale.has_mul_sub_str¶ langchain_community.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 oth...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.myscale.has_mul_sub_str.html
f822411c128f-0
langchain_community.vectorstores.sklearn.BaseSerializer¶ class langchain_community.vectorstores.sklearn.BaseSerializer(persist_path: str)[source]¶ Base class for serializing data. Methods __init__(persist_path) extension() The file extension suggested by this serializer (without dot). load() Loads the data from the per...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.sklearn.BaseSerializer.html
52a888fdcce2-0
langchain_community.vectorstores.elasticsearch.ExactRetrievalStrategy¶ class langchain_community.vectorstores.elasticsearch.ExactRetrievalStrategy[source]¶ Exact retrieval strategy using the script_score query. Methods __init__() before_index_setup(client, text_field, ...) Executes before the index is created. index(di...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ExactRetrievalStrategy.html
52a888fdcce2-1
fetch_k – The number of results to fetch initially. vector_query_field – The field containing the vector representations in the index. text_field – The field containing the text data in the index. filter – List of filter clauses to apply to the query. similarity – The similarity strategy to use, or None if not using on...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.ExactRetrievalStrategy.html
37c4fe7353cd-0
langchain_community.vectorstores.hologres.Hologres¶ class langchain_community.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]¶ Hologres API vecto...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
37c4fe7353cd-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.hologres.Hologres.html
37c4fe7353cd-2
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_search(query[, k, filter]) Run similarity sear...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
37c4fe7353cd-3
(List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added texts. Return type List[str] add_embeddings(texts: Iterable[str], embeddings: List[List[float]], metadatas: List[dict], ids: List[str], **kwargs: Any) → None[source]¶ Add embeddings to the vectorstore. Parameters texts –...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
37c4fe7353cd-4
Return VectorStore initialized from texts and embeddings. async amax_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[f...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
37c4fe7353cd-5
) # Fetch more documents for the MMR algorithm to consider # But only return the top 5 docsearch.as_retriever( search_type="mmr", search_kwargs={'k': 5, 'fetch_k': 50} ) # Only retrieve documents that have a relevance score # Above a certain threshold docsearch.as_retriever( search_type="similarity_score_th...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
37c4fe7353cd-6
**kwargs – kwargs to be passed to similarity search. Should include: score_threshold: Optional, a floating point value between 0 to 1 to filter the resulting set of retrieved docs Returns List of Tuples of (doc, similarity_score) async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, floa...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
37c4fe7353cd-7
Create the connection string by calling HologresVector.connection_string_from_db_params 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]] = Non...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
37c4fe7353cd-8
Return VectorStore initialized from texts and embeddings. Hologres connection string is required “Either pass it as a parameter or set the HOLOGRES_CONNECTION_STRING environment variable. Create the connection string by calling HologresVector.connection_string_from_db_params classmethod get_connection_string(kwargs: Di...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
37c4fe7353cd-9
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]¶ Return docs most similar to query using specified search type. sim...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
37c4fe7353cd-10
**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) similarity_search_with_score(query: str, k: int = 4, filter: Optional[dict] = None) → List...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.hologres.Hologres.html
d2a8ca39ef37-0
langchain_community.vectorstores.epsilla.Epsilla¶ class langchain_community.vectorstores.epsilla.Epsilla(client: Any, embeddings: Embeddings, db_path: Optional[str] = '/tmp/langchain-epsilla', db_name: Optional[str] = 'langchain_store')[source]¶ Wrapper around Epsilla vector database. As a prerequisite, you need to ins...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-1
add_documents(documents, **kwargs) Run more documents through the embeddings and add to the vectorstore. add_texts(texts[, metadatas, ...]) Embed texts and add them to the database. adelete([ids]) Delete by vector ID or other criteria. afrom_documents(documents, embedding, **kwargs) Return VectorStore initialized from ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-2
get([collection_name, response_fields]) Get the collection. max_marginal_relevance_search(query[, k, ...]) Return docs selected using the maximal marginal relevance. max_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. search(query, search_type, **kwargs) Return docs m...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-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] add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, collection_name: Optional[str] = '', d...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-4
Return VectorStore initialized from texts and embeddings. async amax_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[f...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-5
) # Fetch more documents for the MMR algorithm to consider # But only return the top 5 docsearch.as_retriever( search_type="mmr", search_kwargs={'k': 5, 'fetch_k': 50} ) # Only retrieve documents that have a relevance score # Above a certain threshold docsearch.as_retriever( search_type="similarity_score_th...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-6
**kwargs – kwargs to be passed to similarity search. Should include: score_threshold: Optional, a floating point value between 0 to 1 to filter the resulting set of retrieved docs Returns List of Tuples of (doc, similarity_score) async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, floa...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-7
Defaults to None. db_path (Optional[str]) – The path where the database will be persisted. Defaults to “/tmp/langchain-epsilla”. db_name (Optional[str]) – Give a name to the loaded database. Defaults to “langchain_store”. collection_name (Optional[str]) – Which collection to use. Defaults to “langchain_collection”. If ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-8
If provided, default collection name will be set as well. drop_old (Optional[bool]) – Whether to drop the previous collection and create a new one. Defaults to False. Returns Epsilla vector store. Return type Epsilla get(collection_name: str = '', response_fields: Optional[List[str]] = None) → List[dict][source]¶ Get t...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-9
Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. fetch_k – Number of Documents to fetch to pa...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
d2a8ca39ef37-10
Return docs and relevance scores in the range [0, 1]. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Documents to return. Defaults to 4. **kwargs – kwargs to be passed to similarity search. Should include: score_threshold: Optional, a floating point value between 0 to 1 to filter the re...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.epsilla.Epsilla.html
8109aa17a992-0
langchain_community.vectorstores.pgvector.PGVector¶ class langchain_community.vectorstores.pgvector.PGVector(connection_string: str, embedding_function: Embeddings, collection_name: str = 'langchain', collection_metadata: Optional[dict] = None, distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, pre_delete_c...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-1
documents=docs, collection_name=COLLECTION_NAME, connection_string=CONNECTION_STRING, ) Attributes distance_strategy embeddings Access the query embedding object if available. Methods __init__(connection_string, embedding_function) aadd_documents(documents, **kwargs) Run more documents through the embeddings an...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-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. connect() connection_string_from_db_params(driver, ...) R...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-3
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]) Return docs most similar to query. similarity_search_with_score_by_vector(embedding) __init__(connection_string: str, embedd...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-4
Returns List of IDs of the added texts. Return type List[str] add_embeddings(texts: Iterable[str], embeddings: List[List[float]], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶ Add embeddings to the vectorstore. Parameters texts – Iterable of strings to add ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-5
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.pgvector.PGVector.html
8109aa17a992-6
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 top 5 docsearch.as_retriever( search_type="mmr", search_kwargs={'k': 5, 'fetch_k': 50} ) # Only retrieve documents that have a relevance...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-7
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.pgvector.PGVector.html
8109aa17a992-8
“Either pass it as a parameter or set the PGVECTOR_CONNECTION_STRING environment variable. classmethod from_embeddings(text_embeddings: List[Tuple[str, List[float]]], embedding: Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = 'langchain', distance_strategy: DistanceStrategy = DistanceStrategy...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-9
Postgres connection string is required “Either pass it as a parameter or set the PGVECTOR_CONNECTION_STRING environment variable. get_collection(session: Session) → Any[source]¶ classmethod get_connection_string(kwargs: Dict[str, Any]) → str[source]¶ max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-10
Maximal marginal relevance optimizes for similarity to query AND diversityamong selected documents. Parameters embedding (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. fetch_k (int) – Number of Documents to fetch to pass to MMR algorithm. Defaults to 20. lambda_mul...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-11
Returns List of Documents selected by maximal marginalrelevance to the query and score for each. Return type List[Tuple[Document, float]] max_marginal_relevance_search_with_score_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, filter: Optional[Dict[str, str]] = None, **kwargs:...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-12
Parameters query (str) – Query text to search for. k (int) – Number of results 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. similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[dict] =...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
8109aa17a992-13
filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None. 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, filter: Optional[dict] = None) → List[Tuple[Document, float]][source]¶ Examples using PGVector¶ PGV...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.PGVector.html
6f2ae41d8ef3-0
langchain_community.vectorstores.starrocks.StarRocks¶ class langchain_community.vectorstores.starrocks.StarRocks(embedding: Embeddings, config: Optional[StarRocksSettings] = None, **kwargs: Any)[source]¶ StarRocks vector store. You need a pymysql python package, and a valid account to connect to StarRocks. Right now St...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.starrocks.StarRocks.html
6f2ae41d8ef3-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.starrocks.StarRocks.html
6f2ae41d8ef3-2
similarity_search_with_relevance_scores(query) Perform a similarity search with StarRocks similarity_search_with_score(*args, **kwargs) Run similarity search with distance. __init__(embedding: Embeddings, config: Optional[StarRocksSettings] = None, **kwargs: Any) → None[source]¶ StarRocks Wrapper to LangChain embedding...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.starrocks.StarRocks.html
6f2ae41d8ef3-3
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, **kwargs: Any) → Optional[bool]¶ Delete by vector ID or other criteria. Parameters ids – List of ids to delete. **kwargs – Ot...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.starrocks.StarRocks.html
6f2ae41d8ef3-4
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 (Default: 4) score_threshold: Minimum relevance threshold for similarity_score_threshold fetch_k: Amount of ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.starrocks.StarRocks.html
6f2ae41d8ef3-5
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]¶ Return docs most similar to q...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.starrocks.StarRocks.html
6f2ae41d8ef3-6
Return type Optional[bool] drop() → None[source]¶ Helper function: Drop data escape_str(value: str) → str[source]¶ classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶ Return VectorStore initialized from documents and embeddings. classmethod from_texts(texts: List[str], emb...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.starrocks.StarRocks.html
6f2ae41d8ef3-7
fetch_k – Number of Documents to fetch to pass to MMR algorithm. lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. max_mar...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.starrocks.StarRocks.html
6f2ae41d8ef3-8
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 Return type List[Document] similarity_search_by_vector(embedding: ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.starrocks.StarRocks.html
6f2ae41d8ef3-9
alone. The default name for it is metadata. Returns List of documents Return type List[Document] similarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶ Run similarity search with distance. Examples using StarRocks¶ StarRocks
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.starrocks.StarRocks.html
05d5a7be3e11-0
langchain_community.vectorstores.pinecone.Pinecone¶ class langchain_community.vectorstores.pinecone.Pinecone(index: Any, embedding: Union[Embeddings, Callable], text_key: str, namespace: Optional[str] = None, distance_strategy: Optional[DistanceStrategy] = DistanceStrategy.COSINE)[source]¶ Pinecone vector store. To use...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pinecone.Pinecone.html
05d5a7be3e11-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.pinecone.Pinecone.html
05d5a7be3e11-2
Return docs most similar to query using specified search type. similarity_search(query[, k, filter, namespace]) Return pinecone documents most similar to query. similarity_search_by_vector(embedding[, k]) Return docs most similar to embedding vector. similarity_search_by_vector_with_score(...) Return pinecone documents...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pinecone.Pinecone.html
05d5a7be3e11-3
Returns List of IDs of the added texts. Return type List[str] add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, namespace: Optional[str] = None, batch_size: int = 32, embedding_chunk_size: int = 1000, **kwargs: Any) → List[str][source]¶ Run more texts through the e...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pinecone.Pinecone.html
05d5a7be3e11-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.pinecone.Pinecone.html
05d5a7be3e11-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.pinecone.Pinecone.html
05d5a7be3e11-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.pinecone.Pinecone.html
05d5a7be3e11-7
Load pinecone vectorstore from index name. classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, batch_size: int = 32, text_key: str = 'text', namespace: Optional[str] = None, index_name: Optional[str] = None, upsert_kwargs: Optional[dic...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pinecone.Pinecone.html
05d5a7be3e11-8
Returns Pinecone Index instance. max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, filter: Optional[dict] = None, namespace: Optional[str] = None, **kwargs: Any) → List[Document][source]¶ Return docs selected using the maximal marginal relevance. Maximal marginal relevan...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pinecone.Pinecone.html
05d5a7be3e11-9
Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. search(query: str, search_type: str, **kwargs: Any) → List[Document]¶ Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, filter: Optional[dict] = None, namespace: Optional[str] = None...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pinecone.Pinecone.html