n8n-nodes-mem0-self 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/credentials/Mem0SelfHostedApi.credentials.d.ts +10 -0
- package/dist/credentials/Mem0SelfHostedApi.credentials.d.ts.map +1 -0
- package/dist/credentials/Mem0SelfHostedApi.credentials.js +45 -0
- package/dist/credentials/Mem0SelfHostedApi.credentials.js.map +1 -0
- package/dist/nodes/Mem0/GenericFunctions.d.ts +15 -0
- package/dist/nodes/Mem0/GenericFunctions.d.ts.map +1 -0
- package/dist/nodes/Mem0/GenericFunctions.js +44 -0
- package/dist/nodes/Mem0/GenericFunctions.js.map +1 -0
- package/dist/nodes/Mem0/Mem0.node.d.ts +6 -0
- package/dist/nodes/Mem0/Mem0.node.d.ts.map +1 -0
- package/dist/nodes/Mem0/Mem0.node.js +249 -0
- package/dist/nodes/Mem0/Mem0.node.js.map +1 -0
- package/dist/nodes/Mem0/mem0.svg +20 -0
- package/index.js +1 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# n8n-nodes-mem0-selfhosted
|
|
2
|
+
|
|
3
|
+
Community node for Mem0 Self-Hosted REST API in n8n.
|
|
4
|
+
|
|
5
|
+
## Safe Profile Endpoints
|
|
6
|
+
|
|
7
|
+
- `POST /memories` (store user + assistant interaction)
|
|
8
|
+
- `POST /search` (search scoped by `user_id` + `agent_id`)
|
|
9
|
+
|
|
10
|
+
This package intentionally does not expose destructive/admin operations in the node UI.
|
|
11
|
+
|
|
12
|
+
## Required Identifiers
|
|
13
|
+
|
|
14
|
+
- `user_id` is mandatory
|
|
15
|
+
- `agent_id` is mandatory
|
|
16
|
+
- `run_id` is optional
|
|
17
|
+
|
|
18
|
+
## Credential Defaults (Development)
|
|
19
|
+
|
|
20
|
+
- Base URL: `https://memor.curta.se`
|
|
21
|
+
- API Key: set in n8n credentials (no hardcoded default in production)
|
|
22
|
+
|
|
23
|
+
Header used by the node: `X-API-Key`.
|
|
24
|
+
|
|
25
|
+
## Production Notes
|
|
26
|
+
|
|
27
|
+
- Keep API keys only in n8n credential storage.
|
|
28
|
+
- Use `run_id` when you need strict session isolation.
|
|
29
|
+
- If `run_id` is omitted, memory context is shared across all sessions for the same `user_id + agent_id`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class Mem0SelfHostedApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=Mem0SelfHostedApi.credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mem0SelfHostedApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/Mem0SelfHostedApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,iBAAkB,YAAW,eAAe;IACxD,IAAI,SAAuB;IAC3B,WAAW,SAA0B;IACrC,gBAAgB,SAAwD;IAExE,UAAU,EAAE,eAAe,EAAE,CAiB3B;IAEF,YAAY,EAAE,oBAAoB,CAOhC;IAEF,IAAI,EAAE,sBAAsB,CAM1B;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mem0SelfHostedApi = void 0;
|
|
4
|
+
class Mem0SelfHostedApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'mem0SelfHostedApi';
|
|
7
|
+
this.displayName = 'Mem0 Self-Hosted API';
|
|
8
|
+
this.documentationUrl = 'https://docs.mem0.ai/open-source/features/rest-api';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Base URL',
|
|
12
|
+
name: 'baseUrl',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: 'https://memor.curta.se',
|
|
15
|
+
required: true,
|
|
16
|
+
description: 'The base URL of your self-hosted Mem0 instance',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'API Key',
|
|
20
|
+
name: 'apiKey',
|
|
21
|
+
type: 'string',
|
|
22
|
+
typeOptions: { password: true },
|
|
23
|
+
default: '',
|
|
24
|
+
description: 'API key used in X-API-Key header',
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
this.authenticate = {
|
|
28
|
+
type: 'generic',
|
|
29
|
+
properties: {
|
|
30
|
+
headers: {
|
|
31
|
+
'X-API-Key': '={{$credentials.apiKey}}',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
this.test = {
|
|
36
|
+
request: {
|
|
37
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
38
|
+
url: '/docs',
|
|
39
|
+
method: 'GET',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.Mem0SelfHostedApi = Mem0SelfHostedApi;
|
|
45
|
+
//# sourceMappingURL=Mem0SelfHostedApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mem0SelfHostedApi.credentials.js","sourceRoot":"","sources":["../../credentials/Mem0SelfHostedApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,iBAAiB;IAA9B;QACC,SAAI,GAAG,mBAAmB,CAAC;QAC3B,gBAAW,GAAG,sBAAsB,CAAC;QACrC,qBAAgB,GAAG,oDAAoD,CAAC;QAExE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gDAAgD;aAC7D;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,kCAAkC;aAC/C;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,WAAW,EAAE,0BAA0B;iBACvC;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,OAAO;gBACZ,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAxCD,8CAwCC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-workflow';
|
|
2
|
+
type Ctx = IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions;
|
|
3
|
+
/**
|
|
4
|
+
* Extracts the memories array from an API response.
|
|
5
|
+
* Self-hosted usually returns arrays directly, but can also wrap results in
|
|
6
|
+
* { results: [...], relations: [...] }.
|
|
7
|
+
*/
|
|
8
|
+
export declare function extractResults(res: any): any[];
|
|
9
|
+
/**
|
|
10
|
+
* Shared API request helper used by all Mem0 nodes.
|
|
11
|
+
* Sends requests to Mem0 Self-Hosted REST API.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mem0ApiRequest(this: Ctx, method: string, endpoint: string, body?: Record<string, any>, qs?: Record<string, any>): Promise<any>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=GenericFunctions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.d.ts","sourceRoot":"","sources":["../../../nodes/Mem0/GenericFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EAErB,MAAM,cAAc,CAAC;AAGtB,KAAK,GAAG,GAAG,iBAAiB,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,CAK9C;AAED;;;GAGG;AACH,wBAAsB,cAAc,CACnC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAC9B,EAAE,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAC1B,OAAO,CAAC,GAAG,CAAC,CAqBd"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractResults = extractResults;
|
|
4
|
+
exports.mem0ApiRequest = mem0ApiRequest;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
/**
|
|
7
|
+
* Extracts the memories array from an API response.
|
|
8
|
+
* Self-hosted usually returns arrays directly, but can also wrap results in
|
|
9
|
+
* { results: [...], relations: [...] }.
|
|
10
|
+
*/
|
|
11
|
+
function extractResults(res) {
|
|
12
|
+
if (Array.isArray(res))
|
|
13
|
+
return res;
|
|
14
|
+
if (res?.results && Array.isArray(res.results))
|
|
15
|
+
return res.results;
|
|
16
|
+
if (res)
|
|
17
|
+
return [res];
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Shared API request helper used by all Mem0 nodes.
|
|
22
|
+
* Sends requests to Mem0 Self-Hosted REST API.
|
|
23
|
+
*/
|
|
24
|
+
async function mem0ApiRequest(method, endpoint, body = {}, qs = {}) {
|
|
25
|
+
const credentials = await this.getCredentials('mem0SelfHostedApi');
|
|
26
|
+
const baseUrl = credentials.baseUrl.replace(/\/$/, '');
|
|
27
|
+
const resolvedEndpoint = endpoint.startsWith('/') ? endpoint : `/${endpoint}`;
|
|
28
|
+
const options = {
|
|
29
|
+
method: method,
|
|
30
|
+
body,
|
|
31
|
+
qs,
|
|
32
|
+
url: `${baseUrl}${resolvedEndpoint}`,
|
|
33
|
+
};
|
|
34
|
+
if (credentials.apiKey) {
|
|
35
|
+
options.headers = { 'X-API-Key': credentials.apiKey };
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
return await this.helpers.httpRequest(options);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Mem0/GenericFunctions.ts"],"names":[],"mappings":";;AAeA,wCAKC;AAMD,wCA2BC;AA/CD,+CAA4C;AAI5C;;;;GAIG;AACH,SAAgB,cAAc,CAAC,GAAQ;IACtC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACnC,IAAI,GAAG,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC;IACnE,IAAI,GAAG;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,EAAE,CAAC;AACX,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,cAAc,CAEnC,MAAc,EACd,QAAgB,EAChB,OAA4B,EAAE,EAC9B,KAA0B,EAAE;IAE5B,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;IACnE,MAAM,OAAO,GAAI,WAAW,CAAC,OAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC;IAE9E,MAAM,OAAO,GAAwB;QACpC,MAAM,EAAE,MAAuC;QAC/C,IAAI;QACJ,EAAE;QACF,GAAG,EAAE,GAAG,OAAO,GAAG,gBAAgB,EAAE;KACpC,CAAC;IAEF,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,CAAC,OAAO,GAAG,EAAE,WAAW,EAAE,WAAW,CAAC,MAAgB,EAAE,CAAC;IACjE,CAAC;IAED,IAAI,CAAC;QACJ,OAAO,MAAO,IAA0B,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACvE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAY,CAAC,CAAC;IACtD,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class Mem0 implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=Mem0.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mem0.node.d.ts","sourceRoot":"","sources":["../../../nodes/Mem0/Mem0.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAItB,qBAAa,IAAK,YAAW,SAAS;IACrC,WAAW,EAAE,oBAAoB,CAyH/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAyIvE"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mem0 = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
6
|
+
class Mem0 {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'Mem0 Self-Hosted',
|
|
10
|
+
name: 'mem0SelfHosted',
|
|
11
|
+
icon: 'file:mem0.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
documentationUrl: 'https://docs.mem0.ai/open-source/features/rest-api',
|
|
14
|
+
version: 1,
|
|
15
|
+
description: 'Safe chat-memory profile for Mem0 Self-Hosted',
|
|
16
|
+
defaults: { name: 'Mem0 Self-Hosted' },
|
|
17
|
+
inputs: ['main'],
|
|
18
|
+
outputs: ['main'],
|
|
19
|
+
credentials: [{ name: 'mem0SelfHostedApi', required: true }],
|
|
20
|
+
properties: [
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Operation',
|
|
23
|
+
name: 'operation',
|
|
24
|
+
type: 'options',
|
|
25
|
+
noDataExpression: true,
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
name: 'Store Interaction',
|
|
29
|
+
value: 'storeInteraction',
|
|
30
|
+
action: 'Store an interaction',
|
|
31
|
+
description: 'Store user and assistant messages in a single POST /memories call',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'Search Conversation Context',
|
|
35
|
+
value: 'searchConversation',
|
|
36
|
+
action: 'Search conversation context',
|
|
37
|
+
description: 'Search memories filtered by user_id and agent_id using POST /search',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
default: 'storeInteraction',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
displayName: 'User ID',
|
|
44
|
+
name: 'userId',
|
|
45
|
+
type: 'string',
|
|
46
|
+
default: '',
|
|
47
|
+
required: true,
|
|
48
|
+
description: 'User identifier (required)',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'Agent ID',
|
|
52
|
+
name: 'agentId',
|
|
53
|
+
type: 'string',
|
|
54
|
+
default: '',
|
|
55
|
+
required: true,
|
|
56
|
+
description: 'Agent identifier (required)',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
displayName: 'Run ID',
|
|
60
|
+
name: 'runId',
|
|
61
|
+
type: 'string',
|
|
62
|
+
default: '',
|
|
63
|
+
required: false,
|
|
64
|
+
description: 'Optional session identifier',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'User Message',
|
|
68
|
+
name: 'userMessage',
|
|
69
|
+
type: 'string',
|
|
70
|
+
typeOptions: { rows: 3 },
|
|
71
|
+
default: '',
|
|
72
|
+
required: true,
|
|
73
|
+
displayOptions: { show: { operation: ['storeInteraction'] } },
|
|
74
|
+
description: 'User message to be stored',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Assistant Message',
|
|
78
|
+
name: 'assistantMessage',
|
|
79
|
+
type: 'string',
|
|
80
|
+
typeOptions: { rows: 3 },
|
|
81
|
+
default: '',
|
|
82
|
+
required: true,
|
|
83
|
+
displayOptions: { show: { operation: ['storeInteraction'] } },
|
|
84
|
+
description: 'Assistant message to be stored',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
displayName: 'Infer',
|
|
88
|
+
name: 'infer',
|
|
89
|
+
type: 'boolean',
|
|
90
|
+
default: true,
|
|
91
|
+
displayOptions: { show: { operation: ['storeInteraction'] } },
|
|
92
|
+
description: 'Enable Mem0 inference while storing',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: 'Search Query',
|
|
96
|
+
name: 'query',
|
|
97
|
+
type: 'string',
|
|
98
|
+
default: '',
|
|
99
|
+
required: true,
|
|
100
|
+
displayOptions: { show: { operation: ['searchConversation'] } },
|
|
101
|
+
description: 'Natural-language query for memory search',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
displayName: 'Top K',
|
|
105
|
+
name: 'topK',
|
|
106
|
+
type: 'number',
|
|
107
|
+
default: 10,
|
|
108
|
+
typeOptions: { minValue: 1 },
|
|
109
|
+
displayOptions: { show: { operation: ['searchConversation'] } },
|
|
110
|
+
description: 'Maximum number of memories to return',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
displayName: 'Rerank',
|
|
114
|
+
name: 'rerank',
|
|
115
|
+
type: 'boolean',
|
|
116
|
+
default: false,
|
|
117
|
+
displayOptions: { show: { operation: ['searchConversation'] } },
|
|
118
|
+
description: 'Enable reranking on search results',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Fields (Comma Separated)',
|
|
122
|
+
name: 'fields',
|
|
123
|
+
type: 'string',
|
|
124
|
+
default: '',
|
|
125
|
+
displayOptions: { show: { operation: ['searchConversation'] } },
|
|
126
|
+
description: 'Optional list of response fields',
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
async execute() {
|
|
132
|
+
const MAX_MESSAGE_LENGTH = 10000;
|
|
133
|
+
const MAX_QUERY_LENGTH = 2000;
|
|
134
|
+
const MAX_TOP_K = 50;
|
|
135
|
+
const items = this.getInputData();
|
|
136
|
+
const returnData = [];
|
|
137
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
138
|
+
for (let i = 0; i < items.length; i++) {
|
|
139
|
+
try {
|
|
140
|
+
const userId = String(this.getNodeParameter('userId', i, '')).trim();
|
|
141
|
+
const agentId = String(this.getNodeParameter('agentId', i, '')).trim();
|
|
142
|
+
const runId = String(this.getNodeParameter('runId', i, '')).trim();
|
|
143
|
+
if (!userId || !agentId) {
|
|
144
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'User ID and Agent ID are required for this safe profile.');
|
|
145
|
+
}
|
|
146
|
+
if (operation === 'storeInteraction') {
|
|
147
|
+
const userMessage = String(this.getNodeParameter('userMessage', i) || '').trim();
|
|
148
|
+
const assistantMessage = String(this.getNodeParameter('assistantMessage', i) || '').trim();
|
|
149
|
+
const infer = this.getNodeParameter('infer', i, true);
|
|
150
|
+
if (!userMessage) {
|
|
151
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'User Message cannot be empty.');
|
|
152
|
+
}
|
|
153
|
+
if (!assistantMessage) {
|
|
154
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Assistant Message cannot be empty.');
|
|
155
|
+
}
|
|
156
|
+
if (userMessage.length > MAX_MESSAGE_LENGTH) {
|
|
157
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `User Message is too long. Maximum supported length is ${MAX_MESSAGE_LENGTH} characters.`);
|
|
158
|
+
}
|
|
159
|
+
if (assistantMessage.length > MAX_MESSAGE_LENGTH) {
|
|
160
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Assistant Message is too long. Maximum supported length is ${MAX_MESSAGE_LENGTH} characters.`);
|
|
161
|
+
}
|
|
162
|
+
const body = {
|
|
163
|
+
user_id: userId,
|
|
164
|
+
agent_id: agentId,
|
|
165
|
+
infer,
|
|
166
|
+
messages: [
|
|
167
|
+
{ role: 'user', content: userMessage },
|
|
168
|
+
{ role: 'assistant', content: assistantMessage },
|
|
169
|
+
],
|
|
170
|
+
metadata: { source: 'n8n_safe_profile' },
|
|
171
|
+
};
|
|
172
|
+
if (runId)
|
|
173
|
+
body.run_id = runId;
|
|
174
|
+
const response = await GenericFunctions_1.mem0ApiRequest.call(this, 'POST', '/memories', body);
|
|
175
|
+
returnData.push({
|
|
176
|
+
json: {
|
|
177
|
+
ok: true,
|
|
178
|
+
operation,
|
|
179
|
+
user_id: userId,
|
|
180
|
+
agent_id: agentId,
|
|
181
|
+
run_id: runId || null,
|
|
182
|
+
response,
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (operation === 'searchConversation') {
|
|
188
|
+
const query = String(this.getNodeParameter('query', i) || '').trim();
|
|
189
|
+
const topKInput = Number(this.getNodeParameter('topK', i, 10));
|
|
190
|
+
const rerank = Boolean(this.getNodeParameter('rerank', i, false));
|
|
191
|
+
const fieldsInput = String(this.getNodeParameter('fields', i, '') || '').trim();
|
|
192
|
+
const topK = Math.min(Math.max(1, Math.floor(topKInput || 10)), MAX_TOP_K);
|
|
193
|
+
if (!query) {
|
|
194
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Search Query cannot be empty.');
|
|
195
|
+
}
|
|
196
|
+
if (query.length > MAX_QUERY_LENGTH) {
|
|
197
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Search Query is too long. Maximum supported length is ${MAX_QUERY_LENGTH} characters.`);
|
|
198
|
+
}
|
|
199
|
+
const body = {
|
|
200
|
+
query,
|
|
201
|
+
user_id: userId,
|
|
202
|
+
agent_id: agentId,
|
|
203
|
+
top_k: topK,
|
|
204
|
+
rerank,
|
|
205
|
+
};
|
|
206
|
+
if (runId)
|
|
207
|
+
body.run_id = runId;
|
|
208
|
+
if (fieldsInput) {
|
|
209
|
+
body.fields = fieldsInput
|
|
210
|
+
.split(',')
|
|
211
|
+
.map((field) => field.trim())
|
|
212
|
+
.filter((field) => field.length > 0);
|
|
213
|
+
}
|
|
214
|
+
const response = await GenericFunctions_1.mem0ApiRequest.call(this, 'POST', '/search', body);
|
|
215
|
+
const results = (0, GenericFunctions_1.extractResults)(response);
|
|
216
|
+
if (results.length === 0) {
|
|
217
|
+
returnData.push({ json: { ok: true, operation, results: [] } });
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
for (const row of results) {
|
|
221
|
+
returnData.push({
|
|
222
|
+
json: {
|
|
223
|
+
ok: true,
|
|
224
|
+
operation,
|
|
225
|
+
user_id: userId,
|
|
226
|
+
agent_id: agentId,
|
|
227
|
+
run_id: runId || null,
|
|
228
|
+
result: row,
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported operation: ${operation}`);
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
if (this.continueOnFail()) {
|
|
239
|
+
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
throw error;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return [returnData];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
exports.Mem0 = Mem0;
|
|
249
|
+
//# sourceMappingURL=Mem0.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mem0.node.js","sourceRoot":"","sources":["../../../nodes/Mem0/Mem0.node.ts"],"names":[],"mappings":";;;AAMA,+CAAkD;AAClD,yDAAoE;AAEpE,MAAa,IAAI;IAAjB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,gBAAgB,EAAE,oDAAoD;YACtE,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE;YACtC,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YA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P,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;4BAC3B,UAAU,CAAC,IAAI,CAAC;gCACf,IAAI,EAAE;oCACL,EAAE,EAAE,IAAI;oCACR,SAAS;oCACT,OAAO,EAAE,MAAM;oCACf,QAAQ,EAAE,OAAO;oCACjB,MAAM,EAAE,KAAK,IAAI,IAAI;oCACrB,MAAM,EAAE,GAAG;iCACX;6BACD,CAAC,CAAC;wBACJ,CAAC;oBACF,CAAC;oBACD,SAAS;gBACV,CAAC;gBAED,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,0BAA0B,SAAS,EAAE,CAAC,CAAC;YACrF,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACrB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;oBAC7E,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AArQD,oBAqQC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="mem0Gradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" style="stop-color:#4F46E5;stop-opacity:1" />
|
|
5
|
+
<stop offset="100%" style="stop-color:#7C3AED;stop-opacity:1" />
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="60" height="60" rx="8" fill="url(#mem0Gradient)"/>
|
|
9
|
+
<g transform="translate(15, 15)">
|
|
10
|
+
<circle cx="15" cy="10" r="3" fill="white" opacity="0.9"/>
|
|
11
|
+
<circle cx="15" cy="20" r="3" fill="white" opacity="0.9"/>
|
|
12
|
+
<circle cx="8" cy="15" r="2.5" fill="white" opacity="0.7"/>
|
|
13
|
+
<circle cx="22" cy="15" r="2.5" fill="white" opacity="0.7"/>
|
|
14
|
+
<path d="M 15 13 L 15 17" stroke="white" stroke-width="2" opacity="0.8"/>
|
|
15
|
+
<path d="M 10 12 L 13 10" stroke="white" stroke-width="1.5" opacity="0.6"/>
|
|
16
|
+
<path d="M 20 12 L 17 10" stroke="white" stroke-width="1.5" opacity="0.6"/>
|
|
17
|
+
<path d="M 10 18 L 13 20" stroke="white" stroke-width="1.5" opacity="0.6"/>
|
|
18
|
+
<path d="M 20 18 L 17 20" stroke="white" stroke-width="1.5" opacity="0.6"/>
|
|
19
|
+
</g>
|
|
20
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {};
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-mem0-self",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for Mem0 Self-Hosted REST API",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Amaral Karl"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/kallbuloso/n8n-nodes-mem0-self.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/kallbuloso/n8n-nodes-mem0-self#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/kallbuloso/n8n-nodes-mem0-self/issues"
|
|
16
|
+
},
|
|
17
|
+
"main": "index.js",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"index.js",
|
|
22
|
+
"README.md",
|
|
23
|
+
"package.json"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc -p tsconfig.json && node scripts/copy-assets.js",
|
|
27
|
+
"dev": "tsc -w -p tsconfig.json",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"n8n-community-node-package",
|
|
32
|
+
"n8n",
|
|
33
|
+
"mem0",
|
|
34
|
+
"memory",
|
|
35
|
+
"ai",
|
|
36
|
+
"llm",
|
|
37
|
+
"long-term-memory",
|
|
38
|
+
"semantic-search",
|
|
39
|
+
"vector-database",
|
|
40
|
+
"ai-agent",
|
|
41
|
+
"agent-id",
|
|
42
|
+
"langchain",
|
|
43
|
+
"self-hosted"
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18.17"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"typescript": "^5.6.3"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"n8n-workflow": "*"
|
|
53
|
+
},
|
|
54
|
+
"n8n": {
|
|
55
|
+
"n8nNodesApiVersion": 1,
|
|
56
|
+
"credentials": [
|
|
57
|
+
"dist/credentials/Mem0SelfHostedApi.credentials.js"
|
|
58
|
+
],
|
|
59
|
+
"nodes": [
|
|
60
|
+
"dist/nodes/Mem0/Mem0.node.js"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|