Skip to content

Redis

Redis is a fast, in‑memory database that can also act as a vector store.
In Nappai, this component lets you keep your documents in Redis, embed them with a language model, and then search or retrieve them later.

How it Works

When you use the Redis component, it first takes the documents you give it (or the data that comes from another component).
If you’re adding new data, the component splits each document into smaller chunks (about 1,000 characters each) so the embeddings are more precise.
It then asks the embedding model to turn each chunk into a numeric vector.
Those vectors, together with the original text, are stored in a Redis index that you name.
Later, when you want to find related documents, the component sends your query to the same index, looks for the most similar vectors, and returns the matching text.

The component talks to Redis through a connection string that you store in a Redis API credential.
The credential is selected in the component’s “Credential” field (not shown in the input list).

Operations

This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:

  • Add: Ingest new documents into the Redis vector store.
  • Search: Look up documents that are most similar to a search query.
  • Retriever: Build a retriever object that can be used later in the workflow to fetch documents on demand.

To use the component, first select the operation you need in the “Operation” field.

Inputs

  • Embedding: The embedding model that turns text into vectors.

    • Visible in: Add, Search, Retriever
  • Ingest Data: The documents you want to add to the vector store.

    • Visible in: Add
  • Operation: Choose which operation to run (Add, Search, or Retriever).

    • Visible in: Add, Search, Retriever
  • Number of Results: How many documents to return when searching.

    • Visible in: Add, Search, Retriever
  • Redis Index: The name of the Redis index where data will be stored or searched.

    • Visible in: Add, Search, Retriever
  • Schema: Optional schema definition for the Redis index.

    • Visible in: Add, Search, Retriever
  • Search Query: The text you want to search for. Leave empty to retrieve all documents.

    • Visible in: Search

Note: This component requires a Redis API credential.

  1. Configure the Redis API credential in Nappai’s credentials section, providing the Redis Server Connection String.
  2. Select that credential in the component’s “Credential” field.

Outputs

  • Retriever: A retriever object that can be used later to fetch documents.
  • Results: The list of documents that match a search query.
  • Vector Store: The underlying Redis vector store object.

Usage Example

Adding Documents

  1. Drag the Redis component onto the canvas.
  2. Set Operation to Add.
  3. Connect an Embedding component to the Embedding input.
  4. Provide a list of documents in Ingest Data (or connect another component that outputs data).
  5. Enter a unique Redis Index name.
  6. Click Run – the documents are now stored in Redis.

Searching Documents

  1. Add another Redis component.
  2. Set Operation to Search.
  3. Connect the same Embedding component.
  4. Enter the same Redis Index name used when adding.
  5. Type a Search Query (e.g., “customer churn analysis”).
  6. Click Run – the component returns the top matching documents in the Results output.
  • Embedding – Generates the vectors that Redis stores.
  • Vector Store – Generic interface for vector storage; Redis is one implementation.

Tips and Best Practices

  • Keep the Redis Index name unique to avoid accidental data overwrite.
  • Use a consistent embedding model across Add and Search operations for reliable results.
  • If you have many large documents, consider increasing the chunk size or using a different text splitter.
  • Store the Redis connection string securely in a credential; never hard‑code it in your workflow.

Security Considerations

  • The Redis Server Connection String is stored in a credential; ensure it is protected and only shared with trusted users.
  • Use Redis authentication and TLS if your Redis instance is exposed over the network.
  • Regularly rotate credentials and monitor access logs for unusual activity.