Skip to content

Vector Search index not detected despite correct Atlas setup and permissions #2

@le-dawg

Description

@le-dawg

Problem Summary

When using the mongodb-rag library in a Node.js environment, the application fails to detect an existing Atlas Vector Search index, even though:

  • The Vector Search index (named vector_index) is fully present and queryable, as verified via the Atlas UI.
  • The index is on the correct collection and database (broenRAG-test.TIdata), with correct vector path, dimensions, and similarity method.
  • The database user has full atlasAdmin permissions (confirmed in Atlas UI).
  • Network access is set to open (0.0.0.0/0).
  • The connection string is correct and matches what is shown in the Atlas UI.

Despite all this, the library throws:

Error: Vector search index 'vector_index' does not exist. Please create it using 'npx mongodb-rag init'.

A direct test using the Node.js MongoDB driver (6.20.0) outside of mongodb-rag can see the index and execute a $vectorSearch aggregation with no problem.

Steps to Reproduce

  1. Create a vector search index in Atlas UI matching the config (see screenshot).
  2. Ensure user permissions, network access, and connection string are all correct.
  3. Run the application using mongodb-rag.
  4. Observe the error that the index does not exist.

Evidence

  • Screenshots show the index exists and is queryable in Atlas UI.
  • Custom test script using the same connection string and driver version can see and use the index.
Atlas index configuration screenshot Atlas user permissions screenshot

Mitigation/Workaround

  • As a workaround, using the Node.js MongoDB driver directly (bypassing mongodb-rag) works fine for both listing search indexes and running vector search queries.
  • However, this requires reimplementing RAG features manually and defeats the purpose of using this library.

Request

Please investigate potential dependency, driver, or internal library bugs causing this issue, especially around index detection. If there are known version incompatibilities or specific cache/lock issues, please add this to the documentation or provide guidance for robust troubleshooting.

Thank you for your work on this valuable project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions