neuralmemory 1.14.0 → 1.16.1
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 +1 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +174 -18
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +22 -0
- package/openclaw.plugin.json +111 -93
- package/package.json +53 -53
- package/src/index.ts +572 -342
- package/src/types.ts +28 -0
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ Add to `~/.openclaw/openclaw.json`:
|
|
|
54
54
|
|
|
55
55
|
**v1.7.0+**: The plugin dynamically fetches **all tools** from the MCP server at startup. Whatever version of `neural-memory` you have installed, the plugin automatically exposes every tool it provides — no plugin update needed when new tools are added.
|
|
56
56
|
|
|
57
|
-
With `neural-memory>=4.6.0`, this includes **
|
|
57
|
+
With `neural-memory>=4.6.0`, this includes **55 tools**:
|
|
58
58
|
|
|
59
59
|
| Category | Tools |
|
|
60
60
|
|----------|-------|
|
package/dist/index.d.ts
CHANGED
|
@@ -28,14 +28,39 @@
|
|
|
28
28
|
* Registers:
|
|
29
29
|
* N tools — dynamically from MCP server (fallback: 5 core + 2 compat)
|
|
30
30
|
* 1 service — MCP process lifecycle (start/stop)
|
|
31
|
-
*
|
|
31
|
+
* 5 hooks — before_prompt_build (auto-context), agent_end (auto-capture),
|
|
32
|
+
* before_compaction (flush), before_reset (flush),
|
|
33
|
+
* gateway_start (consolidation)
|
|
32
34
|
*/
|
|
33
35
|
import type { OpenClawPluginDefinition } from "./types.js";
|
|
36
|
+
/**
|
|
37
|
+
* Strip metadata preamble from raw prompts before recall.
|
|
38
|
+
*
|
|
39
|
+
* OpenClaw + Telegram injects JSON metadata, NeuralMemory context blocks,
|
|
40
|
+
* env vars, and system boilerplate into ev.prompt. Passing these raw to
|
|
41
|
+
* nmem_recall creates junk neurons like "[concept] json message id".
|
|
42
|
+
*
|
|
43
|
+
* Stripping order matters — later passes clean up residue from earlier ones.
|
|
44
|
+
*/
|
|
45
|
+
export declare function stripPromptMetadata(raw: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Strip NeuralMemory context noise and metadata from auto-capture text.
|
|
48
|
+
*
|
|
49
|
+
* When agent_end forwards assistant messages to nmem_auto, those messages
|
|
50
|
+
* may contain NM context wrappers that were injected by before_prompt_build.
|
|
51
|
+
* Re-ingesting these creates junk neurons like "[concept] json message id".
|
|
52
|
+
*
|
|
53
|
+
* This is defense-in-depth — the Python input_firewall also strips these,
|
|
54
|
+
* but catching them here avoids wasting network round-trips.
|
|
55
|
+
*/
|
|
56
|
+
export declare function sanitizeAutoCapture(raw: string): string;
|
|
34
57
|
type PluginConfig = {
|
|
35
58
|
pythonPath: string;
|
|
36
59
|
brain: string;
|
|
37
60
|
autoContext: boolean;
|
|
38
61
|
autoCapture: boolean;
|
|
62
|
+
autoFlush: boolean;
|
|
63
|
+
autoConsolidate: boolean;
|
|
39
64
|
contextDepth: number;
|
|
40
65
|
maxContextTokens: number;
|
|
41
66
|
timeout: number;
|
package/dist/index.js
CHANGED
|
@@ -28,10 +28,73 @@
|
|
|
28
28
|
* Registers:
|
|
29
29
|
* N tools — dynamically from MCP server (fallback: 5 core + 2 compat)
|
|
30
30
|
* 1 service — MCP process lifecycle (start/stop)
|
|
31
|
-
*
|
|
31
|
+
* 5 hooks — before_prompt_build (auto-context), agent_end (auto-capture),
|
|
32
|
+
* before_compaction (flush), before_reset (flush),
|
|
33
|
+
* gateway_start (consolidation)
|
|
32
34
|
*/
|
|
33
35
|
import { NeuralMemoryMcpClient } from "./mcp-client.js";
|
|
34
36
|
import { createToolsFromMcp, createFallbackTools, createCompatibilityTools } from "./tools.js";
|
|
37
|
+
// ── Prompt metadata stripping ─────────────────────────────
|
|
38
|
+
/**
|
|
39
|
+
* Strip metadata preamble from raw prompts before recall.
|
|
40
|
+
*
|
|
41
|
+
* OpenClaw + Telegram injects JSON metadata, NeuralMemory context blocks,
|
|
42
|
+
* env vars, and system boilerplate into ev.prompt. Passing these raw to
|
|
43
|
+
* nmem_recall creates junk neurons like "[concept] json message id".
|
|
44
|
+
*
|
|
45
|
+
* Stripping order matters — later passes clean up residue from earlier ones.
|
|
46
|
+
*/
|
|
47
|
+
export function stripPromptMetadata(raw) {
|
|
48
|
+
let cleaned = raw;
|
|
49
|
+
// 1. Remove JSON blocks (Telegram metadata, conversation info)
|
|
50
|
+
cleaned = cleaned.replace(/^\{[\s\S]*?"(?:conversation|message_id|sender_id|sender|chat_id|update_id)"[\s\S]*?\}$/gm, "");
|
|
51
|
+
// 2. Remove NeuralMemory context sections (## Relevant Memories, etc.)
|
|
52
|
+
// The |$ ensures sections at end-of-string are also stripped.
|
|
53
|
+
cleaned = cleaned.replace(/^#{1,3}\s*(?:Relevant Memories|Related Information|Relevant Context|Neural Memory)[\s\S]*?(?=\n#{1,3}\s|\n\n(?![-•*\s])|$)/gim, "");
|
|
54
|
+
// 3. Remove neuron-type bullet lines injected by NM context
|
|
55
|
+
cleaned = cleaned.replace(/^-\s*\[(?:concept|entity|decision|error|preference|insight|memory|fact|workflow|instruction|pattern)\].*$/gim, "");
|
|
56
|
+
// 4. Remove [NeuralMemory — ...] wrapper lines
|
|
57
|
+
cleaned = cleaned.replace(/^\[NeuralMemory\s*[—–-].*\]$/gm, "");
|
|
58
|
+
// 5. Remove metadata labels (untrusted metadata lines)
|
|
59
|
+
cleaned = cleaned.replace(/^(?:Conversation info|Sender|Context|System)\s*\(.*?\)\s*:?\s*$/gim, "");
|
|
60
|
+
// 6. Remove env/export lines
|
|
61
|
+
cleaned = cleaned.replace(/^export\s+\w+=.*$/gm, "");
|
|
62
|
+
// 7. Collapse whitespace runs
|
|
63
|
+
cleaned = cleaned.replace(/\n{3,}/g, "\n\n").trim();
|
|
64
|
+
// Fallback: if everything was stripped, use last non-empty line of raw
|
|
65
|
+
if (!cleaned) {
|
|
66
|
+
const lines = raw.split("\n").filter((l) => l.trim());
|
|
67
|
+
cleaned = lines[lines.length - 1]?.trim() ?? raw.trim();
|
|
68
|
+
}
|
|
69
|
+
return cleaned;
|
|
70
|
+
}
|
|
71
|
+
// ── Auto-capture sanitization ─────────────────────────────
|
|
72
|
+
/**
|
|
73
|
+
* Strip NeuralMemory context noise and metadata from auto-capture text.
|
|
74
|
+
*
|
|
75
|
+
* When agent_end forwards assistant messages to nmem_auto, those messages
|
|
76
|
+
* may contain NM context wrappers that were injected by before_prompt_build.
|
|
77
|
+
* Re-ingesting these creates junk neurons like "[concept] json message id".
|
|
78
|
+
*
|
|
79
|
+
* This is defense-in-depth — the Python input_firewall also strips these,
|
|
80
|
+
* but catching them here avoids wasting network round-trips.
|
|
81
|
+
*/
|
|
82
|
+
export function sanitizeAutoCapture(raw) {
|
|
83
|
+
let cleaned = raw;
|
|
84
|
+
// Strip NM context section headers
|
|
85
|
+
cleaned = cleaned.replace(/^#{1,3}\s*(?:Relevant Memories|Related Information|Relevant Context|Neural Memory)\b.*$/gim, "");
|
|
86
|
+
// Strip [NeuralMemory — ...] wrapper lines
|
|
87
|
+
cleaned = cleaned.replace(/^\[NeuralMemory\s*[—–-].*\]$/gm, "");
|
|
88
|
+
// Strip neuron-type bullet lines (- [concept] ..., - [error] ...)
|
|
89
|
+
cleaned = cleaned.replace(/^-\s*\[(?:concept|entity|decision|error|preference|insight|memory|fact|workflow|instruction|pattern)\]\s.*$/gim, "");
|
|
90
|
+
// Strip metadata labels
|
|
91
|
+
cleaned = cleaned.replace(/^(?:Conversation info|Sender|Context)\s*\(.*?\)\s*:?\s*$/gim, "");
|
|
92
|
+
// Strip short acknowledgement lines (< 20 chars, common filler)
|
|
93
|
+
cleaned = cleaned.replace(/^(?:OK|Sure|Done|Got it|Understood|Noted|Alright|I see|Thanks|Thank you|Okay)\.?\s*$/gim, "");
|
|
94
|
+
// Collapse whitespace
|
|
95
|
+
cleaned = cleaned.replace(/\n{3,}/g, "\n\n").trim();
|
|
96
|
+
return cleaned;
|
|
97
|
+
}
|
|
35
98
|
// ── System prompt for tool awareness ──────────────────────
|
|
36
99
|
/**
|
|
37
100
|
* Build a system prompt listing all registered tool names.
|
|
@@ -41,21 +104,43 @@ function buildToolInstructions(tools) {
|
|
|
41
104
|
const toolList = tools
|
|
42
105
|
.map((t) => `- ${t.name}: ${t.description.slice(0, 100)}`)
|
|
43
106
|
.join("\n");
|
|
44
|
-
return `
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
107
|
+
return `Neural Memory gives you persistent memory across sessions. Use it proactively — each session starts fresh, so without explicit saves ALL discoveries are lost.
|
|
108
|
+
|
|
109
|
+
These are TOOL CALLS, not CLI commands. Do NOT run "nmem remember" in terminal.
|
|
110
|
+
|
|
111
|
+
## Available Tools
|
|
112
|
+
${toolList}
|
|
113
|
+
|
|
114
|
+
nmem_* is your primary memory system. memory_search/memory_get are legacy aliases for nmem_recall.
|
|
115
|
+
|
|
116
|
+
## WHEN TO RECALL
|
|
117
|
+
- New session starts → nmem_recall("current project context")
|
|
118
|
+
- User references past event → nmem_recall("<that topic>")
|
|
119
|
+
- Prefix queries with project name for precision
|
|
120
|
+
|
|
121
|
+
## WHEN TO SAVE
|
|
122
|
+
After each task: did you make a decision (type="decision", priority=7), fix a bug (type="error", priority=7), learn a preference (type="preference", priority=8), or discover an insight (type="insight", priority=6)?
|
|
123
|
+
|
|
124
|
+
Save with: nmem_remember(content="Chose X over Y because Z", type="decision", priority=7, tags=["project", "topic"])
|
|
125
|
+
|
|
126
|
+
## CONTENT QUALITY
|
|
127
|
+
- Max 1-3 sentences. Use causal language: "Chose X because Y", "Root cause was X, fixed by Y".
|
|
128
|
+
- Always include project name + topic in tags (lowercase).
|
|
129
|
+
- For temporary scratch notes: nmem_remember(content="...", ephemeral=true) — auto-expires, never synced.
|
|
130
|
+
|
|
131
|
+
## SESSION END
|
|
132
|
+
nmem_auto(action="process", text="<brief session summary>")
|
|
133
|
+
|
|
134
|
+
## COMPACT MODE
|
|
135
|
+
All tools support compact=true (saves 60-80% tokens) and token_budget=N.`;
|
|
53
136
|
}
|
|
54
137
|
const DEFAULT_CONFIG = {
|
|
55
138
|
pythonPath: "python",
|
|
56
139
|
brain: "default",
|
|
57
140
|
autoContext: true,
|
|
58
141
|
autoCapture: true,
|
|
142
|
+
autoFlush: true,
|
|
143
|
+
autoConsolidate: true,
|
|
59
144
|
contextDepth: 1,
|
|
60
145
|
maxContextTokens: 500,
|
|
61
146
|
timeout: 30_000,
|
|
@@ -78,6 +163,12 @@ export function resolveConfig(raw) {
|
|
|
78
163
|
autoCapture: typeof merged.autoCapture === "boolean"
|
|
79
164
|
? merged.autoCapture
|
|
80
165
|
: DEFAULT_CONFIG.autoCapture,
|
|
166
|
+
autoFlush: typeof merged.autoFlush === "boolean"
|
|
167
|
+
? merged.autoFlush
|
|
168
|
+
: DEFAULT_CONFIG.autoFlush,
|
|
169
|
+
autoConsolidate: typeof merged.autoConsolidate === "boolean"
|
|
170
|
+
? merged.autoConsolidate
|
|
171
|
+
: DEFAULT_CONFIG.autoConsolidate,
|
|
81
172
|
contextDepth: typeof merged.contextDepth === "number" &&
|
|
82
173
|
Number.isInteger(merged.contextDepth) &&
|
|
83
174
|
merged.contextDepth >= 0 &&
|
|
@@ -112,7 +203,7 @@ function getOrCreateMcpClient(cfg, logger) {
|
|
|
112
203
|
const key = `${cfg.pythonPath}::${cfg.brain}`;
|
|
113
204
|
const existing = mcpClients.get(key);
|
|
114
205
|
if (existing) {
|
|
115
|
-
logger.
|
|
206
|
+
logger.debug?.(`Reusing existing MCP client for brain "${cfg.brain}"`);
|
|
116
207
|
return existing;
|
|
117
208
|
}
|
|
118
209
|
const mcp = new NeuralMemoryMcpClient({
|
|
@@ -128,9 +219,9 @@ function getOrCreateMcpClient(cfg, logger) {
|
|
|
128
219
|
// ── Plugin definition ──────────────────────────────────────
|
|
129
220
|
const plugin = {
|
|
130
221
|
id: "neuralmemory",
|
|
131
|
-
name: "
|
|
222
|
+
name: "Neural Memory",
|
|
132
223
|
description: "Brain-inspired persistent memory for AI agents — neurons, synapses, and fibers",
|
|
133
|
-
version: "1.
|
|
224
|
+
version: "1.16.0",
|
|
134
225
|
kind: "memory",
|
|
135
226
|
register(api) {
|
|
136
227
|
const cfg = resolveConfig(api.pluginConfig);
|
|
@@ -178,18 +269,22 @@ const plugin = {
|
|
|
178
269
|
api.logger.info("NeuralMemory MCP service stopped");
|
|
179
270
|
},
|
|
180
271
|
});
|
|
181
|
-
// ── Hook: tool awareness + auto-context before
|
|
182
|
-
|
|
272
|
+
// ── Hook: tool awareness + auto-context before prompt build ──
|
|
273
|
+
// Migrated from legacy before_agent_start to before_prompt_build
|
|
274
|
+
// per OpenClaw compatibility guidance (issue #116).
|
|
275
|
+
api.on("before_prompt_build", async (event, _ctx) => {
|
|
183
276
|
const result = {
|
|
184
277
|
systemPrompt: buildToolInstructions(registeredTools),
|
|
185
278
|
};
|
|
186
279
|
if (cfg.autoContext && mcp.connected) {
|
|
187
280
|
const ev = event;
|
|
188
281
|
try {
|
|
282
|
+
const query = stripPromptMetadata(ev.prompt);
|
|
189
283
|
const raw = await mcp.callTool("nmem_recall", {
|
|
190
|
-
query
|
|
284
|
+
query,
|
|
191
285
|
depth: cfg.contextDepth,
|
|
192
286
|
max_tokens: cfg.maxContextTokens,
|
|
287
|
+
clean_for_prompt: true,
|
|
193
288
|
});
|
|
194
289
|
const data = JSON.parse(raw);
|
|
195
290
|
if (data.answer && (data.confidence ?? 0) > 0.1) {
|
|
@@ -212,7 +307,7 @@ const plugin = {
|
|
|
212
307
|
return;
|
|
213
308
|
try {
|
|
214
309
|
const messages = ev.messages?.slice(-5) ?? [];
|
|
215
|
-
const
|
|
310
|
+
const rawText = messages
|
|
216
311
|
.filter((m) => typeof m === "object" &&
|
|
217
312
|
m !== null &&
|
|
218
313
|
m.role === "assistant" &&
|
|
@@ -220,6 +315,8 @@ const plugin = {
|
|
|
220
315
|
.map((m) => m.content)
|
|
221
316
|
.join("\n")
|
|
222
317
|
.slice(0, MAX_AUTO_CAPTURE_CHARS);
|
|
318
|
+
// Strip NM context noise and short acknowledgements before re-ingest
|
|
319
|
+
const text = sanitizeAutoCapture(rawText);
|
|
223
320
|
if (text.length > 50) {
|
|
224
321
|
await mcp.callTool("nmem_auto", {
|
|
225
322
|
action: "process",
|
|
@@ -232,9 +329,68 @@ const plugin = {
|
|
|
232
329
|
}
|
|
233
330
|
}, { priority: 90 });
|
|
234
331
|
}
|
|
332
|
+
// ── Hook: flush memories before context compaction ──
|
|
333
|
+
// Migrated from legacy session:compact:before to before_compaction
|
|
334
|
+
if (cfg.autoFlush) {
|
|
335
|
+
api.on("before_compaction", async (_event, _ctx) => {
|
|
336
|
+
if (!mcp.connected)
|
|
337
|
+
return;
|
|
338
|
+
try {
|
|
339
|
+
await mcp.callTool("nmem_auto", {
|
|
340
|
+
action: "process",
|
|
341
|
+
text: "[pre-compact emergency flush]",
|
|
342
|
+
});
|
|
343
|
+
api.logger.info("Pre-compact flush completed");
|
|
344
|
+
}
|
|
345
|
+
catch (err) {
|
|
346
|
+
api.logger.warn(`Pre-compact flush failed: ${err.message}`);
|
|
347
|
+
}
|
|
348
|
+
}, { priority: 5 });
|
|
349
|
+
// Flush on session boundary (/new and /reset)
|
|
350
|
+
// Migrated from legacy command:new + command:reset to before_reset
|
|
351
|
+
api.on("before_reset", async (_event, _ctx) => {
|
|
352
|
+
if (!mcp.connected)
|
|
353
|
+
return;
|
|
354
|
+
try {
|
|
355
|
+
await mcp.callTool("nmem_auto", {
|
|
356
|
+
action: "process",
|
|
357
|
+
text: "[session boundary — reset]",
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
catch (err) {
|
|
361
|
+
api.logger.warn(`Session boundary flush failed: ${err.message}`);
|
|
362
|
+
}
|
|
363
|
+
}, { priority: 10 });
|
|
364
|
+
}
|
|
365
|
+
// ── Hook: consolidation on gateway start ─────────────
|
|
366
|
+
// Migrated from legacy gateway:startup to gateway_start
|
|
367
|
+
if (cfg.autoConsolidate) {
|
|
368
|
+
api.on("gateway_start", async (_event, _ctx) => {
|
|
369
|
+
if (!mcp.connected) {
|
|
370
|
+
try {
|
|
371
|
+
await mcp.ensureConnected();
|
|
372
|
+
}
|
|
373
|
+
catch (err) {
|
|
374
|
+
api.logger.warn(`MCP connect on startup failed: ${err.message}`);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
try {
|
|
379
|
+
await mcp.callTool("nmem_consolidate", {
|
|
380
|
+
strategy: "enrich",
|
|
381
|
+
compact: true,
|
|
382
|
+
});
|
|
383
|
+
api.logger.info("Startup consolidation completed");
|
|
384
|
+
}
|
|
385
|
+
catch (err) {
|
|
386
|
+
api.logger.warn(`Startup consolidation failed: ${err.message}`);
|
|
387
|
+
}
|
|
388
|
+
}, { priority: 50 });
|
|
389
|
+
}
|
|
235
390
|
// ── Done ────────────────────────────────────────────
|
|
236
391
|
api.logger.info(`NeuralMemory registered (brain: ${cfg.brain}, ` +
|
|
237
|
-
`autoContext: ${cfg.autoContext}, autoCapture: ${cfg.autoCapture}
|
|
392
|
+
`autoContext: ${cfg.autoContext}, autoCapture: ${cfg.autoCapture}, ` +
|
|
393
|
+
`autoFlush: ${cfg.autoFlush}, autoConsolidate: ${cfg.autoConsolidate}) — ` +
|
|
238
394
|
`tools will be loaded dynamically from MCP on service start`);
|
|
239
395
|
},
|
|
240
396
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AASH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAG/F,6DAA6D;AAE7D;;;GAGG;AACH,SAAS,qBAAqB,CAAC,KAAuB;IACpD,MA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J,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -30,6 +30,15 @@ export type BeforeAgentStartResult = {
|
|
|
30
30
|
modelOverride?: string;
|
|
31
31
|
providerOverride?: string;
|
|
32
32
|
};
|
|
33
|
+
export type BeforePromptBuildEvent = {
|
|
34
|
+
prompt: string;
|
|
35
|
+
messages?: unknown[];
|
|
36
|
+
systemPrompt?: string;
|
|
37
|
+
};
|
|
38
|
+
export type BeforePromptBuildResult = {
|
|
39
|
+
systemPrompt?: string;
|
|
40
|
+
prependContext?: string;
|
|
41
|
+
};
|
|
33
42
|
export type AgentEndEvent = {
|
|
34
43
|
messages: unknown[];
|
|
35
44
|
success: boolean;
|
|
@@ -41,6 +50,19 @@ export type AgentContext = {
|
|
|
41
50
|
sessionKey?: string;
|
|
42
51
|
workspaceDir?: string;
|
|
43
52
|
};
|
|
53
|
+
export type SessionCompactEvent = {
|
|
54
|
+
reason?: string;
|
|
55
|
+
messagesBeforeCompact?: number;
|
|
56
|
+
};
|
|
57
|
+
export type CommandEvent = {
|
|
58
|
+
command: string;
|
|
59
|
+
sessionKey?: string;
|
|
60
|
+
workspaceDir?: string;
|
|
61
|
+
};
|
|
62
|
+
export type GatewayStartupEvent = {
|
|
63
|
+
version?: string;
|
|
64
|
+
workspaceDir?: string;
|
|
65
|
+
};
|
|
44
66
|
export type OpenClawPluginApi = {
|
|
45
67
|
id: string;
|
|
46
68
|
name: string;
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,93 +1,111 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "neuralmemory",
|
|
3
|
-
"kind": "memory",
|
|
4
|
-
"name": "
|
|
5
|
-
"description": "Brain-inspired persistent memory for AI agents — neurons, synapses, and fibers. REQUIRED: set plugins.slots.memory = \"neuralmemory\" in openclaw.json to disable the default memory-core plugin and activate NeuralMemory as the exclusive memory provider.",
|
|
6
|
-
"version": "1.
|
|
7
|
-
"configSchema": {
|
|
8
|
-
"jsonSchema": {
|
|
9
|
-
"type": "object",
|
|
10
|
-
"additionalProperties": false,
|
|
11
|
-
"properties": {
|
|
12
|
-
"pythonPath": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"description": "Path to Python executable with neural-memory installed",
|
|
15
|
-
"default": "python"
|
|
16
|
-
},
|
|
17
|
-
"brain": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"pattern": "^[a-zA-Z0-9_\\-.]{1,64}$",
|
|
20
|
-
"description": "Brain name to use for this workspace",
|
|
21
|
-
"default": "default"
|
|
22
|
-
},
|
|
23
|
-
"autoContext": {
|
|
24
|
-
"type": "boolean",
|
|
25
|
-
"description": "Inject relevant memory context before each agent run",
|
|
26
|
-
"default": true
|
|
27
|
-
},
|
|
28
|
-
"autoCapture": {
|
|
29
|
-
"type": "boolean",
|
|
30
|
-
"description": "Auto-extract and store memories after each agent run",
|
|
31
|
-
"default": true
|
|
32
|
-
},
|
|
33
|
-
"
|
|
34
|
-
"type": "
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"help": "
|
|
70
|
-
},
|
|
71
|
-
"
|
|
72
|
-
"label": "
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
1
|
+
{
|
|
2
|
+
"id": "neuralmemory",
|
|
3
|
+
"kind": "memory",
|
|
4
|
+
"name": "Neural Memory",
|
|
5
|
+
"description": "Brain-inspired persistent memory for AI agents — neurons, synapses, and fibers. REQUIRED: set plugins.slots.memory = \"neuralmemory\" in openclaw.json to disable the default memory-core plugin and activate NeuralMemory as the exclusive memory provider.",
|
|
6
|
+
"version": "1.16.0",
|
|
7
|
+
"configSchema": {
|
|
8
|
+
"jsonSchema": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"properties": {
|
|
12
|
+
"pythonPath": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Path to Python executable with neural-memory installed",
|
|
15
|
+
"default": "python"
|
|
16
|
+
},
|
|
17
|
+
"brain": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"pattern": "^[a-zA-Z0-9_\\-.]{1,64}$",
|
|
20
|
+
"description": "Brain name to use for this workspace",
|
|
21
|
+
"default": "default"
|
|
22
|
+
},
|
|
23
|
+
"autoContext": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"description": "Inject relevant memory context before each agent run",
|
|
26
|
+
"default": true
|
|
27
|
+
},
|
|
28
|
+
"autoCapture": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Auto-extract and store memories after each agent run",
|
|
31
|
+
"default": true
|
|
32
|
+
},
|
|
33
|
+
"autoFlush": {
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"description": "Flush memories before context compaction and on session boundaries (new/reset)",
|
|
36
|
+
"default": true
|
|
37
|
+
},
|
|
38
|
+
"autoConsolidate": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"description": "Run consolidation on gateway startup to enrich and merge memories",
|
|
41
|
+
"default": true
|
|
42
|
+
},
|
|
43
|
+
"contextDepth": {
|
|
44
|
+
"type": "integer",
|
|
45
|
+
"minimum": 0,
|
|
46
|
+
"maximum": 3,
|
|
47
|
+
"description": "Recall depth for auto-context: 0=instant, 1=context, 2=habit, 3=deep",
|
|
48
|
+
"default": 1
|
|
49
|
+
},
|
|
50
|
+
"maxContextTokens": {
|
|
51
|
+
"type": "integer",
|
|
52
|
+
"minimum": 100,
|
|
53
|
+
"maximum": 10000,
|
|
54
|
+
"description": "Maximum tokens for auto-context injection",
|
|
55
|
+
"default": 500
|
|
56
|
+
},
|
|
57
|
+
"timeout": {
|
|
58
|
+
"type": "integer",
|
|
59
|
+
"minimum": 5000,
|
|
60
|
+
"maximum": 120000,
|
|
61
|
+
"description": "MCP request timeout in milliseconds",
|
|
62
|
+
"default": 30000
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"uiHints": {
|
|
67
|
+
"_setup": {
|
|
68
|
+
"label": "Required Setup",
|
|
69
|
+
"help": "Add to openclaw.json: { \"plugins\": { \"slots\": { \"memory\": \"neuralmemory\" } } } — this disables the default memory-core plugin so agents use NeuralMemory exclusively. Without this, agents may still call memory_search (memory-core) even with AGENTS.MD rules."
|
|
70
|
+
},
|
|
71
|
+
"pythonPath": {
|
|
72
|
+
"label": "Python Path",
|
|
73
|
+
"placeholder": "python",
|
|
74
|
+
"help": "Path to Python executable that has neural-memory installed (pip install neural-memory)"
|
|
75
|
+
},
|
|
76
|
+
"brain": {
|
|
77
|
+
"label": "Brain Name",
|
|
78
|
+
"placeholder": "default",
|
|
79
|
+
"help": "Which brain to use — each workspace can have its own brain"
|
|
80
|
+
},
|
|
81
|
+
"autoContext": {
|
|
82
|
+
"label": "Auto-inject Context",
|
|
83
|
+
"help": "Automatically query relevant memories and inject them before each agent run"
|
|
84
|
+
},
|
|
85
|
+
"autoCapture": {
|
|
86
|
+
"label": "Auto-capture Memories",
|
|
87
|
+
"help": "Automatically extract facts, decisions, and insights after each agent run"
|
|
88
|
+
},
|
|
89
|
+
"autoFlush": {
|
|
90
|
+
"label": "Auto-flush on Compact/Reset",
|
|
91
|
+
"help": "Flush unsaved memories before context compaction and when starting a new session"
|
|
92
|
+
},
|
|
93
|
+
"autoConsolidate": {
|
|
94
|
+
"label": "Auto-consolidate on Startup",
|
|
95
|
+
"help": "Run memory consolidation (enrich strategy) when the OpenClaw gateway starts"
|
|
96
|
+
},
|
|
97
|
+
"contextDepth": {
|
|
98
|
+
"label": "Context Depth",
|
|
99
|
+
"help": "How deep to search: 0=instant lookup, 1=contextual, 2=habit patterns, 3=full graph traversal"
|
|
100
|
+
},
|
|
101
|
+
"maxContextTokens": {
|
|
102
|
+
"label": "Max Context Tokens",
|
|
103
|
+
"help": "Maximum tokens to inject as context (higher = more context but uses more prompt space)"
|
|
104
|
+
},
|
|
105
|
+
"timeout": {
|
|
106
|
+
"label": "MCP Timeout (ms)",
|
|
107
|
+
"help": "How long to wait for MCP server responses. Increase if you see timeout errors on slow machines (default: 30000)"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|