The n8n Postgres Chat Memory node stores the last N messages in a database you manage. retainr stores any content and retrieves the most semantically relevant memories — no database required. Install as a community node in 30 seconds.
| Feature | retainr | Postgres Chat Memory |
|---|---|---|
| Setup time | 30 seconds | 30-60 minutes |
| Database required | No | Yes (Postgres instance) |
| Semantic search | ✓ pgvector HNSW | ✗ None (last N messages) |
| Cross-execution memory | ✓ Always | ✓ Within session scope |
| Multi-user namespacing | ✓ Built-in | Manual (session_id field) |
| TTL / auto-expiry | ✓ Per-memory TTL | ✗ Manual cleanup required |
| Works outside n8n | ✓ REST API | ✗ n8n-only |
| Managed cloud | ✓ Fully managed | Self-managed |
| Free plan | ✓ 1,000 ops/mo | Free (self-hosted) |
| Storage cost | Included | Your DB bill |
The node returns the last N messages in the conversation window. If the user mentioned a critical detail in message 20 but the window is set to 10, that detail is gone. Recent messages are always returned — relevant messages are not guaranteed.
retainr uses semantic search across all stored memories. A memory from 3 months ago is retrieved if it is the most relevant to the current query — regardless of when it was stored. The AI always gets the most useful context, not just the most recent.
Already using Postgres Chat Memory and want semantic search without the database overhead? Migration takes under 10 minutes.
Settings → Community Nodes → Install → n8n-nodes-retainr. Add your retainr API key as a credential.
Remove the Postgres Chat Memory node from your AI Agent. Add a retainr Search Memory node before the AI step and a retainr Store Memory node after.
Map the retainr search results into your AI system prompt: {{ $node["retainr_search"].json.results.map(r => r.content).join("\n") }}
Export rows from your Postgres chat_history table and POST each row's content to retainr with the matching namespace. Old history becomes semantically searchable.
n8n Workflow Memory Between Executions
The complete fix for n8n workflows that lose context between runs.
n8n AI Agent Memory: Complete Tutorial (2026)
Step-by-step guide to adding persistent memory to n8n AI agents.
AI Agent Workflow Automation Guide (2026)
Complete guide to building stateful AI automation on n8n, Make.com & Zapier.
1,000 memory operations per month. Free forever. No credit card required.
Start free