n8n Community Node

n8n AI Agent Memory: Give Your n8n Workflows Persistent Memory

retainr is a persistent memory API for n8n. Install the n8n-nodes-retainr community node, connect it to your AI Agent workflow, and your agent remembers every user across sessions — no database setup, no code required. Works on n8n Cloud and self-hosted.

Why n8n AI agents forget everything

n8n runs each workflow execution in isolation. When it finishes, all context is gone. The next run starts completely fresh — your AI has no memory of the same user's previous conversations. n8n's built-in Simple Memory only lasts for the current session. retainr persists across sessions, restarts, and deployments.

n8n Simple Memory

Session only. Cleared on restart. Single user. No search.

Self-hosted Postgres

Requires DB setup, schema design, and custom queries. Weeks of work.

retainr

30-second node install. Persistent, multi-user, semantic search. Free plan.

How to add memory to n8n in 3 steps

1

Install the node

Go to n8n Settings → Community Nodes → Install. Enter "n8n-nodes-retainr". Done in 30 seconds.

2

Store memory

After each AI interaction, use the Store Memory node to save context keyed by user ID, session ID, or any unique identifier.

3

Search & recall

Before each AI call, use the Search Memory node to inject the most relevant past context into your prompt automatically.

n8n node configuration

After installing the community node, configure it with your API key and a namespace to scope memories. Use any string that identifies who or what the memory belongs to — user ID, customer slug, or conversation ID.

// Store Memory node settings
{
  "apiKey": "{{ $env.RETAINR_API_KEY }}",
  "namespace": "user:{{ $json.userId }}",
  "content": "{{ $json.message }}",
  "metadata": {
    "role": "user",
    "timestamp": "{{ $now }}"
  }
}

// Search Memory node settings
{
  "apiKey": "{{ $env.RETAINR_API_KEY }}",
  "namespace": "user:{{ $json.userId }}",
  "query": "{{ $json.currentMessage }}",
  "limit": 5
}

n8n AI memory — frequently asked questions

Does n8n have a built-in persistent memory node?
n8n includes Simple Memory, which stores conversation history within a single session. It clears when the workflow restarts or a new session starts. For cross-session, multi-user memory that persists permanently, you need retainr — install it as a community node in 30 seconds.
How do I make my n8n AI agent remember previous conversations?
Install the n8n-nodes-retainr community node from n8n Settings → Community Nodes. Add your retainr API key, connect the Store Memory and Search Memory nodes to your AI Agent workflow. Your agent will now remember every user across sessions automatically.
What is the best memory node for n8n in 2026?
For production workflows with multiple users, retainr is the best option: it provides semantic search (finds relevant context even when wording differs), cross-session persistence, multi-workspace isolation, and TTL auto-expiry. Simple Memory is fine for single-session demos only.
Does retainr work with n8n self-hosted?
Yes. retainr works identically on n8n Cloud and any self-hosted n8n instance. Install n8n-nodes-retainr from Community Nodes, add your API key, and it works — no additional infrastructure on your server required.
How is retainr different from n8n Simple Memory?
n8n Simple Memory: in-memory only, cleared on restart, single session, no search. retainr: persistent across sessions and restarts, multi-user (keyed by any unique ID), semantic similarity search, TTL auto-expiry, REST API accessible from any platform.
Can I use retainr with n8n LangChain AI agents?
Yes. The retainr n8n node works alongside n8n's LangChain AI Agent node. Use the Search Memory node as a tool input to your AI Agent to inject relevant context before the LLM call, and Store Memory after to save the response.

Give your n8n agents real memory

1,000 memory operations per month. Free forever. No credit card required.

Start free