# What is agent memory?

> Agent memory lets an AI agent follow a conversation, like knowing what "those" means. How n8n's Simple Memory and session IDs work, and a common fix.

Source: https://learn.ynteractive.com/content/glossary/agent-memory · Updated 2026-10-01 · Free from Stepthrough (https://learn.ynteractive.com)

[AI agents](https://learn.ynteractive.com/content/glossary#topic-ai-agents) · [AI glossary](https://learn.ynteractive.com/content/glossary)

Updated October 1, 2026 · By [Robert Breen](https://learn.ynteractive.com/content/about)

Agent memory is how an AI agent keeps track of earlier messages so it can follow a conversation, for example knowing what "save those" refers to. In n8n it is a sub-node on the AI Agent, such as Simple Memory, that stores recent messages per conversation, identified by a session ID.

## Why it matters for a small business

Without memory, every message to an agent starts from zero. That's fine for one-shot jobs but breaks anything conversational: follow-up questions, corrections ("call that one office supplies"), or a customer who replies to an earlier answer.

Memory also has to be kept separate per conversation. If two customers' threads shared one memory, the agent could mix up their details. The session ID is how a memory node tells conversations apart, and picking the right one is a design decision, not a default to ignore.

## In a real lesson: AI Email Responder: Draft Gmail Replies Automatically with n8n

In the [AI email responder lesson](https://learn.ynteractive.com/content/ai-email-responder-gmail-drafts-n8n) for Greenline Pest Control, a made-up pest control company, you add **Simple Memory** under the agent so that if Dana writes back, it remembers what it already told her. You leave the defaults and click **Execute workflow**.

It fails with **No session ID found**. The memory node is looking for a chat session ID, and an email from a Gmail trigger doesn't have one. You open **Session ID**, choose **Define below** and paste `{{ $json.threadId }}`. Every Gmail conversation has its own thread ID, so memory now keeps one conversation per customer.

The voice-over points out that this beats the common quick fix of deleting the memory node. In chat-based builds like the receipt extractor, the default works because n8n's chat supplies a session automatically, and Simple Memory keeps the last 5 messages of each chat.

[Try this lesson free](https://learn.ynteractive.com/modules/email-responder) or [read the step-by-step guide](https://learn.ynteractive.com/content/ai-email-responder-gmail-drafts-n8n).

## Common confusions

### Agent memory vs ChatGPT memory

[ChatGPT memory](https://learn.ynteractive.com/content/glossary/chatgpt-memory) saves facts about you across all your chats. Agent memory in n8n holds the recent messages of one conversation, keyed by a [session ID](https://learn.ynteractive.com/content/glossary/session-id).

### Agent memory vs a knowledge base

Memory is what was said in this conversation. A [knowledge base](https://learn.ynteractive.com/content/glossary/knowledge-base) is reference information the agent can look up, like prices and policies.

## Tips

- With a chat trigger, the default session usually works. With email, forms or webhooks, set the session ID to something that identifies the conversation, like a thread ID or an email address.
- Simple Memory lives inside n8n and keeps a short window; for conversations that must survive long gaps or restarts, look at a database-backed memory option.
- Keep the window short. Long histories cost more and can distract the agent.

## Related terms

[Session ID](https://learn.ynteractive.com/content/glossary/session-id) · [AI Agent node](https://learn.ynteractive.com/content/glossary/ai-agent-node) · [ChatGPT memory](https://learn.ynteractive.com/content/glossary/chatgpt-memory) · [Context window](https://learn.ynteractive.com/content/glossary/context-window) · [Chat Trigger](https://learn.ynteractive.com/content/glossary/chat-trigger)

## Where you use it: free lessons

- [AI Email Responder: Draft Gmail Replies Automatically with n8n](https://learn.ynteractive.com/content/ai-email-responder-gmail-drafts-n8n) (n8n, 12 min)
- [AI Receipt Extractor: Receipts to Google Sheets with n8n](https://learn.ynteractive.com/content/ai-receipt-extractor-n8n-google-sheets) (n8n, 12 min)
- [n8n AI Agent Tutorial: Save Social Media Ideas to Google Sheets](https://learn.ynteractive.com/content/n8n-ai-agent-tutorial-google-sheets) (n8n, 12 min)

## Visual guide

Agent memory in a few slides, with the same guide written out as text.

- [5 Steps to an n8n AI Agent That Saves to Google Sheets](https://learn.ynteractive.com/content/visual/5-steps-n8n-ai-agent-google-sheets): A visual guide: build an n8n AI agent that writes social media ideas and saves each one as a Google Sheets row, in 5 steps from the free lesson.

[All visual guides](https://learn.ynteractive.com/content/visual)

## Frequently asked questions

**What does "No session ID found" mean in n8n?**

The memory node can't find an ID for the conversation, usually because the trigger isn't a chat. Set Session ID to Define below and use a field that identifies the conversation, such as the Gmail thread ID.

**Does every agent need memory?**

No. A one-shot job, like handling a single form submission, works without it. Add memory when people will reply or refer back to earlier messages.

[All AI glossary terms, A to Z](https://learn.ynteractive.com/content/glossary) · [Free prompt templates](https://learn.ynteractive.com/content/prompts)
