mongodb-developer / GenAI-Showcase

GenAI Cookbook
https://www.mongodb.com/cloud/atlas/register
MIT License
402 stars 87 forks source link

Error using nodejs to create vector search index on mongodb 7 #15

Open databloom opened 4 months ago

databloom commented 4 months ago

I'm porting a RAG pipeline from GenAI-Showcase that was using Atlas to a mongdb local instance to the LLM.

Following https://www.mongodb.com/docs/compass/current/indexes/create-vector-search-index/, I installed node >16.4 and npm mongodb module but it appears that the installed mongodb module is missing a createSearchIndexes context.

root@ad93b157e668:/GenAI-Showcase/mongodb-vector-search# node atlas-vector-search-quick-start.js MongoServerError: no such command: 'createSearchIndexes' at Connection.sendCommand (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/cmap/connection.js:297:27) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Connection.command (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/cmap/connection.js:325:26) at async Server.command (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/sdam/server.js:166:24) at async CreateSearchIndexesOperation.execute (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/operations/search_indexes/create.js:21:21) at async executeOperation (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/operations/execute_operation.js:112:20) at async Collection.createSearchIndexes (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/collection.js:609:16) at async Collection.createSearchIndex (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/collection.js:596:25) at async run (/GenAI-Showcase/mongodb-vector-search/atlas-vector-search-quick-start.js:30:21) { errorResponse: { ok: 0, errmsg: "no such command: 'createSearchIndexes'", code: 59, codeName: 'CommandNotFound' }, ok: 0, code: 59, codeName: 'CommandNotFound', [Symbol(errorLabels)]: Set(0) {} }

Does mongodb 7.0 support vector search index definition ? Is Atlas your only offering that supports vector search ?

Pash10g commented 1 month ago

Hello @databloom ,

At the moment only Atlas support the search indexes. Having said that, in the near future it will be available in community and enterprise, stay tuned.

If you just want to test out this notebook you can use a local atlas deployment for testing:

https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-local-cloud/