ZepMemory
The ZepMemory node is an implementation of long-term memory storage using the Zep open-source memory server. It summarizes conversations and stores the memory in a Zep server, allowing for persistent and retrievable chat history across sessions.
Node Details
- Name: ZepMemory
- Type: ZepMemory
- Version: 2.0
- Category: Memory
Base Classes
- ZepMemory
- (Additional base classes from ZepMemory)
Parameters
Credential
Credential
- Type: credential
- Credential Names: zepMemoryApi
- Credential Names: zepMemoryApi
- Description: Configure JWT authentication on your Zep instance (Optional)
Inputs
-
Base URL
- Type: string
- Default: “http://127.0.0.1:8000”
- Description: The base URL of your Zep server instance
- Description: The base URL of your Zep server instance
-
Session Id (optional)
-
Session Id (optional)
- Type: string
- Description: If not specified, a random id will be used
- Description: If not specified, a random id will be used
-
Size
- Type: number
- Default: 10
- Description: Window of size k to surface the last k back-and-forth to use as memory
- Description: Window of size k to surface the last k back-and-forth to use as memory
-
AI Prefix
- Type: string
- Default: “ai”
- Description: Prefix used for AI messages in the conversation
- Description: Prefix used for AI messages in the conversation
-
Human Prefix
- Type: string
- Default: “human”
- Description: Prefix used for human messages in the conversation
- Description: Prefix used for human messages in the conversation
-
Memory Key
- Type: string
- Default: “chat_history”
- Description: Key used to store and retrieve the chat history
- Description: Key used to store and retrieve the chat history
-
Input Key
- Type: string
- Default: “input”
- Description: Key used for input messages
- Description: Key used for input messages
-
Output Key
- Type: string
- Default: “text”
- Description: Key used for output messages
- Description: Key used for output messages
Functionality
The ZepMemory node extends the base ZepMemory class from LangChain and implements additional methods for managing chat history:
- loadMemoryVariables: Retrieves memory variables, with an option to override the session ID.
- saveContext: Saves the current context to memory, with an option to override the session ID.
- clear: Clears the memory for a given session ID.
- getChatMessages: Retrieves chat messages, with options to override session ID, return base messages, and prepend additional messages.
- addChatMessages: Adds new messages to the chat history.
- clearChatMessages: Clears chat messages for a given session ID.
Usage
This node is particularly useful in chatbot or conversational AI applications where maintaining context over long periods or across multiple sessions is important. It allows the AI to reference past interactions, providing more coherent and context-aware responses.
Integration
The ZepMemory node can be integrated into a larger workflow where persistent memory is required. It works in conjunction with other nodes to provide a comprehensive solution for managing conversational state and history.
Note
Ensure that a Zep server is properly set up and accessible at the specified Base URL for this node to function correctly.