MongoDB is an open source document database. The company behind the open source product offers a managed cloud product MongoDB Atlas. As of right now, only the Atlas version supports vector search while the open source version does not.

To use MongoDB as your vector database, follow these steps -

  • Sign up for a MongoDB Atlas account if you haven’t already. Once you have signed up, you will need to spin up a new cluster (or use an existing one)

You will need to provision a M10 (or higher) instance type to use Atlas vector search. Cheaper instance types or the free version (M0) give an error when vector indexes are created programatically.

  • The cluster creation takes a few minutes. Once the cluster is ready, click on the connect button on the dashboard to get the connection string.

You will need to add users separately and allow IP access from your relevant development and production environments.

Install MongoDB addon

npm install @llm-tools/embedjs-mongodb

Usage

If you can't find specific feature or run into issues, please feel free to reach out through the following channels.

Was this page helpful?