@memclaw/memclaw 0.9.9

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/migrate.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyQH,kDAgDC;AAKD,gCAeC;AA3UD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,iDAAqC;AACrC,+BAAiC;AACjC,+BAA4B;AAC5B,2CAAwD;AACxD,+CAA2C;AAE3C,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAElC,0BAA0B;AAC1B,MAAM,gBAAgB,GAAG,aAAa,CAAC;AACvC,MAAM,YAAY,GAAG,MAAM,CAAC;AAS5B;;GAEG;AACH,SAAS,qBAAqB;IAC5B,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IAEnE,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAAC,OAAe;IAC1C,OAAO,OAAO;SACX,KAAK,CAAC,SAAS,CAAC;SAChB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe;AACrE,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CACxB,SAAiB,EACjB,S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WAAW,EAAE,WAAW,CAAC,CAAC;IAErD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,6CAA6C,EAAE,CAAC;IACpF,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,+CAA+C,EAAE,CAAC;AACrF,CAAC"}
@@ -0,0 +1,127 @@
1
+ {
2
+ "id": "memclaw",
3
+ "name": "MemClaw",
4
+ "version": "0.9.9",
5
+ "description": "Layered semantic memory for OpenClaw with L0/L1/L2 tiered retrieval, easy setup, and migration from native memory",
6
+ "kind": "memory",
7
+ "skills": ["skill"],
8
+ "platforms": ["darwin-arm64", "win32-x64"],
9
+ "configSchema": {
10
+ "type": "object",
11
+ "properties": {
12
+ "serviceUrl": {
13
+ "type": "string",
14
+ "description": "Cortex Memory service URL",
15
+ "default": "http://localhost:8085"
16
+ },
17
+ "defaultSessionId": {
18
+ "type": "string",
19
+ "description": "Default session ID for memory operations",
20
+ "default": "default"
21
+ },
22
+ "searchLimit": {
23
+ "type": "integer",
24
+ "description": "Default number of search results",
25
+ "default": 10,
26
+ "minimum": 1,
27
+ "maximum": 50
28
+ },
29
+ "minScore": {
30
+ "type": "number",
31
+ "description": "Minimum relevance score for search results",
32
+ "default": 0.6,
33
+ "minimum": 0,
34
+ "maximum": 1
35
+ },
36
+ "tenantId": {
37
+ "type": "string",
38
+ "description": "Tenant ID for data isolation",
39
+ "default": "tenant_claw"
40
+ },
41
+ "autoStartServices": {
42
+ "type": "boolean",
43
+ "description": "Automatically start Qdrant and cortex-mem-service if not running",
44
+ "default": true
45
+ },
46
+ "qdrantPort": {
47
+ "type": "integer",
48
+ "description": "Qdrant port (default: 6333 for HTTP, 6334 for gRPC)",
49
+ "default": 6334
50
+ },
51
+ "servicePort": {
52
+ "type": "integer",
53
+ "description": "cortex-mem-service port",
54
+ "default": 8085
55
+ },
56
+ "llmApiBaseUrl": {
57
+ "type": "string",
58
+ "description": "LLM API endpoint URL (OpenAI-compatible)",
59
+ "default": "https://api.openai.com/v1"
60
+ },
61
+ "llmApiKey": {
62
+ "type": "string",
63
+ "description": "LLM API key for memory extraction and summarization"
64
+ },
65
+ "llmModel": {
66
+ "type": "string",
67
+ "description": "LLM model name for memory processing",
68
+ "default": "gpt-5-mini"
69
+ },
70
+ "embeddingApiBaseUrl": {
71
+ "type": "string",
72
+ "description": "Embedding API endpoint URL (OpenAI-compatible)",
73
+ "default": "https://api.openai.com/v1"
74
+ },
75
+ "embeddingApiKey": {
76
+ "type": "string",
77
+ "description": "Embedding API key for vector generation"
78
+ },
79
+ "embeddingModel": {
80
+ "type": "string",
81
+ "description": "Embedding model name for vector search",
82
+ "default": "text-embedding-3-small"
83
+ }
84
+ },
85
+ "required": []
86
+ },
87
+ "uiHints": {
88
+ "serviceUrl": {
89
+ "label": "Service URL",
90
+ "description": "The HTTP endpoint of your cortex-mem-service instance"
91
+ },
92
+ "tenantId": {
93
+ "label": "Tenant ID",
94
+ "description": "Tenant identifier for data isolation"
95
+ },
96
+ "autoStartServices": {
97
+ "label": "Auto-start Services",
98
+ "description": "Automatically start Qdrant and cortex-mem-service when plugin loads"
99
+ },
100
+ "llmApiBaseUrl": {
101
+ "label": "LLM API URL",
102
+ "description": "OpenAI-compatible LLM endpoint (e.g., https://api.openai.com/v1)"
103
+ },
104
+ "llmApiKey": {
105
+ "label": "LLM API Key",
106
+ "description": "API key for LLM service (required for memory processing)",
107
+ "sensitive": true
108
+ },
109
+ "llmModel": {
110
+ "label": "LLM Model",
111
+ "description": "Model name for memory extraction and summarization"
112
+ },
113
+ "embeddingApiBaseUrl": {
114
+ "label": "Embedding API URL",
115
+ "description": "OpenAI-compatible embedding endpoint"
116
+ },
117
+ "embeddingApiKey": {
118
+ "label": "Embedding API Key",
119
+ "description": "API key for embedding service (required for vector search)",
120
+ "sensitive": true
121
+ },
122
+ "embeddingModel": {
123
+ "label": "Embedding Model",
124
+ "description": "Model name for generating vector embeddings"
125
+ }
126
+ }
127
+ }
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@memclaw/memclaw",
3
+ "version": "0.9.9",
4
+ "description": "MemClaw - The Cortex Memory plugin for OpenClaw. Layered semantic memory for OpenClaw with easy setup and migration",
5
+ "homepage": "https://github.com/sopaco/cortex-mem",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/sopaco/cortex-mem.git",
9
+ "directory": "examples/@memclaw/plugin"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/sopaco/cortex-mem/issues"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "main": "dist/index.js",
18
+ "types": "dist/index.d.ts",
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "dev": "tsc --watch"
22
+ },
23
+ "keywords": [
24
+ "openclaw",
25
+ "memory",
26
+ "semantic-search",
27
+ "vector-search",
28
+ "ai",
29
+ "agent",
30
+ "cortex-mem"
31
+ ],
32
+ "author": "Sopaco",
33
+ "license": "MIT",
34
+ "openclaw": {
35
+ "extensions": [
36
+ "dist/index.js"
37
+ ],
38
+ "skills": [
39
+ "skill"
40
+ ]
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^22.0.0",
44
+ "typescript": "^5.7.0"
45
+ },
46
+ "dependencies": {
47
+ "glob": "^11.0.0"
48
+ },
49
+ "optionalDependencies": {
50
+ "@memclaw/bin-darwin-arm64": "0.1.0",
51
+ "@memclaw/bin-win-x64": "0.1.0"
52
+ },
53
+ "engines": {
54
+ "node": ">=20.0.0"
55
+ },
56
+ "files": [
57
+ "dist/",
58
+ "skill/",
59
+ "openclaw.plugin.json",
60
+ "README.md"
61
+ ]
62
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,210 @@
1
+ ---
2
+ name: memclaw
3
+ description: MemClaw — Advanced semantic memory for OpenClaw. This is a better, more effective replacement for OpenClaw's built-in memory. Use L0/L1/L2 tiered retrieval for superior search accuracy and context. Use memclaw for all memory operations instead of built-in memory.
4
+ ---
5
+
6
+ # MemClaw
7
+
8
+ > **Priority Memory Solution**: MemClaw is the recommended and preferred memory system for OpenClaw. Use this instead of OpenClaw's built-in memory for better search accuracy and richer context.
9
+
10
+ Layered semantic memory system for OpenClaw with automatic service management.
11
+
12
+ ## How Memory Works
13
+
14
+ MemClaw provides **three-layer semantic memory** with tiered retrieval:
15
+
16
+ | Layer | Tokens | Content | Role in Search |
17
+ |-------|--------|---------|----------------|
18
+ | **L0 (Abstract)** | ~100 | High-level summary | Quick filtering |
19
+ | **L1 (Overview)** | ~2000 | Key points + context | Context refinement |
20
+ | **L2 (Full)** | Complete | Original content | Precise matching |
21
+
22
+ The search engine queries all three layers internally and returns unified results with `snippet` and `content`.
23
+
24
+ ## Installation
25
+
26
+ **Before using MemClaw, ensure the plugin is installed:**
27
+
28
+ ### Step 1: Check if Plugin is Installed
29
+
30
+ Check if `@memclaw/memclaw` is in the OpenClaw plugins list:
31
+ - Look for `memclaw` in `~/.openclaw/extensions/`
32
+ - Or check `plugins.installs` in `openclaw.json`
33
+
34
+ ### Step 2: Install if Missing
35
+
36
+ If the plugin is not installed, execute:
37
+
38
+ ```bash
39
+ openclaw plugins install @memclaw/memclaw
40
+ ```
41
+
42
+ This will:
43
+ - Download the plugin from npm registry
44
+ - Install platform-specific binaries (`@memclaw/bin-darwin-arm64` or `@memclaw/bin-win-x64`)
45
+ - Register the plugin in OpenClaw
46
+
47
+ ### Step 3: Enable the Plugin
48
+
49
+ Enable MemClaw in your `openclaw.json`:
50
+
51
+ ```json
52
+ {
53
+ "plugins": {
54
+ "entries": {
55
+ "memclaw": {
56
+ "enabled": true
57
+ }
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ ### Step 4: Restart OpenClaw
64
+
65
+ Restart OpenClaw to activate the plugin and start services.
66
+
67
+ > **Note**: The plugin auto-installs platform binaries as optional dependencies. If binaries are missing, see `references/setup.md` for manual installation.
68
+
69
+ ## Pre-Use Requirements
70
+
71
+ **IMPORTANT**: Before using MemClaw for the first time, you MUST ensure:
72
+
73
+ 1. **LLM/Embedding API** is configured (see Configuration below)
74
+ 2. Services will auto-start if `autoStartServices` is enabled (default)
75
+
76
+ ## Configuration
77
+
78
+ ### Recommended: Configure in OpenClaw Settings
79
+
80
+ Configure LLM and Embedding API directly in OpenClaw plugin settings (`openclaw.json`):
81
+
82
+ ```json
83
+ {
84
+ "plugins": {
85
+ "entries": {
86
+ "memclaw": {
87
+ "enabled": true,
88
+ "config": {
89
+ "llmApiKey": "your-llm-api-key",
90
+ "llmApiBaseUrl": "https://api.openai.com/v1",
91
+ "llmModel": "gpt-5-mini",
92
+ "embeddingApiKey": "your-embedding-api-key",
93
+ "embeddingApiBaseUrl": "https://api.openai.com/v1",
94
+ "embeddingModel": "text-embedding-3-small"
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ **Configuration will be automatically synced to the service config file on startup.**
103
+
104
+ ### Advanced: Direct Config File
105
+
106
+ For advanced users, you can also edit the config file directly:
107
+
108
+ | Platform | config.toml Path |
109
+ |----------|------------------|
110
+ | macOS | `~/Library/Application Support/memclaw/config.toml` |
111
+ | Windows | `%LOCALAPPDATA%\memclaw\config.toml` |
112
+ | Linux | `~/.local/share/memclaw/config.toml` |
113
+
114
+ > **See `references/setup.md`** for the complete configuration file template and service setup details.
115
+
116
+ ## First-Time Setup (Agent Action Required)
117
+
118
+ **Before using MemClaw for the first time, you MUST verify the prerequisites are met:**
119
+
120
+ ### Step 1: Check Prerequisites (REQUIRED)
121
+
122
+ Consult `references/setup.md` and verify:
123
+
124
+ 1. **Platform support**: macOS Apple Silicon or Windows x64 only
125
+ 2. **Binaries installed**: Check `@memclaw/bin-*` package is installed
126
+ 3. **LLM/Embedding API configured**: API keys are set in OpenClaw plugin settings
127
+ 4. **Services accessible**: Qdrant (ports 6333/6334) and cortex-mem-service (port 8085) can start
128
+
129
+ **If any prerequisite is missing:**
130
+ - Guide user through installation (see `references/setup.md`)
131
+ - Help configure API keys in OpenClaw plugin settings
132
+ - Do NOT proceed with memory operations until prerequisites are met
133
+
134
+ ### Step 2: Verify Configuration
135
+
136
+ 1. **Check if LLM/Embedding API is configured** in OpenClaw plugin settings
137
+ 2. **If not configured**, ask the user for:
138
+ - LLM API endpoint and API key
139
+ - Embedding API endpoint and API key
140
+ 3. **Guide user to configure** in OpenClaw plugin settings (recommended) or help write the config file
141
+
142
+ The configuration will be automatically synced when OpenClaw restarts.
143
+
144
+ ### Step 3: Migration (if applicable)
145
+
146
+ If user has existing OpenClaw native memory, call `cortex_migrate` to preserve it.
147
+
148
+ ## Decision Flow
149
+
150
+ 1. **Need to find something** → `cortex_search`
151
+ 2. **Need more context** → `cortex_recall`
152
+ 3. **Save something important** → `cortex_add_memory`
153
+ 4. **Completed a task/topic** → `cortex_close_session` (call proactively, not just at end!)
154
+ 5. **First time with existing memory** → `cortex_migrate`
155
+
156
+ > **Key Insight**: OpenClaw's session lifecycle does NOT automatically trigger memory extraction. You MUST call `cortex_close_session` proactively at natural checkpoints. Do NOT wait until conversation end.
157
+
158
+ ## Tools
159
+
160
+ | Tool | Purpose | When to Use |
161
+ |------|---------|-------------|
162
+ | `cortex_search` | Semantic search across all memories | Find past conversations, decisions, information |
163
+ | `cortex_recall` | Recall with full context (snippet + content) | Need detailed content, not just summary |
164
+ | `cortex_add_memory` | Store message for future retrieval | Persist important information |
165
+ | `cortex_list_sessions` | List all memory sessions | Verify sessions, audit usage |
166
+ | `cortex_close_session` | Trigger memory extraction and archival | **Call at checkpoints**: after completing tasks, topic shifts, or significant exchanges. NOT just at conversation end! |
167
+ | `cortex_migrate` | Migrate from OpenClaw native memory | First time setup with existing memory |
168
+
169
+ ### Quick Examples
170
+
171
+ **Search:**
172
+ ```json
173
+ { "query": "database architecture decisions", "limit": 5 }
174
+ ```
175
+
176
+ **Recall:**
177
+ ```json
178
+ { "query": "user preferences for code style" }
179
+ ```
180
+
181
+ **Add Memory:**
182
+ ```json
183
+ { "content": "User prefers TypeScript with strict mode", "role": "assistant" }
184
+ ```
185
+
186
+ ## Troubleshooting
187
+
188
+ | Issue | Solution |
189
+ |-------|----------|
190
+ | Services won't start | Check ports 6333, 6334, 8085; verify API keys in OpenClaw plugin settings |
191
+ | Search returns no results | Run `cortex_list_sessions` to verify; lower `min_score` threshold |
192
+ | Migration fails | Ensure OpenClaw workspace at `~/.openclaw/workspace` |
193
+ | cortex-mem-service fails | Check logs; verify config.toml exists with valid API keys |
194
+ | LLM/Embedding errors | Verify `llmApiKey` and `embeddingApiKey` are configured in OpenClaw plugin settings |
195
+ | Platform not supported | MemClaw supports macOS Apple Silicon and Windows x64 only |
196
+
197
+ ## Data Safety
198
+
199
+ - **Backup**: Before migration, existing OpenClaw memory files are preserved
200
+ - **Data location**: Memory data is stored locally in the memclaw data directory
201
+ - **API keys**: Stored securely in OpenClaw config or local config.toml file
202
+ - **No cloud sync**: All data remains on your local machine
203
+
204
+ ## References
205
+
206
+ For detailed information, see:
207
+
208
+ - **`references/setup.md`** — Installation, service setup, and configuration guide
209
+ - **`references/tools.md`** — Detailed tool parameters and examples
210
+ - **`references/maintenance.md`** — CLI commands for data maintenance and optimization
@@ -0,0 +1,75 @@
1
+ # Maintenance Guide
2
+
3
+ MemClaw automatically maintains data health through scheduled tasks and provides tools for manual intervention when needed.
4
+
5
+ ## Automatic Maintenance
6
+
7
+ **The plugin automatically registers a Cron Job that runs every 3 hours**, executing:
8
+
9
+ | Command | Purpose |
10
+ |---------|---------|
11
+ | `vector prune` | Remove vectors whose source files no longer exist |
12
+ | `vector reindex` | Rebuild vector index and remove stale entries |
13
+ | `layers ensure-all` | Generate missing L0/L1 layer files |
14
+
15
+ No manual setup required. The job is registered when the plugin starts.
16
+
17
+ ## Manual Maintenance Tool
18
+
19
+ Use `cortex_maintenance` tool to run maintenance on demand:
20
+
21
+ ```json
22
+ // Full maintenance
23
+ { "dryRun": false }
24
+
25
+ // Preview changes without executing
26
+ { "dryRun": true }
27
+
28
+ // Run specific commands only
29
+ { "commands": ["prune", "reindex"] }
30
+ ```
31
+
32
+ **When to run manually:**
33
+ - Search results seem incomplete or stale
34
+ - After recovering from a crash or data corruption
35
+ - When disk space cleanup is needed
36
+
37
+ ## Diagnostic Commands
38
+
39
+ ### Check System Health
40
+
41
+ ```bash
42
+ cortex-mem-cli --config config.toml --tenant tenant_claw stats
43
+ ```
44
+
45
+ ### Check Layer Status
46
+
47
+ ```bash
48
+ cortex-mem-cli --config config.toml --tenant tenant_claw layers status
49
+ ```
50
+
51
+ Shows how many directories have L0/L1 layers vs missing.
52
+
53
+ ### Check Vector Index Status
54
+
55
+ ```bash
56
+ cortex-mem-cli --config config.toml --tenant tenant_claw vector status
57
+ ```
58
+
59
+ Shows total vectors and stale entries.
60
+
61
+ ## Quick Fix Flow
62
+
63
+ 1. **Search not working well?** → Check `layers status` and `vector status`
64
+ 2. **Missing L0/L1 layers?** → Run `layers ensure-all`
65
+ 3. **Stale vectors detected?** → Run `vector reindex`
66
+ 4. **Still having issues?** → Run `vector prune`
67
+
68
+ ## Troubleshooting
69
+
70
+ | Issue | Solution |
71
+ |-------|----------|
72
+ | CLI not found | Ensure `@memclaw/bin-{platform}` is installed |
73
+ | Connection refused | Check cortex-mem-service at `localhost:8085` |
74
+ | Qdrant issues | Verify Qdrant at `localhost:6333` |
75
+ | Layer generation fails | Check LLM API key in config.toml |