id stringlengths 14 15 | text stringlengths 44 2.47k | source stringlengths 61 181 |
|---|---|---|
ee0e31c7667f-7 | 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.vectorstores.timescalevector.TimescaleVector.html |
ee0e31c7667f-8 | 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.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most s... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html |
ee0e31c7667f-9 | Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
delete_by_metadata(filter: Union[Dict[str, str], List[Dict[str, str]]], **kwargs: Any) → Optional[bool][source]¶
Delete by vector ID or other criteria.
Parameters
ids – List of ids to delete.
**kwargs – Other ke... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html |
ee0e31c7667f-10 | tvs = TimescaleVector.from_embeddings(text_embedding_pairs, embeddings)
classmethod from_existing_index(embedding: Embeddings, collection_name: str = 'langchain_store', distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, pre_delete_collection: bool = False, **kwargs: Any) → TimescaleVector[source]¶
Get intsa... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html |
ee0e31c7667f-11 | Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevan... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html |
ee0e31c7667f-12 | Returns
List of Documents most similar to the query.
similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[Union[dict, list]] = None, predicates: Optional[Predicates] = None, **kwargs: Any) → List[Document][source]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embeddin... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html |
ee0e31c7667f-13 | 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[Union[dict, list]] = None, predicates: Optional[Predicates] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶ | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html |
f25831f9adad-0 | langchain.vectorstores.pgembedding.PGEmbedding¶
class langchain.vectorstores.pgembedding.PGEmbedding(connection_string: str, embedding_function: Embeddings, collection_name: str = 'langchain', collection_metadata: Optional[dict] = None, pre_delete_collection: bool = False, logger: Optional[Logger] = None)[source]¶
Post... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
f25831f9adad-1 | add_texts(texts[, metadatas, ids])
Run more texts through the embeddings and add to the vectorstore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_mar... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
f25831f9adad-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])
Return docs most si... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
f25831f9adad-3 | Returns
List of IDs of the added texts.
Return type
List[str]
add_embeddings(texts: List[str], embeddings: List[List[float]], metadatas: List[dict], ids: List[str], **kwargs: Any) → None[source]¶
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → Li... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
f25831f9adad-4 | 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
“similarity_score_threshold”.
search_kwargs (Optional[Dict]) ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
f25831f9adad-5 | 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, **kwargs: Any) → List[Document]¶
Return docs most similar to query u... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
f25831f9adad-6 | Return type
Optional[bool]
delete_collection() → None[source]¶
drop_tables() → None[source]¶
classmethod from_documents(documents: List[Document], embedding: Embeddings, collection_name: str = 'langchain', ids: Optional[List[str]] = None, pre_delete_collection: bool = False, **kwargs: Any) → PGEmbedding[source]¶
Return... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
f25831f9adad-7 | among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to max... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
f25831f9adad-8 | Return docs most similar to query.
similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[dict] = None, **kwargs: Any) → List[Document][source]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. De... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.PGEmbedding.html |
2efe35f3ec2c-0 | langchain.vectorstores.clickhouse.ClickhouseSettings¶
class langchain.vectorstores.clickhouse.ClickhouseSettings[source]¶
Bases: BaseSettings
ClickHouse client configuration.
Attribute:
clickhouse_host (str)An URL to connect to MyScale backend.Defaults to ‘localhost’.
clickhouse_port (int) : URL port to connect with HT... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.ClickhouseSettings.html |
2efe35f3ec2c-1 | Raises ValidationError if the input data cannot be parsed to form a valid model.
param column_map: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata': 'metadata', 'uuid': 'uuid'}¶
param database: str = 'default'¶
param host: str = 'localhost'¶
param index_param: Optional[Union[Li... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.ClickhouseSettings.html |
2efe35f3ec2c-2 | the new model: you should trust this data
deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[boo... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.ClickhouseSettings.html |
2efe35f3ec2c-3 | 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.vectorstores.clickhouse.ClickhouseSettings.html |
5d7e1a17e86a-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]¶
Vectara API vector store.
See (https://vectara.com).
Example
from langch... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
5d7e1a17e86a-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.vectorstores.vectara.Vectara.html |
5d7e1a17e86a-2 | Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k, ...])
Return Vectara documents most similar to query, along with scores.
__init__(vectara_customer_id: Optional[str] = None, vectara_corpus_id: Optional[str] = None, vectara_api_key: Optional[str] = None, vectara_api_timeout: ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
5d7e1a17e86a-3 | Parameters
files_list – Iterable of strings, each representing a local file path.
Files could be text, HTML, PDF, markdown, doc/docx, ppt/pptx, etc.
see API docs for full list
metadatas – Optional list of metadatas associated with each file
Returns
List of ids associated with each of the files indexed
add_texts(texts: ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
5d7e1a17e86a-4 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectaraRetr... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
5d7e1a17e86a-5 | search_kwargs={'k': 5, 'fetch_k': 50}
)
# Only retrieve documents that have a relevance score
# Above a certain threshold
docsearch.as_retriever(
search_type="similarity_score_threshold",
search_kwargs={'score_threshold': 0.8}
)
# Only get the single most similar document from the dataset
docsearch.as_retriever... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
5d7e1a17e86a-6 | Return VectorStore initialized from documents and embeddings.
classmethod from_files(files: 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.
.. rub... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
5d7e1a17e86a-7 | lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int =... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
5d7e1a17e86a-8 | filter – Dictionary of argument(s) to filter on metadata. For example a
filter can be “doc.rating > 3.0 and part.lang = ‘deu’”} see
https://docs.vectara.com/docs/search-apis/sql/filter-overview for more
details.
n_sentence_context – number of sentences before/after the matching segment
to add, defaults to 2
Returns
Lis... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
5d7e1a17e86a-9 | Return Vectara documents most similar to query, along with scores.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 5.
lambda_val – lexical match parameter for hybrid search.
filter – Dictionary of argument(s) to filter on metadata. For example a
filter can be “doc... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html |
69df14cbb4a5-0 | langchain.vectorstores.zilliz.Zilliz¶
class langchain.vectorstores.zilliz.Zilliz(embedding_function: Embeddings, collection_name: str = 'LangChainCollection', connection_args: Optional[dict[str, Any]] = None, consistency_level: str = 'Session', index_params: Optional[dict] = None, search_params: Optional[dict] = None, ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-1 | here are a few of the options:
address (str): The actual address of Zillizinstance. Example address: “localhost:19530”
uri (str): The uri of Zilliz instance. Example uri:“https://in03-ba4234asae.api.gcp-us-west1.zillizcloud.com”,
host (str): The host of Zilliz instance. Default at “localhost”,PyMilvus will fill in the ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-2 | # Connect to a Zilliz instance
milvus_store = Milvus(
embedding_function = embedding,
collection_name = “LangChainCollection”,
connection_args = {
“uri”: “https://in03-ba4234asae.api.gcp-us-west1.zillizcloud.com”,
“user”: “temp”,
“password”: “temp”,
“token”: “temp”, # API key as replacements for user and password
“secu... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-3 | Return VectorStoreRetriever initialized from this VectorStore.
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-4 | Perform a search on a query string and return results with score.
__init__(embedding_function: Embeddings, collection_name: str = 'LangChainCollection', connection_args: Optional[dict[str, Any]] = None, consistency_level: str = 'Session', index_params: Optional[dict] = None, search_params: Optional[dict] = None, drop_o... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-5 | in creating a new Collection. The data of the first entity decides
the schema of the new collection, the dim is extracted from the first
embedding and the columns are decided by the first metadata dict.
Metada keys will need to be present for all inserted values. At
the moment there is no None equivalent in Milvus.
Par... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-6 | 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.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-7 | )
# 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.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-8 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = 'LangChainCollection', connection_args: Optional[Dict[str, Any]] = None, consistency_level: str = 'Session', index_params: Optional... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-9 | Returns
Zilliz Vector Store
Return type
Zilliz
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document]¶
Perform a search and return results that are reorder... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-10 | Parameters
embedding (str) – The embedding vector being searched.
k (int, optional) – How many results to give. Defaults to 4.
fetch_k (int, optional) – Total results to select k from.
Defaults to 20.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-11 | Returns
Document results for search.
Return type
List[Document]
similarity_search_by_vector(embedding: List[float], k: int = 4, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document]¶
Perform a similarity search against the query string.
Parameters
embed... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-12 | Perform a search on a query string and return results with score.
For more information about the search parameters, take a look at the pymilvus
documentation found here:
https://milvus.io/api-reference/pymilvus/v2.2.6/Collection/search().md
Parameters
query (str) – The text being searched.
k (int, optional) – The amoun... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
69df14cbb4a5-13 | Defaults to None.
kwargs – Collection.search() keyword arguments.
Returns
Result doc and score.
Return type
List[Tuple[Document, float]] | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
53b3d39d5352-0 | langchain.vectorstores.elasticsearch.ApproxRetrievalStrategy¶
class langchain.vectorstores.elasticsearch.ApproxRetrievalStrategy(query_model_id: Optional[str] = None, hybrid: Optional[bool] = False)[source]¶
Approximate retrieval strategy using the HNSW algorithm.
Methods
__init__([query_model_id, hybrid])
before_index... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ApproxRetrievalStrategy.html |
53b3d39d5352-1 | Parameters
query_vector – The query vector,
or None if not using vector-based query.
query – The text query, or None if not using text-based query.
k – The total number of results to retrieve.
fetch_k – The number of results to fetch initially.
vector_query_field – The field containing the vector
representations in the... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.ApproxRetrievalStrategy.html |
95086f636593-0 | langchain.vectorstores.qdrant.QdrantException¶
class langchain.vectorstores.qdrant.QdrantException[source]¶
Qdrant related exceptions. | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.qdrant.QdrantException.html |
ac2244dbdc41-0 | langchain.vectorstores.milvus.Milvus¶
class langchain.vectorstores.milvus.Milvus(embedding_function: Embeddings, collection_name: str = 'LangChainCollection', connection_args: Optional[dict[str, Any]] = None, consistency_level: str = 'Session', index_params: Optional[dict] = None, search_params: Optional[dict] = None, ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-1 | to False.
primary_field (str) – Name of the primary key field. Defaults to “pk”.
text_field (str) – Name of the text field. Defaults to “text”.
vector_field (str) – Name of the vector field. Defaults to “vector”.
The connection args used for this class comes in the form of a dict,
here are a few of the options:
address... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-2 | server_name (str): If use tls, need to write the common name.
Example
from langchain.vectorstores import Milvus
from langchain.embeddings import OpenAIEmbeddings
embedding = OpenAIEmbeddings()
# Connect to a milvus instance on localhost
milvus_store = Milvus(
embedding_function = Embeddings,
collection_name = “LangChai... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-3 | 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 most similar to query.
delete([ids])
Del... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-4 | Perform a search on a query string and return results with score.
__init__(embedding_function: Embeddings, collection_name: str = 'LangChainCollection', connection_args: Optional[dict[str, Any]] = None, consistency_level: str = 'Session', index_params: Optional[dict] = None, search_params: Optional[dict] = None, drop_o... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-5 | in creating a new Collection. The data of the first entity decides
the schema of the new collection, the dim is extracted from the first
embedding and the columns are decided by the first metadata dict.
Metada keys will need to be present for all inserted values. At
the moment there is no None equivalent in Milvus.
Par... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-6 | 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.vectorstores.milvus.Milvus.html |
ac2244dbdc41-7 | )
# 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.vectorstores.milvus.Milvus.html |
ac2244dbdc41-8 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = 'LangChainCollection', connection_args: dict[str, Any] = {'host': 'localhost', 'password': '', 'port': '19530', 'secure': False, 'u... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-9 | Returns
Milvus Vector Store
Return type
Milvus
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document][source]¶
Perform a search and return results that are... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-10 | Parameters
embedding (str) – The embedding vector being searched.
k (int, optional) – How many results to give. Defaults to 4.
fetch_k (int, optional) – Total results to select k from.
Defaults to 20.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-11 | Returns
Document results for search.
Return type
List[Document]
similarity_search_by_vector(embedding: List[float], k: int = 4, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document][source]¶
Perform a similarity search against the query string.
Paramete... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-12 | Perform a search on a query string and return results with score.
For more information about the search parameters, take a look at the pymilvus
documentation found here:
https://milvus.io/api-reference/pymilvus/v2.2.6/Collection/search().md
Parameters
query (str) – The text being searched.
k (int, optional) – The amoun... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
ac2244dbdc41-13 | Defaults to None.
kwargs – Collection.search() keyword arguments.
Returns
Result doc and score.
Return type
List[Tuple[Document, float]]
Examples using Milvus¶
Milvus
Zilliz | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.milvus.Milvus.html |
0738b1b6b35e-0 | langchain.vectorstores.redis.schema.RedisField¶
class langchain.vectorstores.redis.schema.RedisField[source]¶
Bases: BaseModel
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 valid model.
param name: str [Required]¶
clas... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.RedisField.html |
0738b1b6b35e-1 | 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.vectorstores.redis.schema.RedisField.html |
ddd8fa3ed40c-0 | langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch¶
class langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch(doc_index: BaseDocIndex, embedding: Embeddings)[source]¶
In-memory DocArray storage for exact search.
To use it, you should have the docarray package with version >=0.32.0 installed.
... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
ddd8fa3ed40c-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 most similar to query.
delete([ids])
Delete by vector ID or other criteria.
from_documents(documents, e... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
ddd8fa3ed40c-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.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
ddd8fa3ed40c-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]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStore... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
ddd8fa3ed40c-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.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
ddd8fa3ed40c-5 | Return VectorStore initialized from documents and embeddings.
classmethod from_params(embedding: Embeddings, metric: Literal['cosine_sim', 'euclidian_dist', 'sgeuclidean_dist'] = 'cosine_sim', **kwargs: Any) → DocArrayInMemorySearch[source]¶
Initialize DocArrayInMemorySearch store.
Parameters
embedding (Embeddings) – E... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
ddd8fa3ed40c-6 | among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to max... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
ddd8fa3ed40c-7 | Returns
List of Documents most similar to the query.
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch.html |
a4e606b2fafb-0 | langchain.vectorstores.dashvector.DashVector¶
class langchain.vectorstores.dashvector.DashVector(collection: Any, embedding: Embeddings, text_field: str)[source]¶
DashVector vector store.
To use, you should have the dashvector python package installed.
Example
from langchain.vectorstores import dashvector
from langchai... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dashvector.DashVector.html |
a4e606b2fafb-1 | Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
Return VectorStoreRetriever initialized from this VectorStore.
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilar... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dashvector.DashVector.html |
a4e606b2fafb-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]
async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶
Run... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dashvector.DashVector.html |
a4e606b2fafb-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.vectorstores.dashvector.DashVector.html |
a4e606b2fafb-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.vectorstores.dashvector.DashVector.html |
a4e606b2fafb-5 | Returns
True if deletion is successful,
False otherwise.
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dashvector.DashVector.html |
a4e606b2fafb-6 | to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
filter – Doc fields filter conditions that meet the SQL where clause
specification.
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_mu... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dashvector.DashVector.html |
a4e606b2fafb-7 | specification.
Returns
List of Documents most similar to the query text.
similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[str] = None, **kwargs: Any) → List[Document][source]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.dashvector.DashVector.html |
c686eecb3ad1-0 | langchain.vectorstores.redis.schema.HNSWVectorField¶
class langchain.vectorstores.redis.schema.HNSWVectorField[source]¶
Bases: RedisVectorField
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 valid model.
param algorithm... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.HNSWVectorField.html |
c686eecb3ad1-1 | the new model: you should trust this data
deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[boo... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.HNSWVectorField.html |
c686eecb3ad1-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.vectorstores.redis.schema.HNSWVectorField.html |
894f4b257e06-0 | langchain.vectorstores.elasticsearch.SparseRetrievalStrategy¶
class langchain.vectorstores.elasticsearch.SparseRetrievalStrategy(model_id: Optional[str] = None)[source]¶
Sparse retrieval strategy using the text_expansion processor.
Methods
__init__([model_id])
before_index_setup(client, text_field, ...)
Executes before... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.SparseRetrievalStrategy.html |
894f4b257e06-1 | Returns
The Elasticsearch settings and mappings for the strategy.
Return type
Dict
query(query_vector: Optional[List[float]], query: Optional[str], k: int, fetch_k: int, vector_query_field: str, text_field: str, filter: List[dict], similarity: Optional[DistanceStrategy]) → Dict[source]¶
Executes when a search is perfor... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elasticsearch.SparseRetrievalStrategy.html |
66e383f1c3b8-0 | langchain.vectorstores.usearch.dependable_usearch_import¶
langchain.vectorstores.usearch.dependable_usearch_import() → Any[source]¶
Import usearch if available, otherwise raise error. | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.usearch.dependable_usearch_import.html |
da345d1b411f-0 | langchain.vectorstores.sklearn.SKLearnVectorStoreException¶
class langchain.vectorstores.sklearn.SKLearnVectorStoreException[source]¶
Exception raised by SKLearnVectorStore. | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStoreException.html |
d7f28365ce2a-0 | langchain.vectorstores.singlestoredb.SingleStoreDB¶
class langchain.vectorstores.singlestoredb.SingleStoreDB(embedding: Embeddings, *, distance_strategy: DistanceStrategy = DistanceStrategy.DOT_PRODUCT, table_name: str = 'embeddings', content_field: str = 'content', metadata_field: str = 'metadata', vector_field: str =... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-1 | Defaults to “vector”.
pool (Following arguments pertain to the connection) –
pool_size (int, optional) – Determines the number of active connections in
the pool. Defaults to 5.
max_overflow (int, optional) – Determines the maximum number of connections
allowed beyond the pool_size. Defaults to 10.
timeout (float, opti... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-2 | Automatically enabled if ssl_ca is specified.
ssl_verify_identity (bool, optional) – Verifies the server’s identity.
conv (dict[int, Callable], optional) – A dictionary of data conversion
functions.
credential_type (str, optional) – Specifies the type of authentication to
use: auth.PASSWORD, auth.JWT, or auth.BROWSER_S... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-3 | Attributes
embeddings
Access the query embedding object if available.
vector_field
Pass the rest of the kwargs to the connection.
connection_kwargs
Add program name and version to connection attributes.
Methods
__init__(embedding, *[, distance_strategy, ...])
Initialize with necessary components.
aadd_documents(documen... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-4 | from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas, ...])
Create a SingleStoreDB vectorstore from raw documents. This is a user-friendly interface that: 1. Embeds documents. 2. Creates a new table for the embeddings in... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-5 | distance_strategy (DistanceStrategy, optional) – Determines the strategy employed for calculating
the distance between vectors in the embedding space.
Defaults to DOT_PRODUCT.
Available options are:
- DOT_PRODUCT: Computes the scalar product of two vectors.
This is the default behavior
EUCLIDEAN_DISTANCE: Computes the ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-6 | database (str, optional) – Database name.
the (Additional optional arguments provide further customization over) –
connection –
pure_python (bool, optional) – Toggles the connector mode. If True,
operates in pure Python mode.
local_infile (bool, optional) – Allows local file uploads.
charset (str, optional) – Specifi... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-7 | )
Advanced Usage:
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import SingleStoreDB
vectorstore = SingleStoreDB(
OpenAIEmbeddings(),
distance_strategy=DistanceStrategy.EUCLIDEAN_DISTANCE,
host="127.0.0.1",
port=3306,
user="user",
password="password",
database... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-8 | Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, embeddings: Optional[List[List[float]]] = None, **kwargs: Any) → List[str][source]¶
Add more texts to the vectorstore.
Parameters
texts (Iterable[str]) – Iterable of strings/text to add ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-9 | 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. ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-10 | 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.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-11 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, distance_strategy: DistanceStrategy = DistanceStrategy.DOT_PRODUCT, table_name: str = 'embeddings', content_field: str = 'content', metadata_field: str = ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-12 | Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevan... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
d7f28365ce2a-13 | 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... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.