MongoDB Vector Search is a feature that allows you to store and search for vectors in MongoDB.

Setup

  1. Register for an Atlas account using your Google Account or an email address.

  2. Create and deploy a Free cluster. You can use Atlas Free clusters as a small-scale development environment to host your data. Free clusters never expire, and provide access to a subset of Atlas features.

  3. Connect to your cluster using the mongosh, the Node.js driver, the PyMongo driver, or Compass.

  4. Load the mflix dataset into your cluster.

  5. Install Langtrace, PyMongo, and OpenAI

pip install langtrace-python-sdk pymongo openai
You’ll need API keys from Langtrace and OpenAI. Sign up for Langtrace and OpenAI if you haven’t done so already.

Usage

here’s an example of how to use Langtrace with MongoDB: