Description
# n8n-nodes-mem0-self
Community node package for Mem0 Self-Hosted (OSS REST API) memory in n8n AI workflows.
> This package is community-maintained and focused on Self-Hosted Mem0 deployments.
Introduction
n8n-nodes-mem0-self provides a memory node for n8n AI Agent workflows with:
- persistent memory storage (
POST /memories) - semantic retrieval (
POST /search) - conversation-buffer retrieval (
GET /memories) - scoped isolation by
userid,agentid, and optionalrun_id Mem0 Chat Memory(mem0Memory)Settings -> Community Nodes -> Install- Package:
n8n-nodes-mem0-self - Restart n8n
Credentials -> New -> Mem0 Self-Hosted APIBase URL: for examplehttp://localhost:8000API Key: your Mem0X-API-Key- Add
AI Agent - Connect your chat model to
ai_languageModel - Add
Mem0 Chat Memoryand connect toai_memory User ID(required)Agent ID(required)Run ID(recommended)
Current memory node:
Quick Start (3 minutes)
1. Install via Community Nodes:
2. Create credentials:
3. Wire your workflow:
4. Configure identity:
Installation
Community Nodes (recommended)
1. Open n8n
2. Go to Settings -> Community Nodes
3. Click Install
4. Enter n8n-nodes-mem0-self
5. Restart n8n
Manual install
npm install n8n-nodes-mem0-self@latest
Restart n8n after installation.
Credentials
Credential type: Mem0 Self-Hosted API
Required fields:
1. Base URL
http://localhost:80002. API Key
X-API-KeyIncluded Node
Mem0 Chat Memory (mem0Memory)
Memory provider node for n8n AI Agent, with hybrid and semantic retrieval modes.
Parameter Reference
Identity and Scope
1. User ID (userId)
2. Agent ID (agentId)
3. Run ID (runId)
Retrieval Controls
1. Top K (topK)
2. Memory Mode (memoryMode)
conversation_pairs: recent conversation buffer + optional semantic fallbacksemantic_facts: semantic retrieval only3. Buffer Limit (Interactions) (bufferLimit)
bufferLimit * 24. Fallback to Search on Buffer Miss (fallbackToSearchOnBufferMiss)
5. Conversation Retrieval Policy (conversationRetrievalPolicy)
smart_fallback (recommended)search_firstbuffer_first6. Search Query (Optional) (searchQuery)
7. Fallback Query (defaultQuery)
8. Search Mode (searchMode)
balancedstrict_factsalllegacy (compatibility)9. Max Context Characters (maxContextChars)
10. Rerank Results (rerank)
11. Fields (Comma Separated) (fields)
12. Search Filters (JSON) (searchFilters)
13. Include Assistant Memories (includeAssistantMemories)
14. Allow Empty Context (allowEmptyContext)
15. Debug Memory Retrieval (debugMemory)
Storage Controls
1. Store Strategy (storeStrategy)
conversation: store user + assistant turnsfacts_only: store user-side factual signals only2. Infer on Store (Legacy) (infer)
Recommended Defaults
For production-first hybrid behavior:
1. memoryMode = conversation_pairs
2. conversationRetrievalPolicy = smart_fallback
3. bufferLimit = 20
4. topK = 4..6
5. maxContextChars = 700..1200
6. searchMode = balanced
Examples
Ready-to-import examples are in:
Testing
Validated in local package tests:
npm run buildnode test-integration.jsnode test-mem0-memory.jsNotes
userId and agentId, and prefer setting runId.License
MIT