id stringlengths 14 15 | text stringlengths 44 2.47k | source stringlengths 61 181 |
|---|---|---|
951a95fa9e8d-6 | Returns
MyScale Index
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parame... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScale.html |
951a95fa9e8d-7 | Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, where_str: Optional[str] = None, **kwargs: Any) → List[Document][source]¶
Perform a similarity search with MyScale
Parameters
query (str) – query string
k (int, optional) – Top K neighbors to retrieve. Defaults to 4... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScale.html |
951a95fa9e8d-8 | Perform a similarity search with MyScale
Parameters
query (str) – query string
k (int, optional) – Top K neighbors to retrieve. Defaults to 4.
where_str (Optional[str], optional) – where condition string.
Defaults to None.
NOTE – Please do not let end-user to fill this and always be aware
of SQL injection. When dealing... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScale.html |
c6fd80f594d6-0 | langchain.vectorstores.redis.filters.RedisTag¶
class langchain.vectorstores.redis.filters.RedisTag(field: str)[source]¶
A RedisTag is a RedisFilterField representing a tag in a Redis index.
Create a RedisTag FilterField
Parameters
field (str) – The name of the RedisTag field in the index to be queried
against.
Attribut... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.filters.RedisTag.html |
05cb13ee297c-0 | langchain.vectorstores.starrocks.get_named_result¶
langchain.vectorstores.starrocks.get_named_result(connection: Any, query: str) → List[dict[str, Any]][source]¶
Get a named result from a query.
:param connection: The connection to the database
:param query: The query to execute
Returns
The result of the query
Return t... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.get_named_result.html |
7336bb13bca1-0 | langchain.vectorstores.pgembedding.EmbeddingStore¶
class langchain.vectorstores.pgembedding.EmbeddingStore(**kwargs)[source]¶
Embedding store.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and
values in kwargs.
Only keys that are present as
attr... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.EmbeddingStore.html |
6e88cd2482e2-0 | langchain.vectorstores.pgembedding.BaseModel¶
class langchain.vectorstores.pgembedding.BaseModel(**kwargs: Any)[source]¶
Base model for all SQL stores.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and
values in kwargs.
Only keys that are presen... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pgembedding.BaseModel.html |
34d0b978971e-0 | langchain.vectorstores.utils.maximal_marginal_relevance¶
langchain.vectorstores.utils.maximal_marginal_relevance(query_embedding: ndarray, embedding_list: list, lambda_mult: float = 0.5, k: int = 4) → List[int][source]¶
Calculate maximal marginal relevance. | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.utils.maximal_marginal_relevance.html |
7d9eb9e92e94-0 | langchain.vectorstores.redis.base.check_index_exists¶
langchain.vectorstores.redis.base.check_index_exists(client: RedisType, index_name: str) → bool[source]¶
Check if Redis index exists. | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.base.check_index_exists.html |
76c52eb9e0fe-0 | langchain.vectorstores.myscale.MyScaleSettings¶
class langchain.vectorstores.myscale.MyScaleSettings[source]¶
Bases: BaseSettings
MyScale client configuration.
Attribute:
myscale_host (str)An URL to connect to MyScale backend.Defaults to ‘localhost’.
myscale_port (int) : URL port to connect with HTTP. Defaults to 8443.... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleSettings.html |
76c52eb9e0fe-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.vectorstores.myscale.MyScaleSettings.html |
76c52eb9e0fe-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.vectorstores.myscale.MyScaleSettings.html |
05e647af3f13-0 | langchain.vectorstores.sklearn.BsonSerializer¶
class langchain.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()
Loads the data fro... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.BsonSerializer.html |
b0c5d86da19f-0 | langchain.vectorstores.annoy.Annoy¶
class langchain.vectorstores.annoy.Annoy(embedding_function: Callable, index: Any, metric: str, docstore: Docstore, index_to_docstore_id: Dict[int, str])[source]¶
Annoy vector store.
To use, you should have the annoy python package installed.
Example
from langchain.vectorstores impor... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
b0c5d86da19f-1 | 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.annoy.Annoy.html |
b0c5d86da19f-2 | Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k, ...])
Return docs most similar to query.
similarity_search_with_score_by_index(...[, ...])
Return docs most similar to query.
similarity_search_with_score_by_vector(embedding)
Return docs most similar to query.
__init__(embedd... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
b0c5d86da19f-3 | kwargs – vectorstore specific parameters
Returns
List of ids from adding the texts into the vectorstore.
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],... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
b0c5d86da19f-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.vectorstores.annoy.Annoy.html |
b0c5d86da19f-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 most similar to query.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool]¶
Delete by vector ID or other criteria.
Parameter... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
b0c5d86da19f-6 | from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
text_embeddings = embeddings.embed_documents(texts)
text_embedding_pairs = list(zip(texts, text_embeddings))
db = Annoy.from_embeddings(text_embedding_pairs, embeddings)
classmethod from_texts(texts: List[str], embedding: Embeddings, meta... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
b0c5d86da19f-7 | embeddings – Embeddings to use when generating queries.
max_marginal_relevance_search(query: str, 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 relevance optimizes for similarity to query AND ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
b0c5d86da19f-8 | Turns annoy results into a list of documents and scores.
Parameters
idxs – List of indices of the documents in the index.
dists – List of distances of the documents in the index.
Returns
List of Documents and scores.
save_local(folder_path: str, prefault: bool = False) → None[source]¶
Save Annoy index, docstore, and in... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
b0c5d86da19f-9 | Returns
List of Documents most similar to the embedding.
similarity_search_by_vector(embedding: List[float], k: int = 4, search_k: int = - 1, **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 t... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
b0c5d86da19f-10 | Returns
List of Documents most similar to the query and score for each
similarity_search_with_score_by_index(docstore_index: int, k: int = 4, search_k: int = - 1) → List[Tuple[Document, float]][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents t... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.Annoy.html |
f443a8064e1a-0 | langchain.vectorstores.atlas.AtlasDB¶
class langchain.vectorstores.atlas.AtlasDB(name: str, embedding_function: Optional[Embeddings] = None, api_key: Optional[str] = None, description: str = 'A description for your project', is_public: bool = True, reset_project_if_exists: bool = False)[source]¶
Atlas vector store.
Atl... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
f443a8064e1a-1 | add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ids, refresh])
Run more texts through the embeddings and add to the vectorstore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddi... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
f443a8064e1a-2 | search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k])
Run similarity search with AtlasDB
similarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(query)
Return docs and re... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
f443a8064e1a-3 | 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.atlas.AtlasDB.html |
f443a8064e1a-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.vectorstores.atlas.AtlasDB.html |
f443a8064e1a-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.vectorstores.atlas.AtlasDB.html |
f443a8064e1a-6 | for full detail.
delete(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 use.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
f443a8064e1a-7 | Returns
Nomic’s neural database and finest rhizomatic instrument
Return type
AtlasDB
classmethod from_texts(texts: List[str], embedding: Optional[Embeddings] = None, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, name: Optional[str] = None, api_key: Optional[str] = None, description: str = 'A ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
f443a8064e1a-8 | Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
f443a8064e1a-9 | Parameters
query (str) – Query text to search for.
k (int) – Number of results to return. Defaults to 4.
Returns
List of documents most similar to the query text.
Return type
List[Document]
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embed... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.atlas.AtlasDB.html |
ccff5a4abd6a-0 | langchain.vectorstores.clickhouse.Clickhouse¶
class langchain.vectorstores.clickhouse.Clickhouse(embedding: Embeddings, config: Optional[ClickhouseSettings] = None, **kwargs: Any)[source]¶
ClickHouse VectorSearch vector store.
You need a clickhouse-connect python package, and a valid account
to connect to ClickHouse.
C... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
ccff5a4abd6a-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.vectorstores.clickhouse.Clickhouse.html |
ccff5a4abd6a-2 | ClickHouse Wrapper to LangChain
embedding_function (Embeddings):
config (ClickHouseSettings): Configuration to ClickHouse Client
Other keyword arguments will pass into
[clickhouse-connect](https://docs.clickhouse.com/)
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents throug... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
ccff5a4abd6a-3 | Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
Return VectorStore initialized from texts and embeddings.
async amax_marginal_relevance_search(query: str, k: int = 4, fetch_... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
ccff5a4abd6a-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.vectorstores.clickhouse.Clickhouse.html |
ccff5a4abd6a-5 | Return docs most similar to query.
delete(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 use.
Returns
True if deletion is successful,
False otherwise, None if not im... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
ccff5a4abd6a-6 | Returns
ClickHouse Index
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Par... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
ccff5a4abd6a-7 | Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, where_str: Optional[str] = None, **kwargs: Any) → List[Document][source]¶
Perform a similarity search with ClickHouse
Parameters
query (str) – query string
k (int, optional) – Top K neighbors to retrieve. Defaults t... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
ccff5a4abd6a-8 | Perform a similarity search with ClickHouse
Parameters
query (str) – query string
k (int, optional) – Top K neighbors to retrieve. Defaults to 4.
where_str (Optional[str], optional) – where condition string.
Defaults to None.
NOTE – Please do not let end-user to fill this and always be aware
of SQL injection. When deal... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
70a6eec67143-0 | langchain.vectorstores.sqlitevss.SQLiteVSS¶
class langchain.vectorstores.sqlitevss.SQLiteVSS(table: str, connection: Optional[sqlite3.Connection], embedding: Embeddings, db_file: str = 'vss.db')[source]¶
Wrapper around SQLite with vss extension as a vector database.
To use, you should have the sqlite-vss python package... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sqlitevss.SQLiteVSS.html |
70a6eec67143-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.
create_connection(db_file)
create_table_if_not_exists()
delete([ids])
Delete by ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sqlitevss.SQLiteVSS.html |
70a6eec67143-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.sqlitevss.SQLiteVSS.html |
70a6eec67143-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.sqlitevss.SQLiteVSS.html |
70a6eec67143-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.sqlitevss.SQLiteVSS.html |
70a6eec67143-5 | True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embedd... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sqlitevss.SQLiteVSS.html |
70a6eec67143-6 | Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pa... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sqlitevss.SQLiteVSS.html |
70a6eec67143-7 | 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, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return docs most similar to query.
similarity_searc... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sqlitevss.SQLiteVSS.html |
c3bca3cadc3d-0 | langchain.vectorstores.redis.schema.NumericFieldSchema¶
class langchain.vectorstores.redis.schema.NumericFieldSchema[source]¶
Bases: RedisField
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... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.NumericFieldSchema.html |
c3bca3cadc3d-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.vectorstores.redis.schema.NumericFieldSchema.html |
c3bca3cadc3d-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.NumericFieldSchema.html |
93da0e9f6cfa-0 | langchain.vectorstores.redis.filters.check_operator_misuse¶
langchain.vectorstores.redis.filters.check_operator_misuse(func: Callable) → Callable[source]¶ | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.filters.check_operator_misuse.html |
a6511f31206b-0 | langchain.vectorstores.tencentvectordb.TencentVectorDB¶
class langchain.vectorstores.tencentvectordb.TencentVectorDB(embedding: ~langchain.schema.embeddings.Embeddings, connection_params: ~langchain.vectorstores.tencentvectordb.ConnectionParams, index_params: ~langchain.vectorstores.tencentvectordb.IndexParams = <langc... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tencentvectordb.TencentVectorDB.html |
a6511f31206b-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.vectorstores.tencentvectordb.TencentVectorDB.html |
a6511f31206b-2 | similarity_search_with_score_by_vector(embedding)
Perform a search on a query string and return results with score.
__init__(embedding: ~langchain.schema.embeddings.Embeddings, connection_params: ~langchain.vectorstores.tencentvectordb.ConnectionParams, index_params: ~langchain.vectorstores.tencentvectordb.IndexParams ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tencentvectordb.TencentVectorDB.html |
a6511f31206b-3 | Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
Return VectorStore initialized from texts and embeddings.
async amax_marginal_relevance_search(query: str, k: int = 4, fetch_... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tencentvectordb.TencentVectorDB.html |
a6511f31206b-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.vectorstores.tencentvectordb.TencentVectorDB.html |
a6511f31206b-5 | Return docs most similar to query.
delete(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 use.
Returns
True if deletion is successful,
False otherwise, None if not im... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tencentvectordb.TencentVectorDB.html |
a6511f31206b-6 | Perform a search and return results that are reordered by MMR.
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, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] =... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tencentvectordb.TencentVectorDB.html |
a6511f31206b-7 | Perform a search on a query string and return results with score.
similarity_search_with_score_by_vector(embedding: List[float], k: int = 4, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Perform a search on a query string ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tencentvectordb.TencentVectorDB.html |
ef7b4b7bfaff-0 | langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch¶
class langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch(collection: Collection[MongoDBDocumentType], embedding: Embeddings, *, index_name: str = 'default', text_key: str = 'text', embedding_key: str = 'embedding')[source]¶
MongoDB Atlas Vector S... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
ef7b4b7bfaff-1 | add_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
ef7b4b7bfaff-2 | Return docs most similar to query using specified search type.
similarity_search(query[, k, pre_filter, ...])
Return MongoDB documents most similar to the given query.
similarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(query)
Return docs and... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
ef7b4b7bfaff-3 | 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[str, Any]]] = None, **kwargs: Any) → List[source]¶
Run more texts through the embeddings and add to the vectorstore.
P... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
ef7b4b7bfaff-4 | 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 (Default: 4)
score_threshold: Minimum relevance threshold
for similarity_score... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
ef7b4b7bfaff-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.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
ef7b4b7bfaff-6 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[Dict]] = None, collection: Optional[Collection[MongoDBDocumentType]] = None, **kwargs: Any) → MongoDBAtlasVectorSearch[source]¶
Construct a MongoDB Atlas Vector Search v... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
ef7b4b7bfaff-7 | 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 relevance optimizes for ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
ef7b4b7bfaff-8 | k – (Optional) number of documents to return. Defaults to 4.
pre_filter – (Optional) dictionary of argument(s) to prefilter document
fields on.
post_filter_pipeline – (Optional) Pipeline of MongoDB aggregation stages
following the knnBeta vector search.
Returns
List of documents most similar to the query and their scor... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
ef7b4b7bfaff-9 | validate functionality, and to gather feedback from a small closed group of
early access users. It is not recommended for production deployments as we
may introduce breaking changes.
For more: https://www.mongodb.com/docs/atlas/atlas-search/knn-beta
Parameters
query – Text to look up documents similar to.
k – (Optional... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html |
8141e3a4c137-0 | langchain.vectorstores.redis.filters.RedisFilterExpression¶
class langchain.vectorstores.redis.filters.RedisFilterExpression(_filter: Optional[str] = None, operator: Optional[RedisFilterOperator] = None, left: Optional[RedisFilterExpression] = None, right: Optional[RedisFilterExpression] = None)[source]¶
A RedisFilterE... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.filters.RedisFilterExpression.html |
da9c00522ea3-0 | langchain.vectorstores.redis.schema.TagFieldSchema¶
class langchain.vectorstores.redis.schema.TagFieldSchema[source]¶
Bases: RedisField
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 case_sensitive: b... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.TagFieldSchema.html |
da9c00522ea3-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.vectorstores.redis.schema.TagFieldSchema.html |
da9c00522ea3-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.TagFieldSchema.html |
4b53472f8633-0 | langchain.vectorstores.nucliadb.NucliaDB¶
class langchain.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.
local – Whether to use ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.nucliadb.NucliaDB.html |
4b53472f8633-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.nucliadb.NucliaDB.html |
4b53472f8633-2 | Initialize the NucliaDB client.
Parameters
knowledge_box – the Knowledge Box id.
local – Whether to use a local NucliaDB instance or Nuclia Cloud
api_key – A contributor API key for the kb (needed when local is False)
backend – The backend url to use when local is True, defaults to
http – //localhost:8080
async aadd_do... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.nucliadb.NucliaDB.html |
4b53472f8633-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.nucliadb.NucliaDB.html |
4b53472f8633-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.nucliadb.NucliaDB.html |
4b53472f8633-5 | Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.nucliadb.NucliaDB.html |
4b53472f8633-6 | k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documen... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.nucliadb.NucliaDB.html |
4b53472f8633-7 | Run similarity search with distance.
Examples using NucliaDB¶
NucliaDB | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.nucliadb.NucliaDB.html |
2a6b2aa23d8e-0 | langchain.vectorstores.tencentvectordb.IndexParams¶
class langchain.vectorstores.tencentvectordb.IndexParams(dimension: int, shard: int = 1, replicas: int = 2, index_type: str = 'HNSW', metric_type: str = 'L2', params: Optional[Dict] = None)[source]¶
Tencent vector DB Index params.
See the following documentation for d... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.tencentvectordb.IndexParams.html |
6e40cccc9583-0 | langchain.vectorstores.sklearn.ParquetSerializer¶
class langchain.vectorstores.sklearn.ParquetSerializer(persist_path: str)[source]¶
Serializes data in Apache Parquet format using the pyarrow package.
Methods
__init__(persist_path)
extension()
The file extension suggested by this serializer (without dot).
load()
Loads ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.ParquetSerializer.html |
0a4380319234-0 | langchain.vectorstores.meilisearch.Meilisearch¶
class langchain.vectorstores.meilisearch.Meilisearch(embedding: Embeddings, client: Optional[Client] = None, url: Optional[str] = None, api_key: Optional[str] = None, index_name: str = 'langchain-demo', text_key: str = 'text', metadata_key: str = 'metadata')[source]¶
Meil... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
0a4380319234-1 | Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ids])
Run more text... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
0a4380319234-2 | 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 meilisearch documents most similar to the query.
similarity_search_by_v... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
0a4380319234-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_texts(texts: Iterable[str], metadatas... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
0a4380319234-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) → VectorStore... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
0a4380319234-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.meilisearch.Meilisearch.html |
0a4380319234-6 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, client: Optional[Client] = None, url: Optional[str] = None, api_key: Optional[str] = None, index_name: str = 'langchain-demo', ids: Optional[List[str]] = ... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
0a4380319234-7 | k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documen... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
0a4380319234-8 | k (int) – 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
text and score for each.
Return type
List[Document]
similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[Dict[... | https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.meilisearch.Meilisearch.html |
0a4380319234-9 | 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.vectorstores.meilisearch.Meilisearch.html |
2e3508206da8-0 | langchain_experimental.generative_agents.generative_agent.GenerativeAgent¶
class langchain_experimental.generative_agents.generative_agent.GenerativeAgent[source]¶
Bases: BaseModel
An Agent as a character with memory and innate characteristics.
Create a new model by parsing and validating input data from keyword argume... | https://api.python.langchain.com/en/latest/generative_agents/langchain_experimental.generative_agents.generative_agent.GenerativeAgent.html |
2e3508206da8-1 | 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/generative_agents/langchain_experimental.generative_agents.generative_agent.GenerativeAgent.html |
2e3508206da8-2 | Return a full header of the agent’s status, summary, and current time.
get_summary(force_refresh: bool = False, now: Optional[datetime] = None) → str[source]¶
Return a descriptive summary of the agent.
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntSt... | https://api.python.langchain.com/en/latest/generative_agents/langchain_experimental.generative_agents.generative_agent.GenerativeAgent.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.