From 339d1e35f8e8fb43bfc4c3ef048b4c758030546b Mon Sep 17 00:00:00 2001 From: Himanshu-Sangshetti Date: Mon, 20 Jul 2026 12:23:56 +0530 Subject: [PATCH] docs(integrations): add Zapier and n8n docs; align n8n toolchain and codex - Add docs/integrations/zapier.mdx and n8n.mdx, register both in docs.json (Developer Tools) and docs/llms.txt - Align n8n CD toolchain (pnpm 9 / Node 20) with the checks workflow so the published artifact is built on the toolchain CI validated - Add Mem0.node.json codex and copy it into dist via gulp for nodes-panel discoverability - Align search default limit to 50 across Zapier and n8n --- .github/workflows/n8n-nodes-mem0-cd.yml | 4 +- docs/docs.json | 2 + docs/integrations/n8n.mdx | 72 +++++++++++++++++++ docs/integrations/zapier.mdx | 61 ++++++++++++++++ docs/llms.txt | 2 + integrations/n8n-nodes-mem0/gulpfile.js | 4 +- .../n8n-nodes-mem0/nodes/Mem0/Mem0.node.json | 21 ++++++ .../zapier-mem0/searches/search_memories.js | 4 +- 8 files changed, 165 insertions(+), 5 deletions(-) create mode 100644 docs/integrations/n8n.mdx create mode 100644 docs/integrations/zapier.mdx create mode 100644 integrations/n8n-nodes-mem0/nodes/Mem0/Mem0.node.json diff --git a/.github/workflows/n8n-nodes-mem0-cd.yml b/.github/workflows/n8n-nodes-mem0-cd.yml index 642e5a6ac..dec25b4f3 100644 --- a/.github/workflows/n8n-nodes-mem0-cd.yml +++ b/.github/workflows/n8n-nodes-mem0-cd.yml @@ -34,12 +34,12 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v4 with: - version: 10 + version: 9 - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '22' + node-version: '20' registry-url: 'https://registry.npmjs.org' cache: 'pnpm' cache-dependency-path: integrations/n8n-nodes-mem0/pnpm-lock.yaml diff --git a/docs/docs.json b/docs/docs.json index 786d145f1..6642a9391 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -348,6 +348,8 @@ "pages": [ "integrations/dify", "integrations/flowise", + "integrations/n8n", + "integrations/zapier", "integrations/langchain-tools", "integrations/agentops", "integrations/respan", diff --git a/docs/integrations/n8n.mdx b/docs/integrations/n8n.mdx new file mode 100644 index 000000000..ac81f56ec --- /dev/null +++ b/docs/integrations/n8n.mdx @@ -0,0 +1,72 @@ +--- +title: n8n +description: "Add long-term memory to n8n workflows and AI Agents with the Mem0 community node, no code required." +--- + +The [`n8n-nodes-mem0`](https://www.npmjs.com/package/n8n-nodes-mem0) community node brings [Mem0](https://mem0.ai) memory to [n8n](https://n8n.io). Add, search, and manage long-term memories inside any workflow, and use it as a tool for the n8n AI Agent. + +## Overview + +The node wraps the hosted Mem0 REST API and supports six operations on the **Memory** resource: + +| Operation | Endpoint | +| --- | --- | +| **Add** | `POST /v3/memories/add/` | +| **Search** | `POST /v3/memories/search/` | +| **Get** | `GET /v1/memories/{id}/` | +| **Get Many** | `POST /v3/memories/` | +| **Update** | `PUT /v1/memories/{id}/` | +| **Delete** | `DELETE /v1/memories/{id}/` | + +It is marked `usableAsTool`, so the n8n AI Agent (Tools Agent) can call it directly to remember and recall information. + +## Installation + +Install it like any n8n community node: + +1. In n8n, go to **Settings → Community Nodes → Install**. +2. Enter `n8n-nodes-mem0` and confirm. + +The node then appears in the nodes panel under the AI category. + +## Authentication + +Create a **Mem0 API** credential in n8n: + +- **API Key**: from the Mem0 API Key dashboard. Sent as `Authorization: Token `. +- **Base URL**: defaults to `https://api.mem0.ai`. + +## Operations + +### Add + +Extracts and stores memories from one or more messages. Provide at least one entity id (**User ID**, **Agent ID**, **Run ID**, or **App ID** in Additional Fields); the node validates this before calling the API. Additional Fields also expose **Metadata (JSON)** and **Infer** (run LLM extraction, or store verbatim). + +Extraction is asynchronous. **Wait for Completion** (on by default) polls the event until it finishes and returns the resulting memories; turn it off to return immediately with the event ID. + +### Search + +Semantic search over stored memories. Provide a **Query**, a **User ID** (required, the API needs an entity filter), and an optional **Limit**. + +### Get Many + +Lists memories for a **User ID** with **Page** and **Page Size** controls. + +### Get / Update / Delete + +Operate on a single memory by **Memory ID**. Update accepts new **Text** and/or **Metadata (JSON)**. + +## Choosing a `userId` + +The `userId` is a stable string you choose to identify whose memories these are. It is not looked up in the dashboard. Common choices are your app's internal user ID, an email, or a UUID. Use the same value across Add, Search, and Get Many so recall works. + + + + Add memory to Zaps across thousands of apps + + + Add memory to Flowise chatflows + + + + diff --git a/docs/integrations/zapier.mdx b/docs/integrations/zapier.mdx new file mode 100644 index 000000000..9bbb74d88 --- /dev/null +++ b/docs/integrations/zapier.mdx @@ -0,0 +1,61 @@ +--- +title: Zapier +description: "Add, search, and manage Mem0 memories from any Zap using the Mem0 Zapier app, no code required." +--- + +The [Mem0](https://mem0.ai) Zapier app lets you add, search, list, and delete long-term memories from any [Zapier](https://zapier.com) workflow. Wire "remember" and "recall" into thousands of apps without writing code. + +## Overview + +The app wraps the hosted Mem0 REST API and exposes four actions: + +| Type | Action | Endpoint | +| --- | --- | --- | +| Create | **Add Memory** | `POST /v3/memories/add/` | +| Create | **Delete Memory** | `DELETE /v1/memories/{id}/` | +| Search | **Search Memories** | `POST /v3/memories/search/` | +| Search | **Get Memories** | `POST /v3/memories/` | + +## Authentication + +The app uses API key authentication. Grab a key from the Mem0 API Key dashboard and paste it when connecting your Mem0 account in Zapier. The key is sent as `Authorization: Token ` on every request. + +## Actions + +### Add Memory + +Extracts and stores memories from a message. Fields: + +- **Content** (required): the message text to extract memories from. +- **Role**: `user`, `assistant`, or `system`. +- **User ID / Agent ID / Run ID**: entity the memory belongs to. +- **Metadata (JSON)**: optional structured metadata. +- **Infer**: run LLM extraction (default) or store the message verbatim. +- **Wait for Completion**: off by default. Extraction is asynchronous, so the action returns immediately with an event ID. Turn this on to poll until extraction finishes and return the resulting memories. Extraction can take longer than a single Zapier step is allowed to run, so a timeout here does not mean the add failed; it usually still completes on the server. + +### Search Memories + +Semantic search over stored memories. Provide a **Query**, a **User ID** (required, the API needs an entity filter), and an optional **Limit**. + +### Get Memories + +Lists stored memories for a user. Provide a **User ID** (required), a **Limit** (page size), and a **Page** (1-based) to page through larger result sets. + +### Delete Memory + +Deletes a single memory by its **Memory ID**. + +## Choosing a `userId` + +The `user_id` is a stable string you choose to identify whose memories these are. It is not looked up in the dashboard. Common choices are your app's internal user ID, an email, or a UUID. Use the same value across Add, Search, and Get so recall works. + + + + Build workflows with the Mem0 n8n community node + + + Add memory to Flowise chatflows + + + + diff --git a/docs/llms.txt b/docs/llms.txt index 9b4f15e65..7f8bb66fa 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -281,6 +281,8 @@ If the user is on a pre-current major (Python < 2, TS < 3, or Platform `output_f ### Developer Tools - [Dify](https://docs.mem0.ai/integrations/dify) [Both]: Use when the user is on Dify LLMOps. - [Flowise](https://docs.mem0.ai/integrations/flowise) [Both]: Use when the user is on Flowise no-code. +- [n8n](https://docs.mem0.ai/integrations/n8n) [Both]: Use when the user builds workflows or AI agents in n8n. +- [Zapier](https://docs.mem0.ai/integrations/zapier) [Both]: Use when the user automates workflows with Zapier. - [AgentOps](https://docs.mem0.ai/integrations/agentops) [Both]: Use when tracking agent observability with memory metadata. - [Respan](https://docs.mem0.ai/integrations/respan) [Both]: Use when monitoring Mem0 with Respan (formerly Keywords AI) LLM observability. - [Raycast](https://docs.mem0.ai/integrations/raycast) [Both]: Use when the user wants quick memory access via Raycast. diff --git a/integrations/n8n-nodes-mem0/gulpfile.js b/integrations/n8n-nodes-mem0/gulpfile.js index db2245b7e..5a559dbb3 100644 --- a/integrations/n8n-nodes-mem0/gulpfile.js +++ b/integrations/n8n-nodes-mem0/gulpfile.js @@ -4,7 +4,9 @@ const { task, src, dest } = require('gulp'); task('build:icons', copyIcons); function copyIcons() { - const nodeSource = path.resolve('nodes', '**', '*.{png,svg}'); + // Copy icons and the codex (*.node.json) next to the compiled nodes; tsc emits + // only .js, so these static assets need copying for n8n to pick them up. + const nodeSource = path.resolve('nodes', '**', '*.{png,svg,json}'); const nodeDestination = path.resolve('dist', 'nodes'); src(nodeSource).pipe(dest(nodeDestination)); diff --git a/integrations/n8n-nodes-mem0/nodes/Mem0/Mem0.node.json b/integrations/n8n-nodes-mem0/nodes/Mem0/Mem0.node.json new file mode 100644 index 000000000..397297395 --- /dev/null +++ b/integrations/n8n-nodes-mem0/nodes/Mem0/Mem0.node.json @@ -0,0 +1,21 @@ +{ + "node": "n8n-nodes-mem0.mem0", + "nodeVersion": "1.0", + "codexVersion": "1.0", + "categories": ["AI"], + "subcategories": { + "AI": ["Memory"] + }, + "resources": { + "primaryDocumentation": [ + { + "url": "https://docs.mem0.ai/integrations/n8n" + } + ], + "credentialDocumentation": [ + { + "url": "https://docs.mem0.ai/integrations/n8n" + } + ] + } +} diff --git a/integrations/zapier-mem0/searches/search_memories.js b/integrations/zapier-mem0/searches/search_memories.js index 3562741f5..077870fa1 100644 --- a/integrations/zapier-mem0/searches/search_memories.js +++ b/integrations/zapier-mem0/searches/search_memories.js @@ -4,7 +4,7 @@ const perform = async (z, bundle) => { const body = { query: bundle.inputData.query, output_format: 'v1.1', - top_k: Math.max(1, Math.floor(Number(bundle.inputData.limit) || 10)), + top_k: Math.max(1, Math.floor(Number(bundle.inputData.limit) || 50)), }; if (bundle.inputData.user_id) body.filters = { user_id: bundle.inputData.user_id }; @@ -30,7 +30,7 @@ module.exports = { inputFields: [ { key: 'query', label: 'Query', type: 'string', required: true }, { key: 'user_id', label: 'User ID', type: 'string', required: true }, - { key: 'limit', label: 'Limit', type: 'integer', default: '10' }, + { key: 'limit', label: 'Limit', type: 'integer', default: '50' }, ], sample: { id: '00000000-0000-0000-0000-000000000000', memory: 'User loves hiking' }, },