Redis Vector Store icon

Redis Vector Store

Work with your data in Redis Vector Store

Overview

This node integrates with a Redis Vector Store to manage and query vectorized documents. It supports three main modes of operation:

  • Retrieve Documents (For Agent/Chain): Fetches documents from the Redis vector store for use in AI workflows, such as agents or chains that require contextual data.
  • Get Many: Retrieves multiple ranked documents based on a similarity search using a provided prompt, useful for finding relevant information quickly.
  • Insert Documents: Adds new documents into the Redis vector store, enabling the expansion of the searchable dataset.

Common scenarios include enhancing AI applications with contextually relevant documents, building semantic search features, or maintaining an up-to-date vector database within Redis.

Practical examples:

  • An AI chatbot retrieving relevant knowledge base articles dynamically.
  • A recommendation system fetching similar items based on user queries.
  • Periodically inserting new documents into the vector store to keep data fresh.

Properties

Name Meaning
Operation Mode Selects the mode of operation:
- Get Many: Retrieve many ranked documents for 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 Redis index used to store and query vectors.
Prompt (Only for "Get Many" mode) The search prompt used to retrieve matching documents by similarity ranking.
Limit (Only for "Get Many" mode) Number of top results to fetch from the vector store.

Output

The node outputs JSON data representing the retrieved or inserted documents depending on the operation mode:

  • For Get Many and Retrieve Documents, the output contains an array of documents ranked by similarity to the prompt or query.
  • For Insert Documents, the output confirms successful insertion but does not return document data.

If binary data is involved (not indicated in this code), it would represent associated files or media linked to documents, but this node focuses on JSON document data only.

Dependencies

  • Requires a Redis instance accessible via credentials configured in n8n.
  • Uses the @langchain/redis package to interact with Redis Vector Store.
  • Needs proper Redis credentials with permissions to read/write vector data.
  • The node depends on a helper function to create a Redis client connection.

Troubleshooting

  • Connection errors: Ensure Redis credentials are correct and the Redis server is reachable.
  • Index not found: Verify the specified index name exists in Redis or create it before querying.
  • Empty results: Check that the prompt is meaningful and that the vector store contains indexed documents.
  • Insertion failures: Confirm document format correctness and Redis write permissions.
  • Common error messages will relate to Redis connectivity or invalid parameters; resolving them typically involves verifying credentials, network access, and input data validity.

Links and References

Discussion