n8n AI agent memory per user that survives restarts
Description and use
In n8n AI Agent, Simple Memory loses history after a page refresh because it keys data by session ID. Replacing it with MemorySync Chat Memory ties facts to a stable End User ID, preserving memory across sessions and restarts and eliminating the "No session ID found" error.
Problem
An n8n AI Agent loses conversation history after a page refresh or when a new session ID is generated, and users encounter errors like "No session ID found" when using Simple Memory.
Outcome
Switching to MemorySync Chat Memory allows an n8n AI Agent to retain user facts across page refreshes, new sessions, and worker restarts, eliminating the "No session ID found" error when the trigger outputs a sessionId.
Workflow
- 1. Verify the Chat Trigger outputs a sessionId; if not, manage sessions manually.
- 2. Install the MemorySync n8n nodes (requires n8n 2.16.0+).
- 3. Create a MemorySync API key with Write permission enabled.
- 4. Replace the Simple Memory node on the AI Agent’s Memory port with the MemorySync Chat Memory node.
- 5. Configure the MemorySync node to use the End User ID (e.g., {{ $json.userId }}) and the sessionId (e.g., {{ $json.sessionId }}).
- 6. Test the workflow by sending messages and refreshing the page to confirm memory persists.
Evidence
Simple Memory keys history by session ID, so a new session ID means an empty window.
MemorySync Chat Memory replaces Simple Memory on the agent's Memory port.
MemorySync Chat Memory needs a Session ID too (the guide uses {{ $json.sessionId }} for the Chat Trigger).
n8n Cloud only lists nodes n8n has verified (MemorySync's verification is in progress).
- Record date: 2026-10-28T00:14:00.213Z