nexo-brain 0.1.2 → 0.2.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 CHANGED
@@ -239,6 +239,67 @@ NEXO isn't just engineering — it's applied cognitive psychology:
239
239
  | Synaptic Pruning | Automated cleanup of weak, unused memories |
240
240
  | Associative Memory | Semantic search finds related concepts, not just matching words |
241
241
 
242
+ ## OpenClaw Integration
243
+
244
+ NEXO Brain works as a cognitive memory backend for [OpenClaw](https://github.com/openclaw/openclaw). Three integration paths, from instant to deep:
245
+
246
+ ### Path 1: MCP Bridge (Zero Code — Works Now)
247
+
248
+ Add NEXO Brain to your OpenClaw config at `~/.openclaw/openclaw.json`:
249
+
250
+ ```json
251
+ {
252
+ "mcp": {
253
+ "servers": {
254
+ "nexo-brain": {
255
+ "command": "python3",
256
+ "args": ["~/.nexo/src/server.py"],
257
+ "env": {
258
+ "NEXO_HOME": "~/.nexo"
259
+ }
260
+ }
261
+ }
262
+ }
263
+ }
264
+ ```
265
+
266
+ Or via CLI:
267
+
268
+ ```bash
269
+ openclaw mcp set nexo-brain '{"command":"python3","args":["~/.nexo/src/server.py"],"env":{"NEXO_HOME":"~/.nexo"}}'
270
+ openclaw gateway restart
271
+ ```
272
+
273
+ All 76 NEXO tools become available to your OpenClaw agent immediately.
274
+
275
+ > **First time?** Run `npx nexo-brain` first to install the cognitive engine and dependencies.
276
+
277
+ ### Path 2: ClawHub Skill (Install in Seconds)
278
+
279
+ ```bash
280
+ npx clawhub@latest install nexo-brain
281
+ ```
282
+
283
+ ### Path 3: Native Memory Plugin (Replaces Default Memory)
284
+
285
+ ```bash
286
+ npm install @wazionapps/openclaw-memory-nexo-brain
287
+ ```
288
+
289
+ Configure in `~/.openclaw/openclaw.json`:
290
+
291
+ ```json
292
+ {
293
+ "plugins": {
294
+ "slots": {
295
+ "memory": "memory-nexo-brain"
296
+ }
297
+ }
298
+ }
299
+ ```
300
+
301
+ This replaces OpenClaw's default memory system with NEXO's full cognitive architecture — Atkinson-Shiffrin memory, semantic RAG, trust scoring, guard system, and all 76 tools.
302
+
242
303
  ## Contributing
243
304
 
244
305
  See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. Issues and PRs welcome.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexo-brain",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "mcpName": "io.github.wazionapps/nexo",
5
5
  "description": "NEXO — Cognitive co-operator for Claude Code. Atkinson-Shiffrin memory, semantic RAG, trust scoring, and metacognitive error prevention.",
6
6
  "bin": {
@@ -13,7 +13,9 @@
13
13
  "memory",
14
14
  "ai-assistant",
15
15
  "vector-search",
16
- "atkinson-shiffrin"
16
+ "atkinson-shiffrin",
17
+ "openclaw",
18
+ "openclaw-plugin"
17
19
  ],
18
20
  "author": "Francisco Garcia <hello@wazion.com>",
19
21
  "license": "MIT",
package/src/db.py CHANGED
@@ -10,6 +10,7 @@ import pathlib
10
10
  from pathlib import Path
11
11
 
12
12
  NEXO_HOME = Path(os.environ.get("NEXO_HOME", str(Path.home() / ".nexo")))
13
+ NEXO_HOME.mkdir(parents=True, exist_ok=True)
13
14
 
14
15
  DB_PATH = os.environ.get(
15
16
  "NEXO_TEST_DB",
@@ -20,7 +21,7 @@ DB_PATH = os.environ.get(
20
21
  )
21
22
 
22
23
  # TTLs in seconds
23
- SESSION_STALE_SECONDS = 3600 # 1 hour
24
+ SESSION_STALE_SECONDS = 900 # 15 min (documented TTL)
24
25
  MESSAGE_TTL_SECONDS = 3600 # 1 hour
25
26
  QUESTION_TTL_SECONDS = 600 # 10 min
26
27
 
package/src/server.py CHANGED
@@ -86,6 +86,16 @@ def nexo_heartbeat(sid: str, task: str) -> str:
86
86
  return handle_heartbeat(sid, task)
87
87
 
88
88
 
89
+ @mcp.tool
90
+ def nexo_stop(sid: str) -> str:
91
+ """Cleanly close a session. Removes it from active sessions immediately.
92
+
93
+ Call this when ending a conversation to avoid ghost sessions.
94
+ Args:
95
+ sid: Session ID to close."""
96
+ from tools_sessions import handle_stop
97
+ return handle_stop(sid)
98
+
89
99
  @mcp.tool
90
100
  def nexo_status(keyword: str = "") -> str:
91
101
  """List active sessions. Filter by keyword if provided."""
@@ -149,6 +149,12 @@ def handle_heartbeat(sid: str, task: str, context_hint: str = '') -> str:
149
149
  return "\n".join(parts)
150
150
 
151
151
 
152
+ def handle_stop(sid: str) -> str:
153
+ """Cleanly close a session, removing it from active sessions immediately."""
154
+ complete_session(sid)
155
+ return f"Sesión {sid} cerrada."
156
+
157
+
152
158
  def handle_status(keyword: str | None = None) -> str:
153
159
  """List active sessions, optionally filtered by keyword."""
154
160
  clean_stale_sessions()
@@ -0,0 +1,13 @@
1
+ {
2
+ "mcp": {
3
+ "servers": {
4
+ "nexo-brain": {
5
+ "command": "python3",
6
+ "args": ["~/.nexo/src/server.py"],
7
+ "env": {
8
+ "NEXO_HOME": "~/.nexo"
9
+ }
10
+ }
11
+ }
12
+ }
13
+ }