OpenSearch Vector Store icon

OpenSearch Vector Store

Work with your data in OpenSearch for vector-based search

Overview

This node integrates with OpenSearch to enable vector-based search operations on document data. It supports three main modes:

  • Retrieve Documents (For Agent/Chain): Retrieves documents from an OpenSearch vector store for use in AI workflows, such as agents or chains that require relevant contextual information.
  • Get Many: Performs similarity-based ranking to fetch multiple top-ranked documents matching a search prompt.
  • Insert Documents: Inserts new documents into the OpenSearch vector store, enabling them to be searched later by their vector embeddings.

Typical use cases include enhancing AI applications with semantic search capabilities, building knowledge retrieval systems, or managing vectorized document stores for machine learning pipelines.

Properties

Name Meaning
Operation Mode Selects the mode of operation:
- Get Many: Retrieve many ranked documents based on a query.
- Insert Documents: Add documents to the vector store.
- Retrieve Documents (For Agent/Chain): Fetch documents for AI nodes.
Index Name The name of the OpenSearch index where vectors and documents are stored or retrieved from.

Insert Documents Mode Options

Name Meaning
Field Names Names of fields in the OpenSearch index:
- Vector Field Name (default: "embedding")
- Content Field Name (default: "text")
- Metadata Field Name (default: "metadata")

Get Many Mode Options

Name Meaning
Prompt Search prompt string used to retrieve matching documents via similarity ranking.
Limit Number of top results to return from the vector store (default: 4).
Field Names Same as Insert mode: names of vector, content, and metadata fields in the index.
Metadata Filter Optional filters on document metadata fields to narrow down search results.

Retrieve Documents Mode Options

Name Meaning
Field Names Same as above: vector, content, and metadata field names.
Metadata Filter Optional metadata filters to restrict which documents are retrieved.

Output

The node outputs JSON data representing the documents retrieved or inserted in the OpenSearch vector store. The structure includes:

  • Document content text.
  • Associated metadata fields.
  • Vector embeddings (implicitly managed but not directly output).

If operating in retrieval modes, the output contains the most relevant documents matching the query or filter criteria.

Binary data is not explicitly handled or output by this node.

Dependencies

  • Requires an OpenSearch instance accessible via URL with authentication credentials (username and password).
  • Needs an API key credential configured in n8n for OpenSearch access.
  • Uses the official OpenSearch JavaScript client library.
  • Relies on the Langchain community OpenSearch vector store implementation for vector operations.
  • Supports ignoring SSL issues via configuration if needed.

Troubleshooting

  • Connection errors: Ensure the OpenSearch URL and credentials are correct and reachable from the n8n environment.
  • SSL certificate issues: If using self-signed certificates, enable the option to ignore SSL issues.
  • Index not found: Verify the specified index name exists in OpenSearch or create it before inserting/retrieving.
  • Empty results: Check the prompt, metadata filters, and field names for correctness; mismatches can lead to no documents returned.
  • Authentication failures: Confirm username and password are valid and have sufficient permissions.

Links and References

Discussion