n8n Community Node

n8n WhatsApp AI Memory: Persistent Memory for WhatsApp Bots

WhatsApp bots in n8n forget every user the moment the workflow ends. retainr adds persistent memory — your bot remembers every customer across all conversations. Install the community node in 30 seconds.

Why WhatsApp bots in n8n forget everything

n8n processes each WhatsApp message as an isolated workflow execution. When it finishes, all context is cleared. The next message — even from the same user — starts completely fresh. retainr adds the missing persistence layer: store context after each message, recall it before the next.

Add WhatsApp memory to n8n in 3 steps

1

Install the retainr community node

Settings → Community Nodes → Install → n8n-nodes-retainr. Add your retainr API key as a credential. Takes 30 seconds.

2

Search memory before each AI call

Add a retainr Search Memory node at the start of your WhatsApp workflow. Namespace: the sender's phone number. Query: the incoming message. Inject the results into your AI system prompt.

3

Store memory after each AI response

Add a retainr Store Memory node after your AI step. Namespace: same phone number. Content: the user message + AI response. The bot now remembers every user across all future conversations.

n8n WhatsApp memory — frequently asked questions

Which WhatsApp providers work with this setup?
Any provider that sends a webhook when a message arrives works: 360dialog, WATI, Twilio, MessageBird, and the Meta Cloud API directly. The retainr memory nodes are independent of the WhatsApp integration — they slot into any n8n workflow regardless of which provider you use.
How do I scope memory per user in a multi-user WhatsApp bot?
Use the sender's phone number as the namespace: wa:+14155238886. This scopes each user's memory completely separately. If you also have Telegram or email flows in the same retainr workspace, use the wa: prefix to avoid namespace collisions.
Does this work on n8n Cloud?
Yes. Community nodes are available on n8n Cloud Starter and above. On n8n Cloud Free, use two HTTP Request nodes instead — GET /v1/memories/search before the AI step and POST /v1/memories after. The retainr REST API provides identical functionality.
What happens when retainr returns no results for a new user?
The search returns an empty results array. Your AI prompt receives no prior context and responds normally. No special handling is required for first-time users — the memory layer degrades gracefully.
Can I store WhatsApp group chat memory separately from direct messages?
Yes. Use a namespace pattern that includes the chat ID: wa:group:{group_id} for group chats and wa:user:{phone} for direct messages. Group memory is shared across all group members; direct message memory is scoped per user.

Give your WhatsApp bot real memory

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

Start free