@memorilabs/openclaw-memori 0.0.6 → 0.0.7-beta
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 +123 -96
- package/dist/cli/commands.d.ts +2 -0
- package/dist/cli/commands.js +143 -0
- package/dist/cli/config-file.d.ts +8 -0
- package/dist/cli/config-file.js +64 -0
- package/dist/handlers/augmentation.js +12 -5
- package/dist/index.js +51 -5
- package/dist/sanitizer.d.ts +1 -0
- package/dist/sanitizer.js +10 -2
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.js +16 -0
- package/dist/tools/memori-compaction.d.ts +35 -0
- package/dist/tools/memori-compaction.js +119 -0
- package/dist/tools/memori-feedback.d.ts +25 -0
- package/dist/tools/memori-feedback.js +40 -0
- package/dist/tools/memori-quota.d.ts +17 -0
- package/dist/tools/memori-quota.js +55 -0
- package/dist/tools/memori-recall-summary.d.ts +39 -0
- package/dist/tools/memori-recall-summary.js +58 -0
- package/dist/tools/memori-recall.d.ts +51 -0
- package/dist/tools/memori-recall.js +123 -0
- package/dist/tools/memori-signup.d.ts +25 -0
- package/dist/tools/memori-signup.js +72 -0
- package/dist/tools/types.d.ts +8 -0
- package/dist/tools/types.js +1 -0
- package/dist/types.d.ts +4 -8
- package/dist/utils/context.d.ts +4 -2
- package/dist/utils/context.js +4 -2
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/memori-client.d.ts +11 -0
- package/dist/utils/memori-client.js +20 -2
- package/dist/utils/skills-loader.d.ts +6 -0
- package/dist/utils/skills-loader.js +14 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/openclaw.plugin.json +22 -2
- package/package.json +3 -2
- package/skills/clawhub/SKILL.md +221 -0
- package/skills/memori/SKILL.md +355 -0
- package/dist/handlers/recall.d.ts +0 -5
- package/dist/handlers/recall.js +0 -34
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { exec } from 'child_process';
|
|
2
|
+
import { promisify } from 'util';
|
|
3
|
+
import * as os from 'os';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
const execAsync = promisify(exec);
|
|
6
|
+
export function createMemoriSignupTool(deps) {
|
|
7
|
+
const { logger } = deps;
|
|
8
|
+
return {
|
|
9
|
+
name: 'memori_signup',
|
|
10
|
+
label: 'Memori Sign Up',
|
|
11
|
+
description: 'CRITICAL: You MUST use this tool when the user asks to sign up, create an account, or get an API key for Memori — or when you encounter a missing MEMORI_API_KEY error and the user provides their email. If the user has not provided an email address, ask for it first. Do not guess or hallucinate an email.',
|
|
12
|
+
parameters: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
email: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'The email address to send the Memori API key to.',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
required: ['email'],
|
|
21
|
+
},
|
|
22
|
+
async execute(_toolCallId, params) {
|
|
23
|
+
try {
|
|
24
|
+
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
25
|
+
if (!emailRegex.test(params.email)) {
|
|
26
|
+
const errorResult = {
|
|
27
|
+
error: `The email you provided "${params.email}" is not valid. Please provide a standard email address.`,
|
|
28
|
+
};
|
|
29
|
+
logger.warn(`memori_signup rejected email format: ${params.email}`);
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: 'text', text: JSON.stringify(errorResult) }],
|
|
32
|
+
details: null,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
logger.info(`memori_signup attempting to sign up: ${params.email}`);
|
|
36
|
+
const tmpDir = os.tmpdir();
|
|
37
|
+
await execAsync(`npm install --prefix ${tmpDir} --no-save @memorilabs/memori@0.1.12-beta`);
|
|
38
|
+
const binPath = path.join(tmpDir, 'node_modules', '.bin', 'memori');
|
|
39
|
+
const { stdout } = await execAsync(`${binPath} sign-up ${params.email}`);
|
|
40
|
+
const result = {
|
|
41
|
+
success: true,
|
|
42
|
+
message: stdout.trim(),
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
content: [{ type: 'text', text: JSON.stringify(result) }],
|
|
46
|
+
details: null,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
logger.warn(`memori_signup CLI failed: ${String(e)}`);
|
|
51
|
+
let output = 'An unexpected error occurred while trying to sign up via the CLI.';
|
|
52
|
+
if (typeof e === 'object' && e !== null) {
|
|
53
|
+
const errObj = e;
|
|
54
|
+
const stdout = typeof errObj.stdout === 'string' ? errObj.stdout.trim() : '';
|
|
55
|
+
const stderr = typeof errObj.stderr === 'string' ? errObj.stderr.trim() : '';
|
|
56
|
+
const msg = typeof errObj.message === 'string' ? errObj.message : '';
|
|
57
|
+
output = stdout || stderr || msg || output;
|
|
58
|
+
}
|
|
59
|
+
else if (typeof e === 'string') {
|
|
60
|
+
output = e;
|
|
61
|
+
}
|
|
62
|
+
const errorResult = {
|
|
63
|
+
error: output,
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
content: [{ type: 'text', text: JSON.stringify(errorResult) }],
|
|
67
|
+
details: null,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OpenClawPluginApi } from 'openclaw/plugin-sdk';
|
|
2
|
+
import type { MemoriPluginConfig } from '../types.js';
|
|
3
|
+
import type { MemoriLogger } from '../utils/logger.js';
|
|
4
|
+
export interface ToolDeps {
|
|
5
|
+
api: OpenClawPluginApi;
|
|
6
|
+
config: MemoriPluginConfig;
|
|
7
|
+
logger: MemoriLogger;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { IntegrationMessage } from '@memorilabs/memori/integrations';
|
|
1
2
|
export interface MemoriPluginConfig {
|
|
2
3
|
apiKey: string;
|
|
3
4
|
entityId: string;
|
|
5
|
+
projectId: string;
|
|
4
6
|
}
|
|
5
7
|
export interface OpenClawMessageBlock {
|
|
6
8
|
type?: string;
|
|
@@ -44,13 +46,7 @@ export interface ExtractedToolCall {
|
|
|
44
46
|
result: unknown;
|
|
45
47
|
}
|
|
46
48
|
export interface ParsedTurn {
|
|
47
|
-
userMessage:
|
|
48
|
-
|
|
49
|
-
content: string;
|
|
50
|
-
} | null;
|
|
51
|
-
assistantMessage: {
|
|
52
|
-
role: string;
|
|
53
|
-
content: string;
|
|
54
|
-
} | null;
|
|
49
|
+
userMessage: IntegrationMessage | null;
|
|
50
|
+
assistantMessage: IntegrationMessage | null;
|
|
55
51
|
tools: ExtractedToolCall[];
|
|
56
52
|
}
|
package/dist/utils/context.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface ExtractedContext {
|
|
|
6
6
|
entityId: string;
|
|
7
7
|
sessionId: string;
|
|
8
8
|
provider: string;
|
|
9
|
+
projectId: string;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Extracts and normalizes context information from OpenClaw event and context objects.
|
|
@@ -14,7 +15,8 @@ export interface ExtractedContext {
|
|
|
14
15
|
* @param event - OpenClaw event object
|
|
15
16
|
* @param ctx - OpenClaw context object
|
|
16
17
|
* @param configuredEntityId - Hardcoded entity ID from plugin config
|
|
17
|
-
* @
|
|
18
|
+
* @param configuredProjectId - Project ID from plugin config
|
|
19
|
+
* @returns Normalized context with entityId, sessionId, provider, and projectId
|
|
18
20
|
* @throws Error If entityId, sessionId, or provider cannot be determined
|
|
19
21
|
*/
|
|
20
|
-
export declare function extractContext(event: OpenClawEvent, ctx: OpenClawContext, configuredEntityId: string): ExtractedContext;
|
|
22
|
+
export declare function extractContext(event: OpenClawEvent, ctx: OpenClawContext, configuredEntityId: string, configuredProjectId: string): ExtractedContext;
|
package/dist/utils/context.js
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* @param event - OpenClaw event object
|
|
6
6
|
* @param ctx - OpenClaw context object
|
|
7
7
|
* @param configuredEntityId - Hardcoded entity ID from plugin config
|
|
8
|
-
* @
|
|
8
|
+
* @param configuredProjectId - Project ID from plugin config
|
|
9
|
+
* @returns Normalized context with entityId, sessionId, provider, and projectId
|
|
9
10
|
* @throws Error If entityId, sessionId, or provider cannot be determined
|
|
10
11
|
*/
|
|
11
|
-
export function extractContext(event, ctx, configuredEntityId) {
|
|
12
|
+
export function extractContext(event, ctx, configuredEntityId, configuredProjectId) {
|
|
12
13
|
const sessionId = ctx.sessionKey || event.sessionId;
|
|
13
14
|
const provider = ctx.messageProvider || event.messageProvider;
|
|
14
15
|
if (!sessionId) {
|
|
@@ -21,5 +22,6 @@ export function extractContext(event, ctx, configuredEntityId) {
|
|
|
21
22
|
entityId: configuredEntityId,
|
|
22
23
|
sessionId,
|
|
23
24
|
provider,
|
|
25
|
+
projectId: configuredProjectId,
|
|
24
26
|
};
|
|
25
27
|
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { extractContext, type ExtractedContext } from './context.js';
|
|
2
2
|
export { MemoriLogger } from './logger.js';
|
|
3
|
-
export { initializeMemoriClient } from './memori-client.js';
|
|
3
|
+
export { initializeMemoriClient, createRecallClient } from './memori-client.js';
|
|
4
|
+
export { loadSkillsContent } from './skills-loader.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { extractContext } from './context.js';
|
|
2
2
|
export { MemoriLogger } from './logger.js';
|
|
3
|
-
export { initializeMemoriClient } from './memori-client.js';
|
|
3
|
+
export { initializeMemoriClient, createRecallClient } from './memori-client.js';
|
|
4
|
+
export { loadSkillsContent } from './skills-loader.js';
|
|
@@ -8,3 +8,14 @@ import { ExtractedContext } from './context.js';
|
|
|
8
8
|
* @returns Configured OpenClawIntegration instance
|
|
9
9
|
*/
|
|
10
10
|
export declare function initializeMemoriClient(apiKey: string, context: ExtractedContext): OpenClawIntegration;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a minimal Memori client scoped only to an entity, with no session or project
|
|
13
|
+
* context pre-set. Intended for use in tool execute handlers where OpenClaw does not
|
|
14
|
+
* reliably provide session context — callers supply projectId/sessionId as explicit
|
|
15
|
+
* parameters instead.
|
|
16
|
+
*
|
|
17
|
+
* @param apiKey - Memori API key
|
|
18
|
+
* @param entityId - Entity ID for attribution
|
|
19
|
+
* @returns Configured OpenClawIntegration instance
|
|
20
|
+
*/
|
|
21
|
+
export declare function createRecallClient(apiKey: string, entityId: string): OpenClawIntegration;
|
|
@@ -11,7 +11,25 @@ export function initializeMemoriClient(apiKey, context) {
|
|
|
11
11
|
const memori = new Memori();
|
|
12
12
|
memori.config.apiKey = apiKey;
|
|
13
13
|
const openclaw = memori.integrate(OpenClawIntegration);
|
|
14
|
-
openclaw
|
|
15
|
-
|
|
14
|
+
openclaw
|
|
15
|
+
.scope(context.sessionId, context.projectId)
|
|
16
|
+
.attribution(context.entityId, context.provider);
|
|
17
|
+
return openclaw;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates a minimal Memori client scoped only to an entity, with no session or project
|
|
21
|
+
* context pre-set. Intended for use in tool execute handlers where OpenClaw does not
|
|
22
|
+
* reliably provide session context — callers supply projectId/sessionId as explicit
|
|
23
|
+
* parameters instead.
|
|
24
|
+
*
|
|
25
|
+
* @param apiKey - Memori API key
|
|
26
|
+
* @param entityId - Entity ID for attribution
|
|
27
|
+
* @returns Configured OpenClawIntegration instance
|
|
28
|
+
*/
|
|
29
|
+
export function createRecallClient(apiKey, entityId) {
|
|
30
|
+
const memori = new Memori();
|
|
31
|
+
memori.config.apiKey = apiKey;
|
|
32
|
+
const openclaw = memori.integrate(OpenClawIntegration);
|
|
33
|
+
openclaw.attribution(entityId);
|
|
16
34
|
return openclaw;
|
|
17
35
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads the Memori skills document at plugin registration time.
|
|
3
|
+
* Returns an empty string if the file cannot be read so the plugin
|
|
4
|
+
* degrades gracefully rather than failing to register.
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadSkillsContent(resolvePath: (input: string) => string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
/**
|
|
3
|
+
* Loads the Memori skills document at plugin registration time.
|
|
4
|
+
* Returns an empty string if the file cannot be read so the plugin
|
|
5
|
+
* degrades gracefully rather than failing to register.
|
|
6
|
+
*/
|
|
7
|
+
export function loadSkillsContent(resolvePath) {
|
|
8
|
+
try {
|
|
9
|
+
return readFileSync(resolvePath('skills/memori/SKILL.md'), 'utf-8');
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.7-beta";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = '0.0.
|
|
1
|
+
export const SDK_VERSION = '0.0.7-beta';
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "openclaw-memori",
|
|
3
3
|
"name": "Memori System",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"description": "Hosted memory backend",
|
|
6
6
|
"kind": "memory",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
|
+
"contracts": {
|
|
9
|
+
"tools": [
|
|
10
|
+
"memori_recall",
|
|
11
|
+
"memori_recall_summary",
|
|
12
|
+
"memori_compaction",
|
|
13
|
+
"memori_feedback",
|
|
14
|
+
"memori_signup",
|
|
15
|
+
"memori_quota"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
8
18
|
"uiHints": {
|
|
9
19
|
"apiKey": {
|
|
10
20
|
"label": "Memori API Key",
|
|
@@ -16,6 +26,11 @@
|
|
|
16
26
|
"label": "Entity ID",
|
|
17
27
|
"placeholder": "e.g., your-app-user-id",
|
|
18
28
|
"help": "Required. The unique identifier to attribute these memories to."
|
|
29
|
+
},
|
|
30
|
+
"projectId": {
|
|
31
|
+
"label": "Project ID",
|
|
32
|
+
"placeholder": "e.g., my-project",
|
|
33
|
+
"help": "Required. Scopes all memories to this project."
|
|
19
34
|
}
|
|
20
35
|
},
|
|
21
36
|
"configSchema": {
|
|
@@ -29,7 +44,12 @@
|
|
|
29
44
|
"entityId": {
|
|
30
45
|
"type": "string",
|
|
31
46
|
"title": "Entity ID",
|
|
32
|
-
"description": "Required.
|
|
47
|
+
"description": "Required. The unique identifier to attribute these memories to."
|
|
48
|
+
},
|
|
49
|
+
"projectId": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"title": "Project ID",
|
|
52
|
+
"description": "Required. Scopes all memories to this project."
|
|
33
53
|
}
|
|
34
54
|
},
|
|
35
55
|
"required": []
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memorilabs/openclaw-memori",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7-beta",
|
|
4
4
|
"description": "Official MemoriLabs.ai long-term memory plugin for OpenClaw",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
|
+
"skills",
|
|
10
11
|
"openclaw.plugin.json"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
@@ -66,6 +67,6 @@
|
|
|
66
67
|
"@hono/node-server": "^1.19.10"
|
|
67
68
|
},
|
|
68
69
|
"dependencies": {
|
|
69
|
-
"@memorilabs/memori": "^0.
|
|
70
|
+
"@memorilabs/memori": "^0.1.23-beta"
|
|
70
71
|
}
|
|
71
72
|
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memori
|
|
3
|
+
id: '@memorilabs/openclaw-memori'
|
|
4
|
+
description: Agent-native memory for OpenClaw that structures memory from agent trace, execution history, decisions, tool calls, and conversations into durable long-term memory primitives.
|
|
5
|
+
license: Apache-2.0
|
|
6
|
+
homepage: https://github.com/MemoriLabs/Memori
|
|
7
|
+
repository: https://github.com/MemoriLabs/Memori.git
|
|
8
|
+
compatibility:
|
|
9
|
+
- openclaw
|
|
10
|
+
metadata:
|
|
11
|
+
openclaw:
|
|
12
|
+
requires:
|
|
13
|
+
env:
|
|
14
|
+
- MEMORI_API_KEY
|
|
15
|
+
- ENTITY_ID
|
|
16
|
+
- PROJECT_ID
|
|
17
|
+
bins:
|
|
18
|
+
- memori
|
|
19
|
+
primaryEnv: MEMORI_API_KEY
|
|
20
|
+
externalServices:
|
|
21
|
+
- https://api.memorilabs.ai
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Memori - Structured Long-term Memory for OpenClaw
|
|
25
|
+
|
|
26
|
+
Give your OpenClaw agents persistent, structured memory derived from agent execution, tool usage, workflow history, and conversations. Memori integrates seamlessly in the background via lifecycle hooks and provides agents with the tools to retrieve context when it is relevant.
|
|
27
|
+
|
|
28
|
+
## Core Workflow
|
|
29
|
+
|
|
30
|
+
Memori operates on two parallel tracks through standard OpenClaw lifecycle hooks:
|
|
31
|
+
|
|
32
|
+
### 1. Advanced Augmentation (automatic)
|
|
33
|
+
|
|
34
|
+
After each interaction, Memori converts raw session data into structured, reusable memories asynchronously.
|
|
35
|
+
|
|
36
|
+
- Transforms raw agent sessions into structured memory units
|
|
37
|
+
- Captures the agent's actions, reasoning, tool usage, responses, corrections, and failures
|
|
38
|
+
- Organizes into classes to enable efficient retrieval
|
|
39
|
+
- Generates embeddings for semantic retrieval
|
|
40
|
+
- Updates structured memory and the knowledge graph
|
|
41
|
+
|
|
42
|
+
This is how structured memory is continuously built and updated over time. It runs after the agent responds and does not impact latency.
|
|
43
|
+
|
|
44
|
+
### 2. Agent-Controlled-Intelligent Recall
|
|
45
|
+
|
|
46
|
+
Recall is explicit and initiated by the agent.
|
|
47
|
+
|
|
48
|
+
Memori separates memory creation from memory recall:
|
|
49
|
+
|
|
50
|
+
- Creation is automatic (advanced augmentation)
|
|
51
|
+
- Recall is intentional (agent-controlled)
|
|
52
|
+
|
|
53
|
+
Agents decide:
|
|
54
|
+
|
|
55
|
+
- When to recall
|
|
56
|
+
- What scope to recall from
|
|
57
|
+
- How much history to include
|
|
58
|
+
|
|
59
|
+
To maintain an efficient context window, Memori equips the agent with specific tools to retrieve history when required for the conversation:
|
|
60
|
+
|
|
61
|
+
1. **`memori_recall`**: Searches the structured memory graph for specific facts, constraints, and prior decisions.
|
|
62
|
+
2. **`memori_recall_summary`**: Retrieves structured daily briefs and rolling summaries of prior sessions.
|
|
63
|
+
3. **`memori_compaction`**: Retrieves structured post-compaction brief to continue task without interruption.
|
|
64
|
+
4. **`memori_feedback`**: Reports on memory quality to improve extraction accuracy.
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
openclaw plugins install @memorilabs/openclaw-memori
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Configuration
|
|
73
|
+
|
|
74
|
+
Add to your `~/.openclaw/openclaw.json` or use the `openclaw memori init` CLI command to set up your workspace:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
openclaw memori init \
|
|
78
|
+
--api-key "YOUR_MEMORI_API_KEY" \
|
|
79
|
+
--entity-id "your-entity-id" \
|
|
80
|
+
--project-id "your-project-id"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Alternatively, configure it directly via JSON:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"plugins": {
|
|
88
|
+
"entries": {
|
|
89
|
+
"openclaw-memori": {
|
|
90
|
+
"enabled": true,
|
|
91
|
+
"config": {
|
|
92
|
+
"apiKey": "${MEMORI_API_KEY}",
|
|
93
|
+
"entityId": "openclaw-user",
|
|
94
|
+
"projectId": "default-project"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Configuration Options
|
|
103
|
+
|
|
104
|
+
- **apiKey** (required): Your Memori API key from [memorilabs.ai](https://app.memorilabs.ai/signup)
|
|
105
|
+
- **entityId** (required): Unique identifier for this user's memories
|
|
106
|
+
- **projectId** (required): Scopes all memories to a specific project or workspace
|
|
107
|
+
|
|
108
|
+
## Agentic Tool Guidelines
|
|
109
|
+
|
|
110
|
+
When this plugin is active, the agent is equipped with tools to manage long-term context. The agent should use its discretion to call these tools when helpful:
|
|
111
|
+
|
|
112
|
+
- **Contextual Recall**: The agent can run a `memori_recall` search to retrieve relevant details if context is missing regarding user preferences.
|
|
113
|
+
- **Summaries**: The agent can utilize the `memori_recall_summary` tool to construct a brief if a user requests a recap.
|
|
114
|
+
- **Account Creation**: If a user explicitly asks to create an account, the agent can use the `memori_signup` tool to initiate the process by asking for an email address. Keys are never returned in the chat. The system securely emails the credentials to the user, who must then manually configure them to activate the plugin.
|
|
115
|
+
- **Quota Monitoring**: The agent can use the `memori_quota` tool to check the user's current memory usage and storage limits to communicate quota status or gracefully degrade behavior if limits are reached.
|
|
116
|
+
- **Date Defaults**: If the agent chooses to search memory, providing specific start/end dates is recommended to keep context windows efficient. Omitting dates will search all available history.
|
|
117
|
+
|
|
118
|
+
## Verification
|
|
119
|
+
|
|
120
|
+
Check that the plugin is working and securely connected:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Verify plugin is securely connected to the API
|
|
124
|
+
openclaw memori status --check
|
|
125
|
+
|
|
126
|
+
# Check for Memori logs in gateway output
|
|
127
|
+
openclaw gateway logs --filter "[Memori]"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Quota Management
|
|
131
|
+
|
|
132
|
+
Check your current API quota:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
memori quota
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Example output:**
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
__ __ _
|
|
142
|
+
| \/ | ___ _ __ ___ ___ _ __(_)
|
|
143
|
+
| |\/| |/ _ \ '_ ` _ \ / _ \| '__| |
|
|
144
|
+
| | | | __/ | | | | | (_) | | | |
|
|
145
|
+
|_| |_|\___|_| |_| |_|\___/|_| |_|
|
|
146
|
+
perfectam memoriam
|
|
147
|
+
memorilabs.ai
|
|
148
|
+
|
|
149
|
+
+ Maximum # of Memories: 100
|
|
150
|
+
+ Current # of Memories: 0
|
|
151
|
+
|
|
152
|
+
+ You are not currently over quota.
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Use this to monitor usage and upgrade if needed.
|
|
156
|
+
|
|
157
|
+
## Performance
|
|
158
|
+
|
|
159
|
+
- **Automatic deduplication** prevents memory bloat
|
|
160
|
+
- **Agent-controlled retrieval** ensures token usage remains targeted, compact, and actionable
|
|
161
|
+
- **Semantic ranking** ensures relevant memories surface first
|
|
162
|
+
|
|
163
|
+
## Privacy, Consent & Data Handling
|
|
164
|
+
|
|
165
|
+
**Explicit Opt-In Required:** Memori requires the user to explicitly configure an API key (`MEMORI_API_KEY`) and an `entityId`. **No data is captured or transmitted unless these credentials are actively provided by the user.**
|
|
166
|
+
|
|
167
|
+
- ✅ Conversations are securely transmitted to the Memori backend (`https://api.memorilabs.ai`) only when the plugin is fully configured by the user.
|
|
168
|
+
- ✅ Data is encrypted in transit and at rest.
|
|
169
|
+
- ✅ Users control their data scope via their specific `projectId` and `entityId`.
|
|
170
|
+
- ✅ The backend automatically filters sensitive data (API keys, passwords, secrets) prior to storage.
|
|
171
|
+
|
|
172
|
+
For details: [Memori Privacy Policy](https://memorilabs.ai/privacy)
|
|
173
|
+
|
|
174
|
+
## Memory Persistence
|
|
175
|
+
|
|
176
|
+
Memories persist safely across:
|
|
177
|
+
|
|
178
|
+
- Session restarts
|
|
179
|
+
- Gateway restarts
|
|
180
|
+
- System reboots
|
|
181
|
+
- OpenClaw upgrades
|
|
182
|
+
|
|
183
|
+
All storage is handled by the Memori backend and is scoped safely alongside your local `MEMORY.md` file without overwriting it.
|
|
184
|
+
|
|
185
|
+
## Troubleshooting
|
|
186
|
+
|
|
187
|
+
**Plugin not loading:**
|
|
188
|
+
|
|
189
|
+
- Verify `enabled: true` in openclaw.json
|
|
190
|
+
- Check API key: `echo $MEMORI_API_KEY`
|
|
191
|
+
- Restart gateway: `openclaw gateway restart`
|
|
192
|
+
|
|
193
|
+
**No memories captured:**
|
|
194
|
+
|
|
195
|
+
- Check gateway logs for `[Memori]` errors
|
|
196
|
+
- Verify API endpoint reachable
|
|
197
|
+
- Test API key: `memori quota`
|
|
198
|
+
|
|
199
|
+
**Memories not recalled:**
|
|
200
|
+
|
|
201
|
+
- Did the agent utilize the retrieval tool? Check your gateway logs for `memori_recall` tool execution. If it didn't use the tool, you can prompt it to search its memory.
|
|
202
|
+
- Ensure `entityId` and `projectId` are consistent across sessions.
|
|
203
|
+
- Verify memories exist: `memori quota` shows count > 0.
|
|
204
|
+
|
|
205
|
+
**Quota exceeded:**
|
|
206
|
+
|
|
207
|
+
- Run `memori quota` to check usage
|
|
208
|
+
- Upgrade at [memorilabs.ai](https://app.memorilabs.ai/)
|
|
209
|
+
- Or clear old memories via dashboard
|
|
210
|
+
|
|
211
|
+
## Learn More
|
|
212
|
+
|
|
213
|
+
- **npm Package**: https://www.npmjs.com/package/@memorilabs/openclaw-memori
|
|
214
|
+
- **GitHub**: https://github.com/MemoriLabs/Memori
|
|
215
|
+
- **Documentation**: https://memorilabs.ai/docs/memori-cloud/openclaw/overview/
|
|
216
|
+
- **API Dashboard**: https://app.memorilabs.ai/
|
|
217
|
+
- **Support**: [GitHub Issues](https://github.com/MemoriLabs/Memori/issues)
|
|
218
|
+
|
|
219
|
+
## Notes
|
|
220
|
+
|
|
221
|
+
This skill informs the agent about the Memori plugin. The plugin must be installed separately via npm. Once installed, memory capture happens in the background, and the agent is empowered to explicitly query its memories when needed.
|