n8n AI agent memory per user that survives restarts
Описание и применение
В n8n AI Agent память Simple Memory теряется после обновления страницы из‑за смены sessionId. Заменив Simple Memory на MemorySync Chat Memory, данные привязываются к стабильному End User ID и сохраняются между сессиями и перезапусками, устраняя ошибку "No session ID found".
Задача
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.
Результат
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.
Рабочий процесс
- 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.
Доказательства
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).
- Дата записи: 2026-10-28T00:14:00.213Z