@memclaw/memclaw 0.9.11 → 0.9.16

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,205 @@
1
+ # Tools Reference
2
+
3
+ Detailed documentation for MemClaw tools.
4
+
5
+ ## cortex_search
6
+
7
+ Semantic search using L0/L1/L2 hierarchical retrieval.
8
+
9
+ **Parameters:**
10
+
11
+ | Parameter | Type | Required | Default | Description |
12
+ |-----------|------|----------|---------|-------------|
13
+ | `query` | string | Yes | - | Search query — natural language or keywords |
14
+ | `scope` | string | No | - | Session/thread ID to limit search scope |
15
+ | `limit` | integer | No | 10 | Maximum number of results |
16
+ | `min_score` | number | No | 0.6 | Minimum relevance score (0-1) |
17
+
18
+ **Use Cases:**
19
+ - Find past conversations or decisions
20
+ - Search for specific information across all sessions
21
+ - Discover related memories through semantic similarity
22
+
23
+ **Example:**
24
+ ```json
25
+ {
26
+ "query": "database architecture decisions",
27
+ "limit": 5,
28
+ "min_score": 0.6
29
+ }
30
+ ```
31
+
32
+ **Response Format:**
33
+ - Returns results sorted by relevance
34
+ - Each result contains `uri`, `score`, and `snippet`
35
+
36
+ ---
37
+
38
+ ## cortex_recall
39
+
40
+ Retrieve memories with more context (summary + full content).
41
+
42
+ **Parameters:**
43
+
44
+ | Parameter | Type | Required | Default | Description |
45
+ |-----------|------|----------|---------|-------------|
46
+ | `query` | string | Yes | - | Search query |
47
+ | `scope` | string | No | - | Session/thread ID to limit search scope |
48
+ | `limit` | integer | No | 10 | Maximum number of results |
49
+
50
+ **Use Cases:**
51
+ - Need memories with full context, not just summaries
52
+ - Want to see original content
53
+ - Performing detailed memory analysis
54
+
55
+ **Example:**
56
+ ```json
57
+ {
58
+ "query": "user code style preferences",
59
+ "limit": 10
60
+ }
61
+ ```
62
+
63
+ **Response Format:**
64
+ - Returns results with `snippet` (summary) and `content` (full text)
65
+ - Content is truncated when too long (preview >300 characters)
66
+
67
+ ---
68
+
69
+ ## cortex_add_memory
70
+
71
+ Store messages for later retrieval.
72
+
73
+ **Parameters:**
74
+
75
+ | Parameter | Type | Required | Default | Description |
76
+ |-----------|------|----------|---------|-------------|
77
+ | `content` | string | Yes | - | Memory content to store |
78
+ | `role` | string | No | `user` | Message sender role: `user`, `assistant`, or `system` |
79
+ | `session_id` | string | No | `default` | Session/thread ID the memory belongs to |
80
+
81
+ **Use Cases:**
82
+ - Persist important information for later retrieval
83
+ - Store user preferences or decisions
84
+ - Save context that should be searchable
85
+
86
+ **Example:**
87
+ ```json
88
+ {
89
+ "content": "User prefers TypeScript with strict mode enabled",
90
+ "role": "assistant",
91
+ "session_id": "default"
92
+ }
93
+ ```
94
+
95
+ **Execution Effects:**
96
+ - Message is stored with timestamp
97
+ - Vector embedding is automatically generated
98
+ - L0/L1 layers are generated asynchronously
99
+
100
+ ---
101
+
102
+ ## cortex_list_sessions
103
+
104
+ List all memory sessions and their status.
105
+
106
+ **Parameters:** None
107
+
108
+ **Use Cases:**
109
+ - Verify sessions exist before searching
110
+ - Check which sessions are active or closed
111
+ - Audit memory usage
112
+
113
+ **Response Format:**
114
+ - Session ID, status, message count
115
+ - Creation and update timestamps
116
+
117
+ ---
118
+
119
+ ## cortex_close_session
120
+
121
+ Close a session and trigger the memory extraction process.
122
+
123
+ **Parameters:**
124
+
125
+ | Parameter | Type | Required | Default | Description |
126
+ |-----------|------|----------|---------|-------------|
127
+ | `session_id` | string | No | `default` | Session/thread ID to close |
128
+
129
+ **Use Cases:**
130
+ - When a conversation is complete
131
+ - Preparing to extract structured memories
132
+ - Wanting to finalize a session's memory content
133
+
134
+ **Execution Effects:**
135
+ 1. Extracts structured memories (user preferences, entities, decisions)
136
+ 2. Generates complete L0/L1 layer summaries
137
+ 3. Indexes all extracted memories into the vector database
138
+
139
+ **Note:** This can be a longer operation (30-60 seconds).
140
+
141
+ **Example:**
142
+ ```json
143
+ {
144
+ "session_id": "default"
145
+ }
146
+ ```
147
+
148
+ > **Important**: This tool should be called proactively at natural checkpoints, not just when the conversation ends. Ideal timing: after completing important tasks, topic transitions, or accumulating enough conversation content.
149
+
150
+ ---
151
+
152
+ ## cortex_migrate
153
+
154
+ Migrate from OpenClaw's native memory system to MemClaw.
155
+
156
+ **Parameters:** None
157
+
158
+ **Use Cases:**
159
+ - First-time use with existing OpenClaw memories
160
+ - Want to preserve previous conversation history
161
+ - Switching from built-in memory to MemClaw
162
+
163
+ **Execution Effects:**
164
+ 1. Finds OpenClaw memory files (`memory/*.md` and `MEMORY.md`)
165
+ 2. Converts to MemClaw's L2 format
166
+ 3. Generates L0/L1 layers and vector indices
167
+
168
+ **Prerequisites:**
169
+ - OpenClaw workspace exists at `~/.openclaw/workspace`
170
+ - Memory files exist at `~/.openclaw/workspace/memory/`
171
+
172
+ **Run only once during initial setup.**
173
+
174
+ ---
175
+
176
+ ## cortex_maintenance
177
+
178
+ Perform periodic maintenance on MemClaw data.
179
+
180
+ **Parameters:**
181
+
182
+ | Parameter | Type | Required | Default | Description |
183
+ |-----------|------|----------|---------|-------------|
184
+ | `dryRun` | boolean | No | false | Preview changes without executing |
185
+ | `commands` | array | No | `["prune", "reindex", "ensure-all"]` | Maintenance commands to execute |
186
+
187
+ **Use Cases:**
188
+ - Search results are incomplete or outdated
189
+ - Recovering from crash or data corruption
190
+ - Need to clean up disk space
191
+
192
+ **Available Commands:**
193
+ - `prune` — Remove vectors whose source files no longer exist
194
+ - `reindex` — Rebuild vector indices and remove stale entries
195
+ - `ensure-all` — Generate missing L0/L1 layer files
196
+
197
+ **Example:**
198
+ ```json
199
+ {
200
+ "dryRun": false,
201
+ "commands": ["prune", "reindex", "ensure-all"]
202
+ }
203
+ ```
204
+
205
+ > **Note**: This tool is typically called automatically by a scheduled Cron task. Manual invocation is for troubleshooting or on-demand maintenance.
@@ -0,0 +1,134 @@
1
+ # Troubleshooting Guide
2
+
3
+ Common MemClaw issues and their solutions.
4
+
5
+ ## Installation Issues
6
+
7
+ ### Platform Not Supported
8
+
9
+ **Symptoms**: "Platform not supported" error is displayed
10
+
11
+ **Solutions**:
12
+ - Confirm you are using macOS Apple Silicon (M1/M2/M3) or Windows x64
13
+ - Other platforms are not currently supported
14
+
15
+ ### Plugin Installation Failed
16
+
17
+ **Symptoms**: `openclaw plugins install @memclaw/memclaw` fails
18
+
19
+ **Solutions**:
20
+ 1. Check network connection
21
+ 2. Confirm npm registry is accessible
22
+ 3. Try using a proxy or mirror source
23
+
24
+ ## Configuration Issues
25
+
26
+ ### Invalid API Key
27
+
28
+ **Symptoms**: Search or memory operations return API errors
29
+
30
+ **Solutions**:
31
+ 1. Verify `llmApiKey` and `embeddingApiKey` are correctly configured in OpenClaw plugin settings
32
+ 2. Confirm API keys are valid and have sufficient quota
33
+ 3. Confirm `llmApiBaseUrl` and `embeddingApiBaseUrl` are correct for your provider
34
+ 4. Verify network connectivity to API endpoints
35
+
36
+ ### Configuration Not Taking Effect
37
+
38
+ **Symptoms**: Service behavior doesn't change after modifying configuration
39
+
40
+ **Solutions**:
41
+ 1. Ensure configuration file was saved
42
+ 2. Restart OpenClaw to apply changes
43
+ 3. Check configuration file syntax for errors (JSON format)
44
+
45
+ ## Service Issues
46
+
47
+ ### Service Won't Start
48
+
49
+ **Symptoms**: Service fails to start when plugin loads
50
+
51
+ **Solutions**:
52
+ 1. Check if ports 6333, 6334, 8085 are occupied by other applications
53
+ 2. Confirm API keys are configured in OpenClaw plugin settings
54
+ 3. Check OpenClaw logs for detailed error messages
55
+
56
+ ### Service Unreachable
57
+
58
+ **Symptoms**: Tool calls return connection errors
59
+
60
+ **Solutions**:
61
+ 1. Confirm OpenClaw has been restarted and plugin is loaded
62
+ 2. Check if `autoStartServices` configuration is set to `true` (default)
63
+ 3. Verify firewall allows local connections on these ports
64
+
65
+ ## Usage Issues
66
+
67
+ ### No Search Results
68
+
69
+ **Symptoms**: `cortex_search` returns empty results
70
+
71
+ **Solutions**:
72
+ 1. Run `cortex_list_sessions` to verify sessions exist
73
+ 2. Lower `min_score` threshold (e.g., from 0.6 to 0.4)
74
+ 3. Try different query terms or synonyms
75
+ 4. Confirm that `cortex_add_memory` or `cortex_close_session` has been called previously to store memories
76
+
77
+ ### Memory Extraction Failed
78
+
79
+ **Symptoms**: `cortex_close_session` fails or produces incomplete results
80
+
81
+ **Solutions**:
82
+ 1. Verify LLM API configuration is correct
83
+ 2. Check if API quota is sufficient
84
+ 3. Check OpenClaw logs for detailed error messages
85
+
86
+ ### Migration Failed
87
+
88
+ **Symptoms**: `cortex_migrate` fails to execute
89
+
90
+ **Solutions**:
91
+ 1. Confirm OpenClaw workspace is located at `~/.openclaw/workspace`
92
+ 2. Confirm memory files exist at `~/.openclaw/workspace/memory/`
93
+ 3. Verify file permissions are correct
94
+
95
+ ## Data Issues
96
+
97
+ ### Data Location
98
+
99
+ MemClaw data storage locations:
100
+
101
+ | Platform | Path |
102
+ |----------|------|
103
+ | macOS | `~/Library/Application Support/memclaw` |
104
+ | Windows | `%LOCALAPPDATA%\memclaw` |
105
+ | Linux | `~/.local/share/memclaw` |
106
+
107
+ ### Data Safety
108
+
109
+ - **Backup**: Existing OpenClaw memory files are preserved before migration
110
+ - **Local Storage**: All memory data is stored locally
111
+ - **No Cloud Sync**: Data remains on the local machine
112
+
113
+ ## Error Messages Reference
114
+
115
+ | Error Message | Possible Cause | Solution |
116
+ |---------------|----------------|----------|
117
+ | `Service not running` | Service not started | Restart OpenClaw or enable `autoStartServices` |
118
+ | `API error: 401` | Invalid API key | Check API key configuration |
119
+ | `API error: 429` | Rate limit exceeded | Wait and retry, or upgrade API plan |
120
+ | `Connection refused` | Service unreachable | Check port usage and service status |
121
+ | `No sessions found` | No memory data | Use `cortex_add_memory` to add memories |
122
+
123
+ ## Getting Help
124
+
125
+ If the above solutions don't resolve your issue:
126
+
127
+ 1. Check OpenClaw logs for detailed error messages
128
+ 2. Submit an issue report at [GitHub Issues](https://github.com/sopaco/cortex-mem/issues)
129
+ 3. Provide the following information:
130
+ - Operating system and version
131
+ - OpenClaw version
132
+ - MemClaw plugin version
133
+ - Relevant log snippets
134
+ - Steps to reproduce
File without changes
File without changes