OpenSearch Vector Store

Node Details

  • Name: OpenSearch_VectorStores
  • Type: OpenSearch
  • Version: 3.0
  • Category: Vector Stores

Base Classes

  • OpenSearch
  • VectorStoreRetriever
  • BaseRetriever

Credentials

  • Label: Connect Credential
  • Name: credential
  • Type: credential
  • Credential Names: openSearchUrl

Input Parameters

  1. Document
    • Type: Document
    • List: true
    • Optional: true
  2. Embeddings
    • Type: Embeddings
  3. Index Name
    • Type: string
  4. Top K
    • Type: number
    • Description: Number of top results to fetch
    • Default: 4
    • Optional: true

Outputs

  1. OpenSearch Retriever
    • Name: retriever
    • Base Classes: [OpenSearch, VectorStoreRetriever, BaseRetriever]
  2. OpenSearch Vector Store
    • Name: vectorStore
    • Base Classes: [OpenSearch, …BaseClasses(OpenSearchVectorStore)]

Functionality

  1. Upsert Method
    • Adds or updates documents in the OpenSearch index
    • Utilizes the provided embeddings to vectorize documents
    • Returns the number of added documents and the added documents themselves
  2. Init Method
    • Initializes the OpenSearch vector store or retriever based on the specified output
    • Configures the client connection using provided credentials
    • Sets up the vector store with the given embeddings and index name

Usage

This node is used for:
  1. Storing and indexing document embeddings in OpenSearch
  2. Retrieving similar documents based on vector similarity
  3. Integrating OpenSearch as a vector store in a larger language model or information retrieval system

OpenSearch Client Configuration

The node includes a utility function getOpenSearchClient that creates an OpenSearch client instance. It handles authentication if a username and password are provided.

Note

This node is part of a larger system and is designed to be used in conjunction with other nodes for building complex AI and information retrieval workflows.