Overview
Add long-term memory to any n8n AI workflow. Your agent remembers users across sessions — preferences, past conversations, resolved issues. No custom code needed, just HTTP Request nodes.Quick start
- Download the workflow from GitHub
- In n8n, go to Workflows → Import from File
- Add your Mengram API key as a Header Auth credential
- Activate and test
How it works
- Search memories — POST to
/v1/searchwith the user’s message to find relevant past context - AI Agent responds — system prompt includes retrieved memories, agent responds with full context
- Save new memories — POST to
/v1/addto store the conversation. Mengram auto-extracts facts and deduplicates
Credential setup
Create a Header Auth credential in n8n:API endpoints used
| Node | Method | URL | Body |
|---|---|---|---|
| Search Memories | POST | https://mengram.io/v1/search | {"query": "...", "user_id": "...", "limit": 5} |
| Save to Memory | POST | https://mengram.io/v1/add | {"messages": [...], "user_id": "..."} |
Swap the LLM
The workflow uses OpenAIgpt-4o-mini by default. To use a different LLM, change the URL and body in the AI Response node:
- Anthropic:
https://api.anthropic.com/v1/messages - Ollama (local):
http://localhost:11434/api/chat - Any OpenAI-compatible API: just change the URL and model name