n8n Agent Memory: An Editorial Exercise in Isolation and Recall
Practise n8n agent memory with Postgres-backed sessions: check recall across separate executions and identify the documentation needed before session-specific deletion.

Checked against the cited sources on .
Your n8n agent memory exercise
This editorial exercise asks you to check n8n agent memory across separate executions using two fictional users and Postgres Chat Memory. The target is recall within the matching session without revealing the other session’s invented fact. The exercise has not been executed or validated.
Start with an already working n8n chat workflow containing an AI Agent and a configured chat model, plus usable Postgres credentials. n8n documents Postgres Chat Memory as database-backed chat-history storage and points to separate authentication guidance. Initial credential setup, building the agent and production deployment are outside this exercise.
n8n’s 2026 Production AI Playbook recommends user-based session IDs for recalling interactions across executions. We think session separation is worth practising before adding more elaborate agent behaviour.
Sources: n8n-docs/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorypostgreschat.md at main · n8n-io/n8n-docs · GitHub, Production AI Playbook: Complex Agent Patterns – n8n Blog
Configure the n8n agent memory node and inputs

For n8n AI agent memory with PostgreSQL, use Postgres Chat Memory. n8n documents a configurable session key, a history table created if absent and a context window measured in previous interactions. Add or inspect that memory connection, choose a dedicated disposable test table and record your settings.
Use the following editorial inputs and constraints. Process one input item per execution because n8n documents that expressions in memory sub-nodes resolve against the first input item. Keep the table, model and context-window setting unchanged throughout.
| Item | Suggested value | Purpose |
|---|---|---|
| Alice session key | exercise-alice | Identify Alice’s conversation |
| Bob session key | exercise-bob | Identify Bob’s conversation |
| Alice’s invented fact | My project mascot is a copper fox. | Seed Alice’s recall |
| Bob’s invented fact | My project mascot is a violet crane. | Seed Bob’s recall |
| Test table | Dedicated disposable table | Keep exercise data separate |
| Context window | Record your chosen setting | Keep the comparison consistent |
Sources: Postgres Chat Memory | Nodes | n8n Docs
Alternate sessions across separate executions

Use this suggested sequence to examine n8n agent memory. These prompts and completion criteria are editorial suggestions. Record each resolved session key, execution identifier, prompt and observed response; do not replace an unexpected answer with the answer you hoped to see.
- Run Alice’s invented fact with exercise-alice.
- In a separate execution, run Bob’s invented fact with exercise-bob.
- Return to exercise-alice and ask: What is my project mascot?
- Return to exercise-bob in another execution and ask the same question.
- Ask Alice’s session: What is Bob’s project mascot? Then ask Bob’s session about Alice’s mascot, without supplying either answer.
- Record matching recall, missing context and any disclosure of the other session’s fact.
n8n warns that multiple Postgres Chat Memory nodes share a memory instance by default and instructs users to assign different session IDs for separate instances. Distinct keys are a configuration mechanism, not authenticated user authorization or a guarantee against disclosure.
Sources: n8n-docs/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorypostgreschat.md at main · n8n-io/n8n-docs · GitHub, Production AI Playbook: Complex Agent Patterns – n8n Blog
Investigate recall and visible history separately

If n8n agent memory responses surprise you, use these suggested diagnostic checks before changing several settings at once. In our view, inspecting the resolved session key is a better first move than rewriting the prompt.
| Observation | Inspect first | Record |
|---|---|---|
| Other session’s fact appears | Resolved keys and accidental reuse | Actual key in each execution |
| Own fact is missing | Key consistency and context window | Settings and intervening interactions |
| Multi-item input was used | First-item expression resolution | Repeat with one input item |
Visible chat history needs a separate check. In the unpinned Chat Trigger master-branch snapshot cited here, whose default node version is 1.5, restoring the chat widget’s history is distinct from supplying the Agent with memory. Its builder hint also requires a memory connection to the trigger when restoring history from memory; this snapshot does not establish behaviour for every released version.
Sources: Postgres Chat Memory | Nodes | n8n Docs, n8n-docs/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorypostgreschat.md at main · n8n-io/n8n-docs · GitHub, n8n/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts at master · n8n-io/n8n · GitHub
Document deletion readiness and finish the exercise

Make deletion a documentation-readiness task only. n8n documents Chat Memory Manager operations for retrieving, inserting and deleting messages, including the last N or all messages. The Chat Memory Manager documentation cited here does not establish a complete session-specific Postgres deletion procedure, authorization boundary or verification method. Separately, the general Postgres node documentation warns that Delete without a row-selection condition removes all rows; it is not a memory-schema recipe.
Before attempting deletion, obtain the version-matched documentation listed below. We would keep deletion blocked until session selection and verification are explicit.
Complete the exercise by retaining the records for both users, marking each target behaviour as observed or failed, and recording unresolved questions. Reflect on what you observed versus what remains unproven: this small exercise establishes no production security, restart-survival, retention-duration, backup-erasure or durable-storage guarantees.
Sources: Chat Memory Manager | Nodes | n8n Docs, n8n-docs/docs/integrations/builtin/app-nodes/n8n-nodes-base.postgres/README.md at main · n8n-io/n8n-docs · GitHub


