Skip to content

Chat Memory Manager#

The Chat Memory Manager node manages chat message memories within your workflows. Use this node to load, insert, and delete chat messages in an in-memory vector store.

On this page, you'll find a list of operations that the Chat Memory Manager node supports, along with links to more resources.

Examples and templates

For usage examples and templates to help you get started, refer to n8n's Chat Memory Manager integrations page.

Parameter resolution in sub-nodes

Sub-nodes behave differently to other nodes when processing multiple items using an expression.

Most nodes, including root nodes, take any number of items as input, process these items, and output the results. You can use expressions to refer to input items, and the node resolves the expression for each item in turn. For example, given an input of five name values, the expression {{ $json.name }} resolves to each name in turn.

In sub-nodes, the expression always resolves to the first item. For example, given an input of five name values, the expression {{ $json.name }} always resolves to the first name.

Node parameters#

  • Operation Mode: choose between Get Many Messages, Insert Messages, and Delete Messages operations.
  • Insert Mode: available in Insert Messages mode. Choose between Insert Messages to add alongside existing messages or Override All Messages to replace current memory.
  • Delete Mode: available in Delete Messages mode. Select either Last N to delete the last N messages or All Messages to clear all messages from memory.
  • Chat Messages: available in Insert Messages mode. Define the chat messages to insert into the memory, including message type (AI, System, User), message content, and visibility in UI.
  • Messages Count: available in Delete Messages mode and when Last N is selected. Specify the number of latest messages to delete.
  • Simplify Output: available in Get Many Messages mode. Toggle to simplify the output to include only the sender (AI, user, or system) and the text.

View example workflows and related content on n8n's website.

Refer to LangChain's Memory documentation for more information about the service.

View n8n's Advanced AI documentation.