
Node Details
- Name: upstashRedisBackedChatMemory
- Type: UpstashRedisBackedChatMemory
- Version: 2.0
- Category: Memory
Base Classes
- UpstashRedisBackedChatMemory
- BufferMemory (and its base classes)
Parameters
Credential
- Type: credential
- Credential Names: upstashRedisMemoryApi
- Credential Names: upstashRedisMemoryApi
- Description: Configure password authentication for your Upstash Redis instance
Inputs
-
Upstash Redis REST URL
- Type: string
- Description: The base URL for your Upstash Redis instance
- Description: The base URL for your Upstash Redis instance
- Placeholder:
https://<your-url>.upstash.io
- Session Id (optional)
-
Session Id (optional)
- Type: string
- Description: Unique identifier for the chat session. If not specified, a random id will be used
- Description: Unique identifier for the chat session. If not specified, a random id will be used
- Session Timeouts (optional)
-
Session Timeouts (optional)
- Type: number
- Description: Time-to-live for the session in seconds. Omit this parameter to make sessions never expire
- Description: Time-to-live for the session in seconds. Omit this parameter to make sessions never expire
-
Memory Key
- Type: string
- Default: ‘chat_history’
- Description: Key used to store and retrieve the chat history in Redis
- Description: Key used to store and retrieve the chat history in Redis
Functionality
-
Initialization:
- Creates a Redis client using the provided URL and authentication token.
- Sets up an UpstashRedisChatMessageHistory instance.
- Initializes a BufferMemoryExtended instance with the chat history.
-
Memory Operations:
getChatMessages
: Retrieves stored chat messages from Redis.addChatMessages
: Adds new messages to the Redis storage.clearChatMessages
: Clears all messages for a given session.