@wazionapps/openclaw-memory-nexo-brain 1.0.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 ADDED
@@ -0,0 +1,92 @@
1
+ # @wazionapps/openclaw-memory-nexo-brain
2
+
3
+ Native OpenClaw memory plugin powered by [NEXO Brain](https://github.com/wazionapps/nexo) — a cognitive memory system modeled after human cognition.
4
+
5
+ ## What It Does
6
+
7
+ Replaces OpenClaw's default memory with a full cognitive architecture:
8
+
9
+ - **Atkinson-Shiffrin Memory Model** — Sensory register → Short-term → Long-term, with natural decay
10
+ - **Semantic RAG** — Finds memories by meaning, not keywords (fastembed, 384-dim vectors)
11
+ - **Trust Scoring** — Calibrates verification rigor based on alignment history
12
+ - **Guard System** — Checks past errors before every code change
13
+ - **Cognitive Dissonance** — Detects conflicts between new instructions and established knowledge
14
+ - **Session Continuity** — Resumes from where the last session left off via session diaries
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ # 1. Install NEXO Brain cognitive engine
20
+ npx nexo-brain
21
+
22
+ # 2. Install the OpenClaw plugin
23
+ npm install @wazionapps/openclaw-memory-nexo-brain
24
+ ```
25
+
26
+ ## Configure
27
+
28
+ In `~/.openclaw/openclaw.json`:
29
+
30
+ ```json
31
+ {
32
+ "plugins": {
33
+ "slots": {
34
+ "memory": "memory-nexo-brain"
35
+ },
36
+ "memory-nexo-brain": {
37
+ "nexoHome": "~/.nexo",
38
+ "autoRecall": true,
39
+ "autoCapture": true,
40
+ "guardEnabled": true,
41
+ "trustScoring": true
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ ## Tools Provided
48
+
49
+ | Tool | Description |
50
+ |------|------------|
51
+ | `memory_recall` | Semantic search across all memories |
52
+ | `memory_store` | Store error patterns and lessons learned |
53
+ | `memory_guard` | Check past errors before editing code |
54
+ | `memory_trust` | Update trust score based on user feedback |
55
+ | `memory_dissonance` | Detect conflicts with established knowledge |
56
+ | `memory_sentiment` | Analyze user's emotional state |
57
+ | `memory_diary_write` | Write session summary for continuity |
58
+ | `memory_diary_read` | Read recent diaries to resume context |
59
+ | `memory_startup` | Register a new session |
60
+ | `memory_heartbeat` | Update session task, check inbox |
61
+
62
+ ## CLI Commands
63
+
64
+ ```bash
65
+ openclaw nexo-status # Show cognitive memory statistics
66
+ openclaw nexo-recall "deployment issues" # Semantic search
67
+ ```
68
+
69
+ ## Architecture
70
+
71
+ ```
72
+ OpenClaw Agent
73
+ ↓ (tool calls)
74
+ TypeScript Adapter (this plugin)
75
+ ↓ (JSON-RPC over stdio)
76
+ Python MCP Server (NEXO Brain)
77
+
78
+ SQLite (nexo.db + cognitive.db)
79
+
80
+ fastembed vectors (BAAI/bge-small-en-v1.5, CPU)
81
+ ```
82
+
83
+ ## Requirements
84
+
85
+ - macOS (Linux planned)
86
+ - Python 3 with fastembed
87
+ - OpenClaw >= 2026.3.22
88
+ - Run `npx nexo-brain` first to install the cognitive engine
89
+
90
+ ## License
91
+
92
+ MIT
@@ -0,0 +1,11 @@
1
+ /**
2
+ * NEXO Brain — Native OpenClaw Memory Plugin
3
+ *
4
+ * Replaces OpenClaw's default memory system with NEXO's full cognitive architecture:
5
+ * Atkinson-Shiffrin memory model, semantic RAG, trust scoring, guard system,
6
+ * cognitive dissonance detection, and session continuity.
7
+ *
8
+ * Architecture: TypeScript adapter → MCP Bridge (stdio) → Python NEXO server
9
+ */
10
+ declare const _default: import("openclaw/plugin-sdk/plugin-entry").PluginEntryOptions;
11
+ export default _default;
package/dist/index.js ADDED
@@ -0,0 +1,178 @@
1
+ /**
2
+ * NEXO Brain — Native OpenClaw Memory Plugin
3
+ *
4
+ * Replaces OpenClaw's default memory system with NEXO's full cognitive architecture:
5
+ * Atkinson-Shiffrin memory model, semantic RAG, trust scoring, guard system,
6
+ * cognitive dissonance detection, and session continuity.
7
+ *
8
+ * Architecture: TypeScript adapter → MCP Bridge (stdio) → Python NEXO server
9
+ */
10
+ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
11
+ import { McpBridge } from "./mcp-bridge.js";
12
+ import { COGNITIVE_TOOLS } from "./tools.js";
13
+ let bridge = null;
14
+ let sessionId = null;
15
+ export default definePluginEntry({
16
+ id: "memory-nexo-brain",
17
+ name: "NEXO Brain",
18
+ description: "Cognitive memory system — Atkinson-Shiffrin model, semantic RAG, trust scoring, and metacognitive guard.",
19
+ kind: "memory",
20
+ register(api) {
21
+ const config = api.pluginConfig;
22
+ const nexoHome = api.resolvePath(config.nexoHome || "~/.nexo");
23
+ const pythonPath = config.pythonPath || "python3";
24
+ const autoRecall = config.autoRecall !== false;
25
+ const autoCapture = config.autoCapture !== false;
26
+ const guardEnabled = config.guardEnabled !== false;
27
+ bridge = new McpBridge({ nexoHome, pythonPath });
28
+ // Register the system prompt section that tells the agent about NEXO
29
+ api.registerMemoryPromptSection(({ availableTools }) => {
30
+ const sections = [
31
+ "## Cognitive Memory (NEXO Brain)",
32
+ "",
33
+ "You have access to a persistent cognitive memory system. Key behaviors:",
34
+ "",
35
+ "- **Before editing code**: Call `memory_guard` to check for past errors in the files you're about to modify.",
36
+ "- **After resolving errors**: Call `memory_store` to prevent recurrence.",
37
+ "- **When user feedback is positive/negative**: Call `memory_trust` to calibrate your verification rigor.",
38
+ "- **When instructions conflict with past behavior**: Call `memory_dissonance` to surface the conflict.",
39
+ "- **At session end**: Call `memory_diary_write` to enable continuity for the next session.",
40
+ "",
41
+ "Memory decays naturally over time (Ebbinghaus curves). Frequently accessed memories get stronger.",
42
+ "Semantic search finds memories by meaning, not just keywords.",
43
+ ];
44
+ if (guardEnabled) {
45
+ sections.push("", "**GUARD SYSTEM ACTIVE**: Always check `memory_guard` before code changes. It will surface known pitfalls.");
46
+ }
47
+ return sections;
48
+ });
49
+ // Register all cognitive tools
50
+ for (const tool of COGNITIVE_TOOLS) {
51
+ api.registerTool({
52
+ name: tool.name,
53
+ label: tool.label,
54
+ description: tool.description,
55
+ parameters: tool.parameters,
56
+ async execute(_toolCallId, params) {
57
+ try {
58
+ const result = await bridge.callTool(tool.nexoName, params);
59
+ return {
60
+ content: [{ type: "text", text: result }],
61
+ details: { nexoTool: tool.nexoName },
62
+ };
63
+ }
64
+ catch (err) {
65
+ const message = err instanceof Error ? err.message : String(err);
66
+ return {
67
+ content: [
68
+ {
69
+ type: "text",
70
+ text: `Error calling ${tool.nexoName}: ${message}`,
71
+ },
72
+ ],
73
+ details: { error: true },
74
+ };
75
+ }
76
+ },
77
+ }, { name: tool.name });
78
+ }
79
+ // Lifecycle: auto-recall at session start
80
+ if (autoRecall) {
81
+ api.on("before_agent_start", async (event) => {
82
+ try {
83
+ await bridge.start();
84
+ // Register session
85
+ const startupResult = await bridge.callTool("nexo_startup", {
86
+ task: "OpenClaw session",
87
+ });
88
+ const sidMatch = startupResult.match(/SID:\s*(\S+)/);
89
+ if (sidMatch) {
90
+ sessionId = sidMatch[1];
91
+ }
92
+ // Read recent session diary for context
93
+ const diary = await bridge.callTool("nexo_session_diary_read", {
94
+ last_day: true,
95
+ });
96
+ // Retrieve cognitive context
97
+ const cognitive = await bridge.callTool("nexo_cognitive_retrieve", {
98
+ query: "session context recent work",
99
+ top_k: 5,
100
+ });
101
+ const context = [
102
+ "<nexo-memory-context>",
103
+ diary ? `## Recent Session Context\n${diary}` : "",
104
+ cognitive
105
+ ? `## Relevant Cognitive Memories\n${cognitive}`
106
+ : "",
107
+ "</nexo-memory-context>",
108
+ ]
109
+ .filter(Boolean)
110
+ .join("\n");
111
+ return { prependContext: context };
112
+ }
113
+ catch (err) {
114
+ api.logger.warn(`NEXO auto-recall failed: ${err instanceof Error ? err.message : err}`);
115
+ return {};
116
+ }
117
+ });
118
+ }
119
+ // Lifecycle: auto-capture at session end
120
+ if (autoCapture) {
121
+ api.on("agent_end", async (event) => {
122
+ try {
123
+ if (bridge && sessionId) {
124
+ await bridge.callTool("nexo_session_diary_write", {
125
+ summary: "Auto-captured session via OpenClaw memory-nexo-brain plugin.",
126
+ domain: "openclaw",
127
+ });
128
+ }
129
+ }
130
+ catch {
131
+ // Best-effort — don't block session end
132
+ }
133
+ });
134
+ }
135
+ // CLI commands
136
+ api.registerCli(({ program }) => {
137
+ program
138
+ .command("nexo-status")
139
+ .description("Show NEXO Brain cognitive memory status")
140
+ .action(async () => {
141
+ try {
142
+ await bridge.start();
143
+ const stats = await bridge.callTool("nexo_cognitive_stats", {});
144
+ console.log(stats);
145
+ }
146
+ catch (err) {
147
+ console.error(`Failed to get NEXO status: ${err instanceof Error ? err.message : err}`);
148
+ }
149
+ });
150
+ program
151
+ .command("nexo-recall")
152
+ .description("Search cognitive memory by meaning")
153
+ .argument("<query>", "Semantic search query")
154
+ .action(async (query) => {
155
+ try {
156
+ await bridge.start();
157
+ const result = await bridge.callTool("nexo_cognitive_retrieve", { query, top_k: 10 });
158
+ console.log(result);
159
+ }
160
+ catch (err) {
161
+ console.error(`Failed to recall: ${err instanceof Error ? err.message : err}`);
162
+ }
163
+ });
164
+ }, { commands: ["nexo-status", "nexo-recall"] });
165
+ // Service lifecycle
166
+ api.registerService({
167
+ id: "memory-nexo-brain",
168
+ start: async () => {
169
+ await bridge.start();
170
+ api.logger.info("NEXO Brain cognitive engine started");
171
+ },
172
+ stop: async () => {
173
+ await bridge.stop();
174
+ api.logger.info("NEXO Brain cognitive engine stopped");
175
+ },
176
+ });
177
+ },
178
+ });
@@ -0,0 +1,29 @@
1
+ /**
2
+ * MCP Bridge — Communicates with the NEXO Brain MCP server via stdio JSON-RPC.
3
+ *
4
+ * Spawns the Python MCP server as a child process and sends/receives
5
+ * JSON-RPC 2.0 messages over stdin/stdout.
6
+ */
7
+ export interface NexoConfig {
8
+ nexoHome: string;
9
+ pythonPath: string;
10
+ }
11
+ export declare class McpBridge {
12
+ private process;
13
+ private requestId;
14
+ private pending;
15
+ private buffer;
16
+ private initialized;
17
+ private config;
18
+ constructor(config: NexoConfig);
19
+ start(): Promise<void>;
20
+ stop(): Promise<void>;
21
+ callTool(name: string, args?: Record<string, unknown>): Promise<string>;
22
+ listTools(): Promise<Array<{
23
+ name: string;
24
+ description: string;
25
+ inputSchema: unknown;
26
+ }>>;
27
+ private send;
28
+ private processBuffer;
29
+ }
@@ -0,0 +1,147 @@
1
+ /**
2
+ * MCP Bridge — Communicates with the NEXO Brain MCP server via stdio JSON-RPC.
3
+ *
4
+ * Spawns the Python MCP server as a child process and sends/receives
5
+ * JSON-RPC 2.0 messages over stdin/stdout.
6
+ */
7
+ import { spawn } from "node:child_process";
8
+ import { resolve } from "node:path";
9
+ import { homedir } from "node:os";
10
+ export class McpBridge {
11
+ process = null;
12
+ requestId = 0;
13
+ pending = new Map();
14
+ buffer = "";
15
+ initialized = false;
16
+ config;
17
+ constructor(config) {
18
+ this.config = {
19
+ nexoHome: config.nexoHome.replace("~", homedir()),
20
+ pythonPath: config.pythonPath,
21
+ };
22
+ }
23
+ async start() {
24
+ if (this.process)
25
+ return;
26
+ const serverPath = resolve(this.config.nexoHome, "src", "server.py");
27
+ const nodeProcess = globalThis.process;
28
+ this.process = spawn(this.config.pythonPath, [serverPath], {
29
+ env: {
30
+ ...nodeProcess.env,
31
+ NEXO_HOME: this.config.nexoHome,
32
+ },
33
+ stdio: ["pipe", "pipe", "pipe"],
34
+ });
35
+ this.process.stdout.on("data", (chunk) => {
36
+ this.buffer += chunk.toString();
37
+ this.processBuffer();
38
+ });
39
+ this.process.stderr.on("data", (chunk) => {
40
+ // MCP servers may log to stderr — ignore gracefully
41
+ });
42
+ this.process.on("exit", (code) => {
43
+ this.process = null;
44
+ this.initialized = false;
45
+ for (const [, p] of this.pending) {
46
+ p.reject(new Error(`NEXO MCP server exited with code ${code}`));
47
+ }
48
+ this.pending.clear();
49
+ });
50
+ // Initialize MCP protocol
51
+ await this.send("initialize", {
52
+ protocolVersion: "2024-11-05",
53
+ capabilities: {},
54
+ clientInfo: { name: "openclaw-memory-nexo-brain", version: "1.0.0" },
55
+ });
56
+ await this.send("notifications/initialized", {});
57
+ this.initialized = true;
58
+ }
59
+ async stop() {
60
+ if (this.process) {
61
+ this.process.kill("SIGTERM");
62
+ this.process = null;
63
+ this.initialized = false;
64
+ }
65
+ }
66
+ async callTool(name, args = {}) {
67
+ if (!this.initialized) {
68
+ await this.start();
69
+ }
70
+ const result = await this.send("tools/call", { name, arguments: args });
71
+ if (result?.content) {
72
+ return result.content
73
+ .filter((c) => c.type === "text" && c.text)
74
+ .map((c) => c.text)
75
+ .join("\n");
76
+ }
77
+ return JSON.stringify(result);
78
+ }
79
+ async listTools() {
80
+ if (!this.initialized) {
81
+ await this.start();
82
+ }
83
+ const result = await this.send("tools/list", {});
84
+ return result?.tools ?? [];
85
+ }
86
+ send(method, params) {
87
+ return new Promise((resolvePromise, reject) => {
88
+ if (!this.process?.stdin) {
89
+ reject(new Error("MCP server not running"));
90
+ return;
91
+ }
92
+ const id = ++this.requestId;
93
+ const request = {
94
+ jsonrpc: "2.0",
95
+ id,
96
+ method,
97
+ params,
98
+ };
99
+ this.pending.set(id, { resolve: resolvePromise, reject });
100
+ const message = JSON.stringify(request);
101
+ const header = `Content-Length: ${Buffer.byteLength(message)}\r\n\r\n`;
102
+ this.process.stdin.write(header + message);
103
+ // Timeout after 30s
104
+ setTimeout(() => {
105
+ if (this.pending.has(id)) {
106
+ this.pending.delete(id);
107
+ reject(new Error(`Timeout calling ${method}`));
108
+ }
109
+ }, 30000);
110
+ });
111
+ }
112
+ processBuffer() {
113
+ while (true) {
114
+ const headerEnd = this.buffer.indexOf("\r\n\r\n");
115
+ if (headerEnd === -1)
116
+ break;
117
+ const header = this.buffer.slice(0, headerEnd);
118
+ const match = header.match(/Content-Length:\s*(\d+)/i);
119
+ if (!match) {
120
+ this.buffer = this.buffer.slice(headerEnd + 4);
121
+ continue;
122
+ }
123
+ const contentLength = parseInt(match[1], 10);
124
+ const contentStart = headerEnd + 4;
125
+ if (this.buffer.length < contentStart + contentLength)
126
+ break;
127
+ const content = this.buffer.slice(contentStart, contentStart + contentLength);
128
+ this.buffer = this.buffer.slice(contentStart + contentLength);
129
+ try {
130
+ const response = JSON.parse(content);
131
+ if (response.id != null && this.pending.has(response.id)) {
132
+ const p = this.pending.get(response.id);
133
+ this.pending.delete(response.id);
134
+ if (response.error) {
135
+ p.reject(new Error(response.error.message));
136
+ }
137
+ else {
138
+ p.resolve(response.result);
139
+ }
140
+ }
141
+ }
142
+ catch {
143
+ // Malformed JSON — skip
144
+ }
145
+ }
146
+ }
147
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Tool definitions for the NEXO Brain OpenClaw memory plugin.
3
+ *
4
+ * Exposes cognitive memory tools as native OpenClaw tools via TypeBox schemas.
5
+ */
6
+ import { type TObject } from "@sinclair/typebox";
7
+ interface ToolDef {
8
+ name: string;
9
+ nexoName: string;
10
+ label: string;
11
+ description: string;
12
+ parameters: TObject;
13
+ }
14
+ export declare const COGNITIVE_TOOLS: ToolDef[];
15
+ export declare const ALL_TOOL_NAMES: string[];
16
+ export {};
package/dist/tools.js ADDED
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Tool definitions for the NEXO Brain OpenClaw memory plugin.
3
+ *
4
+ * Exposes cognitive memory tools as native OpenClaw tools via TypeBox schemas.
5
+ */
6
+ import { Type } from "@sinclair/typebox";
7
+ export const COGNITIVE_TOOLS = [
8
+ {
9
+ name: "memory_recall",
10
+ nexoName: "nexo_cognitive_retrieve",
11
+ label: "Recall Memory",
12
+ description: "Semantic search across all memories (STM + LTM). Finds memories by meaning, not keywords. Use this to check context before acting.",
13
+ parameters: Type.Object({
14
+ query: Type.String({ description: "What to search for (semantic)" }),
15
+ top_k: Type.Optional(Type.Integer({ default: 10, description: "Max results" })),
16
+ min_score: Type.Optional(Type.Number({ default: 0.5, description: "Minimum relevance (0-1)" })),
17
+ domain: Type.Optional(Type.String({ description: "Filter by domain (e.g. project name)" })),
18
+ }),
19
+ },
20
+ {
21
+ name: "memory_store",
22
+ nexoName: "nexo_learning_add",
23
+ label: "Store Learning",
24
+ description: "Store an error pattern or lesson learned. Prevents the same mistake from recurring. The guard system checks these before every code change.",
25
+ parameters: Type.Object({
26
+ category: Type.String({
27
+ description: "Area (e.g. wazion, infrastructure, shopify)",
28
+ }),
29
+ error: Type.String({ description: "What went wrong" }),
30
+ solution: Type.String({ description: "How it was fixed" }),
31
+ reasoning: Type.Optional(Type.String({ description: "Why this solution works" })),
32
+ }),
33
+ },
34
+ {
35
+ name: "memory_guard",
36
+ nexoName: "nexo_guard_check",
37
+ label: "Guard Check",
38
+ description: "Check past errors and learnings before editing code. Returns relevant warnings, known issues, and DB schemas for the files/area you're about to modify.",
39
+ parameters: Type.Object({
40
+ files: Type.Optional(Type.String({ description: "Comma-separated file paths to check" })),
41
+ area: Type.Optional(Type.String({ description: "System area (e.g. wazion, shopify)" })),
42
+ }),
43
+ },
44
+ {
45
+ name: "memory_trust",
46
+ nexoName: "nexo_cognitive_trust",
47
+ label: "Update Trust Score",
48
+ description: "Adjust alignment score based on user feedback. Higher trust = fewer redundant checks. Events: explicit_thanks (+3), delegation (+2), correction (-3), repeated_error (-7).",
49
+ parameters: Type.Object({
50
+ event: Type.String({
51
+ description: "Event type: explicit_thanks, delegation, correction, repeated_error, sibling_detected, proactive_action, override, forgot_followup",
52
+ }),
53
+ context: Type.Optional(Type.String({ description: "Brief context for the event" })),
54
+ }),
55
+ },
56
+ {
57
+ name: "memory_dissonance",
58
+ nexoName: "nexo_cognitive_dissonance",
59
+ label: "Check Cognitive Dissonance",
60
+ description: "Detect conflicts between a new instruction and established memories. Use when the user gives an instruction that seems to contradict past behavior.",
61
+ parameters: Type.Object({
62
+ instruction: Type.String({
63
+ description: "The new instruction to check against existing memories",
64
+ }),
65
+ }),
66
+ },
67
+ {
68
+ name: "memory_sentiment",
69
+ nexoName: "nexo_cognitive_sentiment",
70
+ label: "Analyze Sentiment",
71
+ description: "Analyze the user's current tone and emotional state from recent messages. Adapts agent behavior: frustrated → ultra-concise, flow → suggest backlog items.",
72
+ parameters: Type.Object({
73
+ text: Type.String({ description: "Recent user messages to analyze" }),
74
+ }),
75
+ },
76
+ {
77
+ name: "memory_diary_write",
78
+ nexoName: "nexo_session_diary_write",
79
+ label: "Write Session Diary",
80
+ description: "Write a session summary for continuity. The next session reads this to resume context. Include: what was done, decisions made, pending items, mental state.",
81
+ parameters: Type.Object({
82
+ summary: Type.String({ description: "What happened this session" }),
83
+ decisions: Type.Optional(Type.String({ description: "Key decisions and reasoning" })),
84
+ pending: Type.Optional(Type.String({ description: "What's left to do" })),
85
+ mental_state: Type.Optional(Type.String({
86
+ description: "Internal state in first person — thread of thought, observations, momentum",
87
+ })),
88
+ domain: Type.Optional(Type.String({ description: "Project/domain for multi-session context" })),
89
+ }),
90
+ },
91
+ {
92
+ name: "memory_diary_read",
93
+ nexoName: "nexo_session_diary_read",
94
+ label: "Read Session Diary",
95
+ description: "Read recent session diaries for context continuity. Use at session start to resume where the last session left off.",
96
+ parameters: Type.Object({
97
+ last_n: Type.Optional(Type.Integer({ default: 3, description: "Number of diaries to read" })),
98
+ last_day: Type.Optional(Type.Boolean({
99
+ default: false,
100
+ description: "Read all diaries from last active day",
101
+ })),
102
+ domain: Type.Optional(Type.String({ description: "Filter by domain" })),
103
+ }),
104
+ },
105
+ {
106
+ name: "memory_startup",
107
+ nexoName: "nexo_startup",
108
+ label: "Session Startup",
109
+ description: "Register a new session. Call once at the start of every conversation. Returns session ID and active sessions.",
110
+ parameters: Type.Object({
111
+ task: Type.Optional(Type.String({ default: "Startup", description: "Initial task" })),
112
+ }),
113
+ },
114
+ {
115
+ name: "memory_heartbeat",
116
+ nexoName: "nexo_heartbeat",
117
+ label: "Session Heartbeat",
118
+ description: "Update session task and check for messages from other sessions. Call at the start of every user interaction.",
119
+ parameters: Type.Object({
120
+ sid: Type.String({ description: "Session ID from startup" }),
121
+ task: Type.String({ description: "Current task (5-10 words)" }),
122
+ }),
123
+ },
124
+ ];
125
+ export const ALL_TOOL_NAMES = COGNITIVE_TOOLS.map((t) => t.name);
@@ -0,0 +1,70 @@
1
+ {
2
+ "id": "memory-nexo-brain",
3
+ "kind": "memory",
4
+ "configSchema": {
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "nexoHome": {
9
+ "type": "string",
10
+ "default": "~/.nexo",
11
+ "description": "Path to NEXO data directory"
12
+ },
13
+ "pythonPath": {
14
+ "type": "string",
15
+ "default": "python3",
16
+ "description": "Path to Python 3 interpreter"
17
+ },
18
+ "autoRecall": {
19
+ "type": "boolean",
20
+ "default": true,
21
+ "description": "Automatically retrieve relevant memories at session start"
22
+ },
23
+ "autoCapture": {
24
+ "type": "boolean",
25
+ "default": true,
26
+ "description": "Automatically capture session diary at session end"
27
+ },
28
+ "trustScoring": {
29
+ "type": "boolean",
30
+ "default": true,
31
+ "description": "Enable trust score tracking (calibrates verification rigor)"
32
+ },
33
+ "guardEnabled": {
34
+ "type": "boolean",
35
+ "default": true,
36
+ "description": "Enable metacognitive guard (checks past errors before code changes)"
37
+ }
38
+ }
39
+ },
40
+ "uiHints": {
41
+ "nexoHome": {
42
+ "label": "NEXO Home Directory",
43
+ "sensitive": false,
44
+ "placeholder": "~/.nexo",
45
+ "help": "Where NEXO stores its SQLite databases and plugins"
46
+ },
47
+ "pythonPath": {
48
+ "label": "Python Path",
49
+ "sensitive": false,
50
+ "placeholder": "python3",
51
+ "help": "Python 3 interpreter used to run the cognitive engine"
52
+ },
53
+ "autoRecall": {
54
+ "label": "Auto-Recall",
55
+ "help": "Retrieve relevant memories automatically when a session starts"
56
+ },
57
+ "autoCapture": {
58
+ "label": "Auto-Capture",
59
+ "help": "Write session diary automatically when a session ends"
60
+ },
61
+ "trustScoring": {
62
+ "label": "Trust Scoring",
63
+ "help": "Track alignment via trust score — higher score = fewer redundant checks"
64
+ },
65
+ "guardEnabled": {
66
+ "label": "Guard System",
67
+ "help": "Check past errors and learnings before every code change"
68
+ }
69
+ }
70
+ }
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@wazionapps/openclaw-memory-nexo-brain",
3
+ "version": "1.0.0",
4
+ "description": "OpenClaw native memory plugin powered by NEXO Brain — Atkinson-Shiffrin cognitive memory, semantic RAG, trust scoring, and metacognitive guard.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "prepublishOnly": "npm run build"
11
+ },
12
+ "dependencies": {
13
+ "@sinclair/typebox": "^0.34.0"
14
+ },
15
+ "devDependencies": {
16
+ "@types/node": "^25.5.0",
17
+ "typescript": "^5.7.0"
18
+ },
19
+ "peerDependencies": {
20
+ "openclaw": ">=2026.3.22"
21
+ },
22
+ "openclaw": {
23
+ "extensions": [
24
+ "./dist/index.js"
25
+ ],
26
+ "install": {
27
+ "npmSpec": "@wazionapps/openclaw-memory-nexo-brain",
28
+ "defaultChoice": "npm",
29
+ "minHostVersion": ">=2026.3.22"
30
+ },
31
+ "release": {
32
+ "publishToNpm": true
33
+ }
34
+ },
35
+ "keywords": [
36
+ "openclaw",
37
+ "openclaw-plugin",
38
+ "memory",
39
+ "cognitive",
40
+ "nexo",
41
+ "mcp",
42
+ "ai-memory",
43
+ "vector-search"
44
+ ],
45
+ "author": "WAzion <hello@wazion.com>",
46
+ "license": "MIT",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/wazionapps/nexo.git",
50
+ "directory": "openclaw-plugin"
51
+ },
52
+ "homepage": "https://github.com/wazionapps/nexo#openclaw-integration"
53
+ }