MongoDBAtlasSemanticCache(
self,
connection_string: str,
embedding: Embeddings,
collection_name: str =Construct a RecordManager from a MongoDB connection URI.
Close the resources used by the MongoDBRecordManager.
Add texts, create embeddings, and add to the Collection and index.
Get documents by their IDs.
Bulk insert single batch of texts, embeddings, and optionally ids.
Add documents to the vectorstore.
Return MongoDB documents most similar to the given query and their scores.
Return MongoDB documents most similar to the given query.
Return documents selected using the maximal marginal relevance.
Construct a MongoDB Atlas Vector Search vector store from raw documents.
Delete documents from VectorStore by ids.
Delete by vector ID or other criteria.
Return docs selected using the maximal marginal relevance.
Return docs selected using the maximal marginal relevance.
Creates a MongoDB Atlas vectorSearch index for the VectorStore
Return MongoDB documents most similar to the given query vector.
| Name | Type | Description |
|---|---|---|
connection_string* | str | MongoDB URI to connect to MongoDB Atlas cluster. |
embedding* | Embeddings | Text embedding model to use. |
collection_name | str | Default: 'default'MongoDB Collection to add the texts to. Defaults to "default". |
database_name | str | Default: 'default' |
index_name | str | Default: 'default' |
wait_until_ready | float | Default: None |
MongoDB Atlas Semantic cache.
A Cache backed by a MongoDB Atlas server with vector-store support
MongoDB Database where to store texts. Defaults to "default".
Name of the Atlas Search index. defaults to 'default'
Wait this time for Atlas to finish indexing the stored text. Defaults to None.