langchain-mongodb
package.
MongoDB Atlas is a fully-managed cloud database available in AWS, Azure, and GCP. It supports native Vector Search, full text search (BM25), and hybrid search on your MongoDB document data.
MongoDB Atlas Vector Search allows to store your embeddings in MongoDB documents, create a vector search index, and perform KNN search with an approximate nearest neighbor algorithm (Hierarchical Navigable Small Worlds
). It uses the $vectorSearch MQL Stage.
*An Atlas cluster running MongoDB version 6.0.11, 7.0.2, or later (including RCs).To use MongoDB Atlas, you must first deploy a cluster. We have a Forever-Free tier of cluster on a cloud of your choice available. To get started head over to Atlas here: quick start. You’ll need to install
langchain-mongodb
and pymongo
to use this integration.
vector_store.create_vector_search_index
command above, you can also create the vector search index using the Atlas UI with the following index definition:
add_documents
function.
source
field as the filter field.
This can be done programmatically using the MongoDBAtlasVectorSearch.create_vector_search_index
method.
MongoDBAtlasVectorStore
check out the API reference.
- More documentation can be found at MongoDB’s LangChain Docs site
- This feature is Generally Available and ready for production deployments.
- The langchain version 0.0.305 (release notes) introduces the support for $vectorSearch MQL stage, which is available with MongoDB Atlas 6.0.11 and 7.0.2. Users utilizing earlier versions of MongoDB Atlas need to pin their LangChain version to <=0.0.304
MongoDBAtlasVectorSearch
features and configurations head to the API reference: https://python.langchain.com/api_reference/mongodb/index.html