Without memory, an agent treats every message as new. With memory, it can follow a conversation.
Short-term memory
n8n offers memory options that keep recent messages so the agent sees the conversation so far. You usually keep only the last several messages to control cost and focus.
Session IDs
Memory is tied to a session ID. Use something unique per user, such as a chat ID, otherwise different people may share one conversation.
Where it is stored
Simple memory may live inside n8n and be lost on restart; other options use a database. Choose based on how long you need to remember.
Privacy
Stored conversations may contain personal data. Store the minimum, set retention rules and tell users.
Cost
More remembered text means more tokens sent to the model each time, which costs more: controlling AI costs.
Memory is not knowledge
Memory remembers the chat. To answer from your documents you need retrieval: RAG in n8n.
Quick answers
Why does my agent forget?
Without memory each message is separate, or the session ID changes.
Why use session IDs?
To keep each user’s conversation separate.
Does memory increase cost?
Yes, more remembered text is sent to the model each time.
Related reading
- What Is an AI Agent in n8n and How Is It Different from a Workflow?
- How to Build Your First AI Agent in n8n, Step by Step
- n8n AI Agent Tools: How to Give an Agent Safe Abilities
Prefer feedback on your own workflows?
In our live n8n classes you build workflows alongside a trainer who reviews your work. It is a practical 15-day program for beginners to advanced learners.
See the 15-day n8n training | Find your city | Book free counselling