Skip to content

Redis Memory

This component acts as a long-term and short-term memory bank for your automation workflows. It connects to a Redis server to save, retrieve, and manage data. This is particularly useful for keeping track of conversation history, storing temporary variables, or enabling your AI assistant to “remember” context across different steps of a process. It also supports semantic search, allowing you to find information based on meaning rather than just exact keywords.

How it Works

Think of this component as a digital filing cabinet powered by Redis. When you send data to it, it stores that information in the Redis server using a specific “key” (like a label on a folder). Later, when you need that information, you provide the same key, and the component retrieves the stored data.

If you enable Semantic Search, the component also uses an Embedding model (like those from OpenAI or local models) to convert your text into numerical vectors. This allows the system to understand the meaning of your text and find similar records, even if they don’t use the exact same words.

Connection & Credentials

This component requires configuring a credential in the Nappai panel before interacting with the external service:

  1. Go to the Credentials section in your Nappai panel.
  2. Create a new credential of the type Redis (or similar, as specified in your system’s credential list) and fill in the required fields (Host, Port, Password).
  3. In your workflow, select the saved credential in the Redis Server Connection URL input field of this node.

Inputs

The following fields are available to configure this component. Each field may be visible in different operations:

  • Redis Server Connection URL [REQUIRED]: The URL of the connection to the Redis server, which includes the host, port, username, password, and database name. This is the address of your memory server.
  • Embedding: A model used to convert text into numerical vectors. Connect an embedding component like OpenAI, HuggingFace, or a local model here. The quality of this model determines how accurate your semantic searches will be.
  • Enable Checkpointing: A toggle switch to enable or disable checkpointing. Checkpointing usually saves the state of the workflow at this point, allowing you to resume from here later if needed.
  • Enable Store: A toggle switch to enable or disable the storage functionality. If turned off, the component may not save new data.
  • Embedding Dimension: An integer specifying the size of the embeddings. This must match the dimension output of your connected Embedding model.
  • Session ID [REQUIRED]: A unique identifier for the current user session. This helps the system distinguish between different users or sessions.
  • Conversation ID [REQUIRED]: A unique identifier for the specific conversation or thread. This helps organize memory by conversation thread.
  • Enable Semantic Search: A toggle switch that enables vector-based search. You must connect an Embedding model to use this feature.

Outputs

  • Memory: The primary output of this component. It contains the retrieved data (Any type) associated with the specified keys. This output can be passed to other components that need to read or process the stored information.

Output Data Example (JSON)json

{ “Memory”: { “session_id”: “user-12345”, “conversation_id”: “chat-001”, “content”: “User asked for help with setting up a marketing automation workflow.”, “timestamp”: “2023-10-27T10:00:00Z”, “metadata”: { “source”: “user_input” } } }

Connectivity

This component is typically connected in the following ways:

  • Input Connections: It usually receives data from Chat Components, AI Assistant Components, or Code Components that generate the text or data to be stored.
  • Output Connections: The Memory output is typically connected to other Memory components (for chaining searches), LLM/AI Components (to provide context for answers), or Code Components that need to process the stored historical data.

Usage Example

Imagine you are building a customer support chatbot.

  1. When a customer sends a message, you send the message text to this Redis Memory component along with the Session ID and Conversation ID.
  2. The component stores this message in the Redis server.
  3. Later, if the customer asks, “What was my last question?”, the component retrieves the stored memory using the Conversation ID.
  4. You can then pass this retrieved memory to an AI component, which uses the previous context to answer the current question accurately.

Important Notes

  • Development Status: This component is marked as being in development. Please use it with caution in production environments, as behavior may change.
  • Performance: Ensure your Redis server is properly configured for performance if you expect high volumes of memory operations.
  • Data Serialization: Ensure the data you are storing can be serialized by Redis (e.g., JSON, strings). Complex objects may need to be converted before storage.

Tips and Best Practices

  • Use descriptive Conversation IDs to easily group related memories together.
  • If you are using Semantic Search, ensure your Embedding Dimension matches exactly with the output dimension of your chosen Embedding model.
  • Test your Redis Server Connection URL connectivity separately if the memory component fails to save data.
  • Disable Enable Store if you only need to retrieve data but not save new information, to reduce unnecessary server load.

Security Considerations

  • Credential Security: Never expose your Redis Server Connection URL or passwords in public workflows. Use Nappai’s secure credential management.
  • Access Control: Ensure your Redis server is secured with a strong password and is not open to the public internet.
  • Data Privacy: Be mindful of the data you store in memory. Do not store sensitive personal information (like passwords or credit card numbers) unless you are certain the Redis instance is secured and encrypted.