MongoDB Atlas is a fully-managed cloud database available in AWS, Azure, and GCP. It now has support for native Vector Search on the MongoDB document data.
Installation and Setup
See detail configuration instructions. We need to installlangchain-mongodb
python package.
Vector Store
See a usage example.Retrievers
Full Text Search Retriever
Hybrid Search Retriever
performs full-text searches using Lucene’s standard (BM25
) analyzer.
Hybrid Search Retriever
Hybrid Search Retriever
combines vector and full-text searches weighting them the viaReciprocal Rank Fusion
(RRF
) algorithm.
Model Caches
MongoDBCache
An abstraction to store a simple cache in MongoDB. This does not use Semantic Caching, nor does it require an index to be made on the collection before generation. To import this cache:MongoDBAtlasSemanticCache
Semantic caching allows users to retrieve cached prompts based on semantic similarity between the user input and previously cached results. Under the hood it blends MongoDBAtlas as both a cache and a vectorstore. The MongoDBAtlasSemanticCache inherits fromMongoDBAtlasVectorSearch
and needs an Atlas Vector Search Index defined to work. Please look at the usage example on how to set up the index.
To import this cache: