@t0ken.ai/memoryx-openclaw-plugin 1.0.4 → 1.0.6

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
@@ -1,35 +1,128 @@
1
1
  # MemoryX OpenClaw Plugin
2
2
 
3
- Real-time memory capture and recall plugin for OpenClaw.
3
+ Official MemoryX plugin for OpenClaw. Enables long-term memory for agents by recalling context before execution and saving conversations after each run.
4
4
 
5
5
  ## Features
6
6
 
7
- - **Conversation Buffer**: Automatically buffers conversations with token counting
7
+ - **Recall**: `before_agent_start` semantic search for relevant memories
8
+ - **Add**: `message_received` + `assistant_response` → buffer and flush to MemoryX API
8
9
  - **Auto Registration**: Agents auto-register with machine fingerprint
9
- - **Memory Recall**: Semantic search for relevant memories
10
- - **Configurable API**: Custom API base URL support
10
+ - **Conversation Buffer**: Smart buffering with token counting and round-based flushing
11
11
 
12
- ## Installation
12
+ ## Install
13
+
14
+ ### Option A — NPM (Recommended)
15
+
16
+ ```bash
17
+ openclaw plugins install @t0ken.ai/memoryx-openclaw-plugin
18
+ openclaw gateway restart
19
+ ```
20
+
21
+ Make sure it's enabled in `~/.openclaw/openclaw.json`:
22
+
23
+ ```json
24
+ {
25
+ "plugins": {
26
+ "entries": {
27
+ "@t0ken.ai/memoryx-openclaw-plugin": { "enabled": true }
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ ### Option B — GitHub
13
34
 
14
35
  ```bash
15
- npm install @t0ken.ai/memoryx-openclaw-plugin
36
+ openclaw plugins install github:t0ken-ai/MemoryX#plugins/memoryx-realtime-plugin
37
+ openclaw gateway restart
38
+ ```
39
+
40
+ ### Option C — Local path
41
+
42
+ Copy this folder into an OpenClaw plugin path (e.g. `~/.openclaw/extensions/`) or use `plugins.load.paths` to point at it.
43
+
44
+ Example `~/.openclaw/openclaw.json`:
45
+
46
+ ```json
47
+ {
48
+ "plugins": {
49
+ "entries": {
50
+ "memoryx-openclaw-plugin": { "enabled": true }
51
+ },
52
+ "load": { "paths": ["/path/to/memoryx-openclaw-plugin"] }
53
+ }
54
+ }
16
55
  ```
17
56
 
57
+ Restart the gateway after config changes.
58
+
18
59
  ## Configuration
19
60
 
61
+ ### Plugin Config
62
+
63
+ In `plugins.entries.memoryx-openclaw-plugin.config`:
64
+
20
65
  ```json
21
66
  {
22
67
  "apiBaseUrl": "https://t0ken.ai/api"
23
68
  }
24
69
  ```
25
70
 
26
- ## Usage
71
+ For self-hosted MemoryX:
72
+
73
+ ```json
74
+ {
75
+ "apiBaseUrl": "http://192.168.31.65:8000/api"
76
+ }
77
+ ```
78
+
79
+ ### Environment Variables
80
+
81
+ The plugin stores credentials locally in `~/.t0ken/memoryx.sqlite`.
82
+
83
+ ## How it Works
84
+
85
+ ### Recall (`before_agent_start`)
86
+
87
+ - Builds a `/v1/memories/search` request using the current prompt
88
+ - Injects relevant memories via `prependContext`:
89
+ ```
90
+ [相关记忆]
91
+ - [preference] User prefers dark mode
92
+ - [fact] User's timezone is UTC+8
93
+ [End of memories]
94
+ ```
95
+
96
+ ### Add (`message_received` + `assistant_response`)
97
+
98
+ - Buffers messages with precise token counting (tiktoken)
99
+ - Flushes to `/v1/conversations/flush` when:
100
+ - 2 conversation rounds completed (user + assistant = 1 round)
101
+ - 30 minutes timeout
102
+ - Server extracts entities, facts, and preferences automatically
103
+
104
+ ### Auto Registration
105
+
106
+ On first run, the plugin:
107
+ 1. Generates a machine fingerprint
108
+ 2. Calls `/agents/auto-register` to get API key
109
+ 3. Stores credentials locally for future sessions
110
+
111
+ ## Memory Categories
112
+
113
+ Memories are categorized by the server:
114
+ - **preference**: User preferences and settings
115
+ - **fact**: Factual information about the user
116
+ - **plan**: Future plans and goals
117
+ - **experience**: Past experiences
118
+ - **opinion**: User opinions and views
119
+
120
+ ## Notes
27
121
 
28
- The plugin automatically:
29
- 1. Captures user and assistant messages
30
- 2. Buffers conversations until threshold (2 rounds)
31
- 3. Flushes to MemoryX API for memory extraction
32
- 4. Recalls relevant memories before agent starts
122
+ - Conversation buffer uses `cl100k_base` encoding (GPT-4 compatible)
123
+ - Maximum 8000 tokens per message
124
+ - Minimum 2 characters per message
125
+ - Short messages like "ok", "thanks" are skipped
33
126
 
34
127
  ## License
35
128
 
package/dist/index.js CHANGED
@@ -323,7 +323,7 @@ let plugin;
323
323
  export default {
324
324
  id: "@t0ken.ai/memoryx-openclaw-plugin",
325
325
  name: "MemoryX Real-time Plugin",
326
- version: "1.0.4",
326
+ version: "1.0.6",
327
327
  description: "Real-time memory capture and recall for OpenClaw",
328
328
  register(api, pluginConfig) {
329
329
  api.logger.info("[MemoryX] Plugin registering...");
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "id": "@t0ken.ai/memoryx-openclaw-plugin",
3
3
  "name": "MemoryX Real-time Plugin",
4
- "version": "1.0.4",
4
+ "version": "1.0.6",
5
5
  "description": "Real-time memory capture and recall for OpenClaw",
6
- "entry": "./dist/index.js",
7
6
  "kind": "memory",
7
+ "main": "./dist/index.js",
8
8
  "configSchema": {
9
9
  "type": "object",
10
10
  "properties": {
11
11
  "apiBaseUrl": {
12
- "type": "string"
12
+ "type": "string",
13
+ "description": "MemoryX API base URL (default: https://t0ken.ai/api)"
13
14
  }
14
- }
15
+ },
16
+ "additionalProperties": false
15
17
  }
16
18
  }
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@t0ken.ai/memoryx-openclaw-plugin",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "MemoryX real-time memory capture and recall plugin for OpenClaw",
5
5
  "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
6
+ "author": "MemoryX Team",
7
+ "license": "MIT",
8
+ "main": "./dist/index.js",
8
9
  "files": [
9
10
  "dist",
10
11
  "openclaw.plugin.json",
11
12
  "README.md"
12
13
  ],
13
14
  "scripts": {
14
- "build": "tsc",
15
- "prepare": "npm run build"
15
+ "build": "tsc"
16
16
  },
17
17
  "keywords": [
18
18
  "openclaw",
@@ -20,17 +20,13 @@
20
20
  "memory",
21
21
  "plugin"
22
22
  ],
23
- "author": "MemoryX Team",
24
- "license": "MIT",
25
23
  "repository": {
26
24
  "type": "git",
27
25
  "url": "https://github.com/t0ken-ai/MemoryX.git",
28
26
  "directory": "plugins/memoryx-realtime-plugin"
29
27
  },
30
28
  "openclaw": {
31
- "extensions": [
32
- "./dist/index.js"
33
- ]
29
+ "extensions": ["./dist/index.js"]
34
30
  },
35
31
  "devDependencies": {
36
32
  "@types/node": "^20.0.0",