
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
-
Document
- Type: Document
- List: true
- Optional: true
-
Embeddings
- Type: Embeddings
-
Index Name
- Type: string
-
Top K
- Type: number
- Description: Number of top results to fetch
- Default: 4
- Optional: true
Outputs
-
OpenSearch Retriever
- Name: retriever
- Base Classes: [OpenSearch, VectorStoreRetriever, BaseRetriever]
-
OpenSearch Vector Store
- Name: vectorStore
- Base Classes: [OpenSearch, …BaseClasses(OpenSearchVectorStore)]
Functionality
-
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
-
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:- Storing and indexing document embeddings in OpenSearch
- Retrieving similar documents based on vector similarity
- Integrating OpenSearch as a vector store in a larger language model or information retrieval system
OpenSearch Client Configuration
The node includes a utility functiongetOpenSearchClient
that creates an OpenSearch client instance. It handles authentication if a username and password are provided.