Find answers from the community

Updated 3 months ago

hey, i just wonder if i can use

hey, i just wonder if i can use llamaIndex with local mongo db (i use the npx template for the express app)
and wonder if its works only with atlas
Attachment
image.png
L
G
S
15 comments
I don't think local mongodb supports vectors right?
or did that change?
when i run npm run generate its run successfully and create this db
but when i running "npm run dev"
im getting error... looks like its related to the db
Attachment
image.png
1] Error: Dynamic require of "timers" is not supported
Hmmm intersting. I'm not sure on the timers thing, I'm not really a JS expert πŸ˜… Maybe realated to the node version?
What do you think about the way it saved the db
When I install it without the mongodb,
(working with local files) this produces 3 files.

and when i run npm run dev its works...
Attachment
image.png
maybe MONGO_VECTOR_INDEX var should be something specific?
sorry for the newbe question... kinda new for this.
Right, when working with local/default vector db, it produces those 3 files. But with mongodb, it basically stores everything in the db itself.

Maybe, the code to "load" the index needs to be slightly modified? πŸ€” I wonder if its similar to the python framework... I will take a peek
so i solve this issue by install mongo πŸ˜… (npm i mongodb)...
it should be part package.json by default (when installing via create-llama) in my opinion...

so now the server is running... but im facing other issue after sending msg
Plain Text
[1] Running query pipeline:  [
[1]   {
[1]     '$vectorSearch': {
[1]       queryVector: [Array],
[1]       path: 'embedding',
[1]       numCandidates: 50,
[1]       limit: 5,
[1]       index: 'vector_index'
[1]     }
[1]   },
[1]   { '$project': { score: [Object], embedding: 0 } }
[1] ]
[1] /path-to-project/backend/node_modules/mongodb/lib/cmap/connection.js:205
[1]                 callback(new error_1.MongoServerError(document));
[1]                          ^
[1] 
[1] MongoServerError: Unrecognized pipeline stage name: '$vectorSearch'
[1]     at Connection.onMessage (/path-to-project/backend/node_modules/mongodb/lib/cmap/connection.js:205:26)
[1]     at MessageStream.<anonymous> (/path-to-project/backend/node_modules/mongodb/lib/cmap/connection.js:64:60)
[1]     at MessageStream.emit (node:events:514:28)
[1]     at processIncomingData (/path-to-project/backend/node_modules/mongodb/lib/cmap/message_stream.js:117:16)
[1]     at MessageStream._write (/path-to-project/backend/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
[1]     at writeOrBuffer (node:internal/streams/writable:447:12)
[1]     at _write (node:internal/streams/writable:389:10)
[1]     at Writable.write (node:internal/streams/writable:393:10)
[1]     at Socket.ondata (node:internal/streams/readable:817:22)
[1]     at Socket.emit (node:events:514:28)
[1]     at addChunk (node:internal/streams/readable:376:12)
[1]     at readableAddChunk (node:internal/streams/readable:349:9)
[1]     at Readable.push (node:internal/streams/readable:286:10)
[1]     at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
[1]   ok: 0,
[1]   code: 40324,
[1]   codeName: 'Location40324',
[1]   [Symbol(errorLabels)]: Set(0) {}
[1] }
[1] 
[1] Node.js v20.9.0
so the MONGO_VECTOR_INDEX should be something specific or any random string?
Hmm I wonder if this is because local mongodb doesn't support vector search?
I've really only used it with atlas before
Yeah, I can't find any references to MongoDB vector search outside of Atlas, which is a hosted product.
Add a reply
Sign up and join the conversation on Discord