@memclaw/memclaw 0.9.16 → 0.9.18

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.
@@ -1,283 +0,0 @@
1
- # Setup Guide
2
-
3
- Installation and configuration guide for MemClaw.
4
-
5
- ## Supported Platforms
6
-
7
- | Platform | npm Package |
8
- |----------|-------------|
9
- | macOS Apple Silicon | `@memclaw/bin-darwin-arm64` |
10
- | Windows x64 | `@memclaw/bin-win-x64` |
11
-
12
- > **Note**: MemClaw is only supported on the platforms listed above.
13
-
14
- ## Requirements
15
-
16
- | Requirement | Details |
17
- |-------------|---------|
18
- | **Node.js** | ≥ 20.0.0 |
19
- | **OpenClaw** | Installed and configured |
20
- | **Qdrant** | Vector database (port 6333/6334) |
21
- | **cortex-mem-service** | Memory service (port 8085) |
22
-
23
- ## Binary Installation
24
-
25
- MemClaw binaries (Qdrant, cortex-mem-service, cortex-mem-cli) are distributed via platform-specific npm packages:
26
-
27
- - `@memclaw/bin-darwin-arm64` — macOS Apple Silicon
28
- - `@memclaw/bin-win-x64` — Windows x64
29
-
30
- These packages are installed automatically as optional dependencies when installing `@memclaw/memclaw`.
31
-
32
- ### Binary Locations After Installation
33
-
34
- When installed via OpenClaw (`openclaw plugins install @memclaw/memclaw`), binaries are located at:
35
-
36
- | Platform | Path |
37
- |----------|------|
38
- | macOS | `{claw-data-dir}/extensions/memclaw/node_modules/@memclaw/bin-darwin-arm64/bin/` |
39
- | Windows | `{claw-data-dir}\extensions\memclaw\node_modules\@memclaw\bin-win-x64\bin\` |
40
-
41
- > **Note**: `{claw-data-dir}` is typically `~/.openclaw` for standard OpenClaw. For custom or modified Claw versions, replace with your actual Claw data directory (e.g., `~/.claw`, `~/.myclaw`, etc.).
42
-
43
- **Binaries included:**
44
- - `qdrant` (or `qdrant.exe`) — Vector database server
45
- - `cortex-mem-service` (or `cortex-mem-service.exe`) — Memory extraction service
46
- - `cortex-mem-cli` (or `cortex-mem-cli.exe`) — Command-line maintenance tool
47
-
48
- ### Verify Binary Installation
49
-
50
- Check if binaries exist:
51
-
52
- ```bash
53
- # macOS (adjust claw-data-dir as needed)
54
- ls ~/.openclaw/extensions/memclaw/node_modules/@memclaw/bin-darwin-arm64/bin/
55
-
56
- # Windows (adjust claw-data-dir as needed)
57
- dir %USERPROFILE%\.openclaw\extensions\memclaw\node_modules\@memclaw\bin-win-x64\bin\
58
- ```
59
-
60
- ### Manual Binary Installation
61
-
62
- If binaries are not installed, run:
63
-
64
- ```
65
- npm install @memclaw/bin-darwin-arm64
66
- or
67
- bun install @memclaw/bin-darwin-arm64
68
- ```
69
-
70
- or (for Windows):
71
-
72
- ```
73
- npm install @memclaw/bin-win-x64
74
- or
75
- bun install @memclaw/bin-win-x64
76
- ```
77
-
78
- ## First-Time Setup Checklist
79
-
80
- **Before using MemClaw, complete these steps:**
81
-
82
- ### Step 1: Verify Platform Support
83
-
84
- Ensure you are on a supported platform (macOS Apple Silicon or Windows x86/x64).
85
-
86
- ### Step 2: Create Data Directory
87
-
88
- Create the data directory if it does not exist:
89
-
90
- | Platform | Command |
91
- |----------|---------|
92
- | macOS | `mkdir -p ~/Library/Application\ Support/memclaw` |
93
- | Windows | `mkdir %LOCALAPPDATA%\memclaw` |
94
- | Linux | `mkdir -p ~/.local/share/memclaw` |
95
-
96
- ### Step 3: Ask User for Configuration
97
-
98
- **Agent MUST ask the user for the following information:**
99
-
100
- 1. **LLM Configuration**:
101
- - API endpoint URL (OpenAI-compatible)
102
- - API key
103
-
104
- 2. **Embedding Configuration**:
105
- - API endpoint URL (OpenAI-compatible)
106
- - API key
107
- - Model name (default: `text-embedding-3-small`)
108
-
109
- ### Step 4: Write Configuration File
110
-
111
- Write `config.toml` to the data directory with all required sections:
112
-
113
- | Platform | config.toml Path |
114
- |----------|------------------|
115
- | macOS | `~/Library/Application Support/memclaw/config.toml` |
116
- | Windows | `%LOCALAPPDATA%\memclaw\config.toml` |
117
- | Linux | `~/.local/share/memclaw/config.toml` |
118
-
119
- **Full configuration template:**
120
-
121
- ```toml
122
- # Qdrant Vector Database Configuration
123
- [qdrant]
124
- url = "http://localhost:6334"
125
- collection_name = "memclaw"
126
- timeout_secs = 30
127
-
128
- # LLM Configuration [REQUIRED]
129
- [llm]
130
- api_base_url = "https://your-llm-provider.com/v1"
131
- api_key = "your-api-key-here"
132
- model_efficient = "gpt-5-mini"
133
- temperature = 0.1
134
- max_tokens = 65536
135
-
136
- # Embedding Configuration [REQUIRED]
137
- [embedding]
138
- api_base_url = "https://your-embedding-provider.com/v1"
139
- api_key = "your-api-key-here"
140
- model_name = "text-embedding-3-small"
141
- batch_size = 10
142
- timeout_secs = 30
143
-
144
- # Service Configuration
145
- [server]
146
- host = "localhost"
147
- port = 8085
148
-
149
- # Logging Configuration
150
- [logging]
151
- enabled = false
152
- log_directory = "logs"
153
- level = "info"
154
-
155
- # Cortex Memory Settings
156
- [cortex]
157
- enable_intent_analysis = false
158
- ```
159
-
160
- > **CRITICAL**: All sections are required. If any section is missing, cortex-mem-service will silently fall back to environment variables and the configuration will be ignored.
161
-
162
- ### Step 5: Verify Services
163
-
164
- Check that Qdrant and cortex-mem-service are accessible:
165
-
166
- | Service | Port | Health Check |
167
- |---------|------|--------------|
168
- | Qdrant | 6333 (HTTP), 6334 (gRPC) | HTTP GET to `http://localhost:6333` should return Qdrant version info |
169
- | cortex-mem-service | 8085 | HTTP GET to `http://localhost:8085/health` should return `{"status":"ok"}` |
170
-
171
- ### Step 6: Start Services (if not running)
172
-
173
- **Starting Qdrant:**
174
-
175
- If `autoStartServices` is `true` in plugin config, MemClaw will start Qdrant automatically.
176
-
177
- To start manually, run the Qdrant binary from the platform package with:
178
- - `--storage-path` pointing to a storage directory
179
- - `--http-port 6333`
180
- - `--grpc-port 6334`
181
-
182
- **Starting cortex-mem-service:**
183
-
184
- **CRITICAL**: cortex-mem-service MUST be started with `--data-dir` flag pointing to the directory containing `config.toml`.
185
-
186
- Arguments:
187
- - `--data-dir <path>` — Path to data directory containing `config.toml` (**REQUIRED**)
188
-
189
- Example:
190
- ```
191
- cortex-mem-service --data-dir ~/Library/Application\ Support/memclaw
192
- ```
193
-
194
- Or on Windows:
195
- ```
196
- cortex-mem-service --data-dir %LOCALAPPDATA%\memclaw
197
- ```
198
-
199
- ## Plugin Configuration
200
-
201
- Edit your `openclaw.json`:
202
-
203
- ```json
204
- {
205
- "plugins": {
206
- "entries": {
207
- "memclaw": {
208
- "enabled": true,
209
- "config": {
210
- "serviceUrl": "http://localhost:8085",
211
- "tenantId": "tenant_claw",
212
- "autoStartServices": true
213
- }
214
- }
215
- }
216
- },
217
- "agents": {
218
- "defaults": {
219
- "memorySearch": { "enabled": false }
220
- }
221
- }
222
- }
223
- ```
224
-
225
- > **Important**: Set `memorySearch.enabled: false` to disable OpenClaw's built-in memory search and use MemClaw instead.
226
-
227
- ### Configuration Options
228
-
229
- | Option | Type | Default | Description |
230
- |--------|------|---------|-------------|
231
- | `serviceUrl` | string | `http://localhost:8085` | Cortex Memory service URL |
232
- | `tenantId` | string | `tenant_claw` | Tenant ID for data isolation |
233
- | `autoStartServices` | boolean | `true` | Auto-start Qdrant and cortex-mem-service |
234
- | `defaultSessionId` | string | `default` | Default session for memory operations |
235
- | `searchLimit` | number | `10` | Default number of search results |
236
- | `minScore` | number | `0.6` | Minimum relevance score (0-1) |
237
-
238
- ## Troubleshooting
239
-
240
- ### Platform Not Supported
241
-
242
- If you see "Platform not supported" error:
243
- - Verify you are on macOS Apple Silicon or Windows x64
244
- - Check that the correct `@memclaw/bin-*` package is installed
245
-
246
- ### Binaries Not Found
247
-
248
- If binaries are missing:
249
- 1. Verify `@memclaw/bin-*` package is in `node_modules`
250
- 2. Try npm/bun reinstalling: `npm install @memclaw/bin-darwin-arm64` (or `bin-win-x64`)
251
-
252
- ### cortex-mem-service Won't Start
253
-
254
- 1. Verify `--data-dir` flag is provided
255
- 2. Verify `config.toml` exists in the data directory
256
- 3. Verify required fields in `config.toml`:
257
- - `llm.api_key` is non-empty
258
- - `embedding.api_key` is non-empty
259
-
260
- Default data directories:
261
- | Platform | Path |
262
- |----------|------|
263
- | macOS | `~/Library/Application Support/memclaw` |
264
- | Windows | `%LOCALAPPDATA%\memclaw` |
265
- | Linux | `~/.local/share/memclaw` |
266
-
267
- ### Services Not Accessible
268
-
269
- 1. Verify ports 6333, 6334, 8085 are not in use by other applications
270
- 2. Verify firewall allows connections on these ports
271
- 3. Check service logs for error messages
272
-
273
- ### Configuration File Issues
274
-
275
- 1. Ensure `config.toml` uses valid TOML syntax
276
- 2. Verify file encoding is UTF-8
277
- 3. On Windows, use double backslashes in paths: `C:\\Users\\...`
278
-
279
- ### API Key Issues
280
-
281
- 1. Verify API key is valid and has sufficient credits
282
- 2. Verify `api_base_url` is correct for your provider
283
- 3. Verify network connectivity to the API endpoint
@@ -1,170 +0,0 @@
1
- # Tools Reference
2
-
3
- Detailed documentation for MemClaw tools.
4
-
5
- ## cortex_search
6
-
7
- Semantic search across all memories using L0/L1/L2 tiered retrieval.
8
-
9
- **Parameters:**
10
-
11
- | Parameter | Type | Required | Default | Description |
12
- |-----------|------|----------|---------|-------------|
13
- | `query` | string | Yes | - | The 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
- **When to use:**
19
- - Find past conversations or decisions
20
- - Search for specific information across all sessions
21
- - Discover related memories by 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 ranked results with relevance scores
34
- - Each result includes `uri`, `score`, and `snippet`
35
-
36
- ---
37
-
38
- ## cortex_recall
39
-
40
- Recall memories with more context (snippet + full content).
41
-
42
- **Parameters:**
43
-
44
- | Parameter | Type | Required | Default | Description |
45
- |-----------|------|----------|---------|-------------|
46
- | `query` | string | Yes | - | The search query |
47
- | `scope` | string | No | - | Session/thread ID to limit search scope |
48
- | `limit` | integer | No | 10 | Maximum number of results |
49
-
50
- **When to use:**
51
- - Need memories with full context, not just summaries
52
- - Want to see the original content, not just snippets
53
- - Conducting detailed memory analysis
54
-
55
- **Example:**
56
- ```json
57
- {
58
- "query": "user preferences for code style",
59
- "limit": 10
60
- }
61
- ```
62
-
63
- **Response format:**
64
- - Returns results with both `snippet` (summary) and `content` (full text)
65
- - Content is truncated if very long (>300 chars preview)
66
-
67
- ---
68
-
69
- ## cortex_add_memory
70
-
71
- Store a message for future retrieval.
72
-
73
- **Parameters:**
74
-
75
- | Parameter | Type | Required | Default | Description |
76
- |-----------|------|----------|---------|-------------|
77
- | `content` | string | Yes | - | The content to store in memory |
78
- | `role` | string | No | `user` | Role of the message sender: `user`, `assistant`, or `system` |
79
- | `session_id` | string | No | `default` | Session/thread ID for the memory |
80
-
81
- **When to use:**
82
- - Persist important information for future retrieval
83
- - Store user preferences or decisions
84
- - Save context that should be searchable later
85
-
86
- **Example:**
87
- ```json
88
- {
89
- "content": "User prefers TypeScript with strict mode enabled and explicit return types",
90
- "role": "assistant",
91
- "session_id": "default"
92
- }
93
- ```
94
-
95
- **What happens:**
96
- - Message is stored with timestamp
97
- - Vector embedding is generated automatically
98
- - L0/L1 layers are generated asynchronously
99
-
100
- ---
101
-
102
- ## cortex_list_sessions
103
-
104
- List all memory sessions with their status.
105
-
106
- **Parameters:** None
107
-
108
- **When to use:**
109
- - Verify sessions exist before searching
110
- - Check which sessions are active or closed
111
- - Audit memory usage
112
-
113
- **Response format:**
114
- - Session IDs, status, message counts
115
- - Creation and update timestamps
116
-
117
- ---
118
-
119
- ## cortex_close_session
120
-
121
- Close a session and trigger memory extraction pipeline.
122
-
123
- **Parameters:**
124
-
125
- | Parameter | Type | Required | Default | Description |
126
- |-----------|------|----------|---------|-------------|
127
- | `session_id` | string | No | `default` | Session/thread ID to close |
128
-
129
- **When to use:**
130
- - Conversation is complete
131
- - Ready to extract structured memories
132
- - Want to finalize the session's memory content
133
-
134
- **What happens:**
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 is a potentially long-running operation (30-60 seconds).
140
-
141
- **Example:**
142
- ```json
143
- {
144
- "session_id": "default"
145
- }
146
- ```
147
-
148
- ---
149
-
150
- ## cortex_migrate
151
-
152
- Migrate memories from OpenClaw's native memory system to MemClaw.
153
-
154
- **Parameters:** None
155
-
156
- **When to use:**
157
- - First time setup with existing OpenClaw memory
158
- - Want to preserve previous conversation history
159
- - Switching from built-in memory to MemClaw
160
-
161
- **What happens:**
162
- 1. Finds OpenClaw memory files (`memory/*.md` and `MEMORY.md`)
163
- 2. Converts them to MemClaw's L2 format
164
- 3. Generates L0/L1 layers and vector index
165
-
166
- **Prerequisites:**
167
- - OpenClaw workspace exists at `~/.openclaw/workspace`
168
- - Memory files exist in `~/.openclaw/workspace/memory/`
169
-
170
- **Run only once during initial setup.**