Memorylake
Introduction
Memorylake is a tool that allows users to efficiently store, retrieve, and manage key-value pairs in Redis using a structured format. This guide will explain how to use Memorylake with practical examples and small code snippets to help you get started.
How Memorylake Works
Memorylake uses Redis as a key-value store. Each piece of stored information consists of:
Key: A unique identifier generated using
memory_contextvalues.Value: A structured JSON-like object that stores query-response data along with metadata.
As we are using Redis pipelines, the concept remains the same—we store keys with values.
Key Structure
The key is generated using the following structure:
user_uuid:context_entity_id:context_id:memory_idBreakdown of Key Components
user_uuid: The unique identifier of the user.context_entity_id: Represents the broader category or application where the memory is being stored. This could be a chatbot, a recommendation system, or an AI assistant. It helps in categorizing and differentiating different applications of stored memory.context_id: Represents a specific session, instance, or interaction within thecontext_entity_id. For example, in a chatbot, this could be a conversation session, while in a support ticketing system, it could be a ticket ID.memory_id: A unique identifier for the specific memory entry within a session or interaction. This allows multiple memory records to be stored under the samecontext_id, tracking multiple interactions within the same session.
├── user_uuid
│ └── context_entity_id
│ └── context_id
│ └── memory_idLast updated