Zep Memory (v3) icon

Zep Memory (v3)

Use Zep v3 Threads as chat memory

Overview

This node integrates with the Zep v3 Threads API to manage chat memory by storing and retrieving conversation history in threads. It is useful for scenarios where you want to maintain context across multiple interactions in a chatbot or conversational AI system, enabling the bot to remember past messages and provide more coherent responses.

Typical use cases include:

  • Chatbots that need persistent memory of user conversations.
  • AI assistants that recall previous interactions within a session.
  • Applications requiring thread-based message storage and retrieval for multi-turn dialogues.

The node fetches stored messages from a specified thread and can save new user and assistant messages back to that thread, effectively maintaining an ongoing chat history.

Properties

Name Meaning
Thread ID Choose how to specify the thread ID: either from a connected Chat Trigger node's sessionId field or define it manually below.
Thread Key From Previous Node When "Thread ID" is set to get from input, this specifies the input field name (default is sessionId) to extract the thread ID from previous node data.
Thread ID (custom) When "Thread ID" is set to define manually, enter the thread ID string here to identify the chat memory thread.

Output

The node outputs a JSON object containing a key "chat_history" which holds an array of message objects representing the conversation history in the thread. Each message object has the following structure:

  • type: Indicates the message sender type, either "human" for user messages or "ai" for assistant messages.
  • content: The text content of the message.
  • name (optional): The name associated with the message if available.

Example output JSON snippet:

{
  "chat_history": [
    {
      "type": "human",
      "content": "Hello, how are you?"
    },
    {
      "type": "ai",
      "content": "I'm good, thank you! How can I assist you today?"
    }
  ]
}

The node does not output binary data.

Dependencies

  • Requires an external Zep v3 API service accessible via HTTP.
  • Needs an API key credential for authentication with the Zep API.
  • The base URL and API key must be configured in the node credentials.
  • The node uses HTTP requests to interact with the Zep API endpoints for fetching, saving, and clearing thread messages.

Troubleshooting

  • Missing or invalid API key: If the API key is missing or incorrect, the node will fail to authenticate with the Zep API. Ensure the API key credential is correctly set up.
  • Invalid thread ID: Providing an incorrect or non-existent thread ID will result in empty or failed memory retrieval. Verify the thread ID source or manual entry.
  • Network or API errors: Network issues or API downtime may cause request failures. Check connectivity and Zep service status.
  • Empty input/output when saving context: If neither input nor output messages are present when attempting to save, the node logs a warning and skips saving.
  • Unexpected response format: If the API returns data not matching expected structure (missing messages array), the node returns an empty chat history and logs a warning.

Links and References

Discussion