title: MongoDB Atlas Vector Store description: The MongoDB Atlas Vector Store node is a component used for upserting embedded data and performing similarity or MMR (Maximal Marginal Relevance) search queries using MongoDB Atlas, a managed cloud MongoDB database. This node allows for efficient storage and retrieval of vector embeddings, making it suitable for various AI and machine learning applications.

Node Details

  • Name: MongoDBAtlas_VectorStores

  • Type: MongoDB Atlas

  • Category: Vector Stores

  • Version: 1.0

Base Classes

  • MongoDB Atlas

  • VectorStoreRetriever

  • BaseRetriever

Parameters

Credential

  • Label: Connect Credential

  • Name: credential

  • Type: credential

  • Credential Names: mongoDBUrlApi

Inputs

  1. Document

    • Type: Document

    • List: true

    • Optional: true

  2. Embeddings

    • Type: Embeddings
  3. Database

    • Type: string

    • Placeholder: DB_NAME

  4. Collection Name

    • Type: string

    • Placeholder: <COLLECTION_NAME>

  5. Index Name

    • Type: string

    • Placeholder: <VECTOR_INDEX_NAME>

  6. Content Field

    • Type: string

    • Default: “text”

    • Description: Name of the field (column) that contains the actual content

    • Optional: true

  7. Embedded Field

    • Type: string

    • Default: “embedding”

    • Description: Name of the field (column) that contains the Embedding

    • Optional: true

  8. Top K

    • Type: number

    • Default: 4

    • Description: Number of top results to fetch

    • Optional: true

  9. MMR-related inputs (added via addMMRInputParams function)

Outputs

  1. MongoDB Retriever

    • Base Classes: [MongoDB Atlas, VectorStoreRetriever, BaseRetriever]
  2. MongoDB Vector Store

    • Base Classes: [MongoDB Atlas, MongoDBAtlasVectorSearch]

Functionality

Upsert Method

  • Adds documents and their embeddings to the MongoDB Atlas database

  • Returns the number of added documents and the added documents themselves

Init Method

  • Initializes the MongoDB Atlas vector store or retriever

  • Sets up the connection to the MongoDB Atlas database

  • Creates a MongoDBAtlasVectorSearch instance for vector operations

Usage

This node is particularly useful for:

  1. Storing document embeddings in a scalable, cloud-based MongoDB solution

  2. Performing similarity searches on stored embeddings

  3. Integrating vector search capabilities into larger AI and machine learning workflows

The node handles connection management, ensuring efficient use of database resources by maintaining a singleton client instance.

Note

Users need to provide valid MongoDB Atlas credentials and ensure that their Atlas cluster is properly configured for vector search operations.