
Node Details
- Name: Redis_VectorStores
- Type: Redis
- Version: 1.0
- Category: Vector Stores
Base Classes
- Redis
- VectorStoreRetriever
- BaseRetriever
Parameters
Credential (Required)
- Label: Connect Credential
- Name: credential
- Type: credential
- Credential Names: redisCacheUrlApi, redisCacheApi
Inputs
-
Document (Optional)
- Type: Document
- List: true
- Description: The documents to be inserted into the vector store.
-
Embeddings (Required)
- Type: Embeddings
- Description: The embedding model to use for converting documents into vectors.
-
Index Name (Required)
- Type: string
-
Placeholder:
VECTOR_INDEX_NAME
- Description: The name of the Redis index to use.
-
Replace Index on Upsert (Optional)
- Type: boolean
- Default: false
- Description: If true, deletes the existing index and recreates a new one when upserting.
-
Content Field (Optional)
- Type: string
- Default: “content”
- Description: Name of the field that contains the actual content.
-
Metadata Field (Optional)
- Type: string
- Default: “metadata”
- Description: Name of the field that contains the metadata of the document.
-
Vector Field (Optional)
- Type: string
- Default: “content_vector”
- Description: Name of the field that contains the vector.
-
Top K (Optional)
- Type: number
- Default: 4
- Description: Number of top results to fetch.
Outputs
-
Redis Retriever
- Name: retriever
- Base Classes: [Redis, VectorStoreRetriever, BaseRetriever]
-
Redis Vector Store
- Name: vectorStore
- Base Classes: [Redis, RedisVectorStore base classes]
Functionality
The node provides two main functionalities:- Upsert: Allows inserting or updating documents in the Redis vector store.
- Similarity Search: Enables performing similarity searches on the stored vectors.
Usage
This node is typically used in workflows where fast similarity search is required on a large number of embedded documents. It’s particularly useful in applications such as:- Semantic search engines
- Recommendation systems
- Document retrieval systems
- Any application requiring quick similarity comparisons between vectors
Implementation Details
-
The node uses the
redis
npm package for Redis client operations. - It implements a singleton pattern for the Redis client to optimize connections.
- The node handles both direct Redis URL connections and credential-based connections.
- It includes methods for upserting documents and performing similarity searches.
- The implementation includes error handling and index existence checks.