Vector search demo in mongo using OpenAI embedding
- Create Cluster (M0 tier cluster)
- From Collections tab, load sample dataset
- Verify that sample_mfix database and embedded_movies collections are created
- From Search tab, create index on sample_mflix.embedded_movies. Use JSON Editor with following code snippet.
{ "mappings": { "dynamic": true, "fields": { "plot_embedding": { "dimensions": 1536, "similarity": "cosine", "type": "knnVector" } } } }
- Install latest version of node.js
brew install node
- Install modules axis, mongodb
npm install axis
npm install mongodb
- Modify the app.js file to replace and MongoDB
- Download the app.js file and run the application
node app.js
- In the browser, invoke following url to invoke the vector search and view the results.