n8n Persistent AI Agent Memory: Claude + Postgres + Redis
n8n Persistent AI Agent Memory: Claude + Postgres + Redis
Regular price
£71.99
Regular price
£71.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n Persistent AI Agent Memory: Claude + Postgres + Redis
Regular price
£71.99
Regular price
£71.99
Sale price
Unit price
/
per
Turn Claude chats into persistent, searchable memory—powered by n8n, Redis, and Postgres (pgvector)
This n8n workflow gives your AI agent persistent memory across conversations by combining Redis session history (recent context) with PostgreSQL + pgvector (long-term memory). It uses Anthropic Claude to chat and extract durable memories, Voyage AI embeddings to embed them, and includes webhooks to forget specific memories or clear all memories for a user.
What this workflow does
- Receives chat via webhook (or manual trigger): validates userId, sessionId, and message, then loads configuration.
- Builds context from Redis: loads recent conversation turns and retrieves (or generates) a cached query embedding using Voyage AI stored in Redis.
- Searches long-term memories in PostgreSQL: runs a pgvector similarity search for the user, re-ranks results using similarity/importance/recency, and updates access statistics.
- Generates a response with Claude: sends recent turns plus retrieved memory context to Anthropic Claude and returns the reply to the webhook caller.
- Stores new durable memories in the background: saves updated session history back to Redis, has Claude extract new durable memories, embeds them with Voyage AI, and upserts into PostgreSQL while deduplicating near-duplicates.
- Daily maintenance: runs once per day to decay importance and prune expired or low-importance memories in PostgreSQL.
- Forgetting via webhook: deletes one memory by UUID or deletes all memories for a user in PostgreSQL, and clears the corresponding Redis session.
Use cases
- SaaS support bots that remember user preferences and ticket context over time
- Knowledge assistants that build a growing, vector-searchable user memory store
- Automation engineers needing controllable AI memory with explicit “forget” actions
Technical details
- Nodes used: if, set, code, redis, webhook, postgres
- Long-term storage: PostgreSQL with pgvector similarity search
- Embeddings: Voyage AI (cached in Redis)
- AI model: Anthropic Claude for chat and memory extraction
