grix-connector 3.1.13 → 3.1.15

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.
Files changed (75) hide show
  1. package/README.md +241 -241
  2. package/dist/adapter/claude/claude-adapter.js +19 -19
  3. package/dist/adapter/claude/usage-parser.js +9 -7
  4. package/dist/default-skills/grix-access-control/SKILL.md +31 -31
  5. package/dist/default-skills/grix-admin/SKILL.md +35 -35
  6. package/dist/default-skills/grix-agent-dispatch/SKILL.md +89 -89
  7. package/dist/default-skills/grix-chat-state/SKILL.md +56 -56
  8. package/dist/default-skills/grix-egg/SKILL.md +90 -90
  9. package/dist/default-skills/grix-group/SKILL.md +35 -35
  10. package/dist/default-skills/grix-owner-relay/SKILL.md +66 -66
  11. package/dist/default-skills/grix-query/SKILL.md +38 -38
  12. package/dist/default-skills/message-send/SKILL.md +36 -36
  13. package/dist/default-skills/message-unsend/SKILL.md +27 -27
  14. package/dist/default-skills/tailnet-file-share/SKILL.md +65 -65
  15. package/dist/grix.js +0 -0
  16. package/dist/service/platform-adapter.js +59 -16
  17. package/openclaw-plugin/skills/grix-admin/SKILL.md +202 -202
  18. package/openclaw-plugin/skills/grix-admin/references/api-contract.md +210 -210
  19. package/openclaw-plugin/skills/grix-egg/SKILL.md +81 -81
  20. package/openclaw-plugin/skills/grix-egg/references/api-contract.md +40 -40
  21. package/openclaw-plugin/skills/grix-group/SKILL.md +164 -164
  22. package/openclaw-plugin/skills/grix-group/references/api-contract.md +97 -97
  23. package/openclaw-plugin/skills/grix-query/SKILL.md +247 -247
  24. package/openclaw-plugin/skills/grix-register/SKILL.md +86 -86
  25. package/openclaw-plugin/skills/grix-register/references/api-contract.md +76 -76
  26. package/openclaw-plugin/skills/grix-register/references/grix-concepts.md +26 -26
  27. package/openclaw-plugin/skills/grix-register/references/handoff-contract.md +24 -24
  28. package/openclaw-plugin/skills/grix-register/references/openclaw-setup.md +6 -6
  29. package/openclaw-plugin/skills/grix-register/references/user-replies.md +25 -25
  30. package/openclaw-plugin/skills/grix-update/SKILL.md +310 -310
  31. package/openclaw-plugin/skills/grix-update/references/cron-setup.md +56 -56
  32. package/openclaw-plugin/skills/grix-update/references/update-contract.md +149 -149
  33. package/openclaw-plugin/skills/message-send/SKILL.md +197 -197
  34. package/openclaw-plugin/skills/message-unsend/SKILL.md +186 -186
  35. package/openclaw-plugin/skills/message-unsend/flowchart.mermaid +27 -27
  36. package/openclaw-plugin/skills/openclaw-memory-setup/SKILL.md +282 -282
  37. package/openclaw-plugin/skills/openclaw-memory-setup/references/case-study-macpro.md +52 -52
  38. package/openclaw-plugin/skills/openclaw-memory-setup/references/host-readiness.md +147 -147
  39. package/openclaw.plugin.json +24 -24
  40. package/package.json +121 -121
  41. package/scripts/install-guardian.mjs +27 -27
  42. package/scripts/install-guardian.sh +25 -25
  43. package/scripts/upgrade-guardian.sh +104 -104
  44. package/dist/adapter/claude/claude-bridge-server.js +0 -1
  45. package/dist/adapter/claude/claude-tools.js +0 -1
  46. package/dist/adapter/claude/claude-worker-client.js +0 -1
  47. package/dist/adapter/claude/mcp-http-launcher.js +0 -2
  48. package/dist/adapter/claude/result-timeout.js +0 -1
  49. package/dist/adapter/deepseek/deepseek-adapter.js +0 -6
  50. package/dist/adapter/deepseek/index.js +0 -1
  51. package/dist/adapter/qwen/index.js +0 -1
  52. package/dist/adapter/qwen/qwen-adapter.js +0 -4
  53. package/dist/aibot/client.js +0 -1
  54. package/dist/aibot/index.js +0 -1
  55. package/dist/aibot/types.js +0 -0
  56. package/dist/core/file-ops/handler.js +0 -1
  57. package/dist/core/file-ops/list-files.js +0 -1
  58. package/dist/core/file-ops/types.js +0 -0
  59. package/dist/default-skills/grix-task-status/SKILL.md +0 -36
  60. package/dist/log.js +0 -3
  61. package/dist/main.js +0 -31
  62. package/dist/mcp/stream-http/config.js +0 -1
  63. package/dist/mcp/stream-http/connection-binding.js +0 -1
  64. package/dist/mcp/stream-http/event-tool-executor.js +0 -1
  65. package/dist/mcp/stream-http/gateway.js +0 -1
  66. package/dist/mcp/stream-http/index.js +0 -1
  67. package/dist/mcp/stream-http/security.js +0 -1
  68. package/dist/mcp/stream-http/session-manager.js +0 -1
  69. package/dist/mcp/stream-http/tool-executor.js +0 -1
  70. package/dist/mcp/stream-http/tool-registry.js +0 -1
  71. package/dist/mcp/stream-http/tool-schemas.js +0 -1
  72. package/dist/session/index.js +0 -1
  73. package/dist/session/manager.js +0 -1
  74. package/dist/transport/index.js +0 -1
  75. package/dist/transport/json-rpc.js +0 -3
@@ -1,282 +1,282 @@
1
- ---
2
- name: openclaw-memory-setup
3
- description: Configure OpenClaw memory on the target machine from either user-provided provider settings or a measured local-model choice. Use when Codex needs to apply direct memory parameters such as `provider=openai` or `provider=ollama`, compare local Ollama embedding models by real machine speed, update one or more OpenClaw profiles, rebuild indexes after a model change, or verify that memory is healthy on resource-constrained hosts.
4
- ---
5
-
6
- # OpenClaw Memory Setup
7
-
8
- ## Overview
9
-
10
- Use this skill to either apply user-supplied memory provider settings directly or take a machine from readiness check through Ollama and OpenClaw installation, then choose a local embedding model by measurement and apply it to OpenClaw profiles safely.
11
-
12
- Read [host-readiness.md](references/host-readiness.md) before working on a fresh machine.
13
-
14
- ## Request Handling
15
-
16
- Start by sorting the request into one of these paths:
17
-
18
- - Direct config path:
19
- - use when the user already gives the target profiles, target model, provider choice, machine facts, or existing install state
20
- - do not force a full readiness survey first
21
- - Guided config path:
22
- - use when the user has partial information and needs a few missing parameters filled in
23
- - Fresh machine path:
24
- - use when the user has not installed the stack yet or cannot tell what exists
25
-
26
- Ask only for the minimum missing inputs when the user already knows what they want. Do not make them re-prove that `ollama` exists if they already supplied enough concrete parameters to proceed safely.
27
-
28
- ## Completion Standard
29
-
30
- - Confirm the machine is supported and identify what is missing.
31
- - If the chosen path uses local Ollama memory, install or verify Ollama with the official method for that OS.
32
- - If the target machine still lacks OpenClaw, install or verify it with the official Ollama integration path.
33
- - If the chosen path uses local Ollama memory, pull or confirm the candidate models on the target machine.
34
- - If the chosen path uses local Ollama memory, benchmark the candidates on the target machine with [bench_ollama_embeddings.js](scripts/bench_ollama_embeddings.js).
35
- - Write the chosen model into each target `openclaw.json`.
36
- - Validate the config, restart the profile, and rebuild memory.
37
- - Confirm that `memory status` and `status` both look healthy for every target profile.
38
-
39
- ## Fast Rules
40
-
41
- - Benchmark on the target machine. Do not benchmark locally and assume the same result remotely.
42
- - If the user already provides enough concrete parameters to edit the config safely, skip the readiness survey and move straight to config update, validation, restart, and rebuild.
43
- - If the user already provides a provider, model, and any required provider-specific settings, prefer direct configuration over local-model benchmarking.
44
- - On a fresh machine or an unclear host, start with [survey_host_readiness.js](scripts/survey_host_readiness.js).
45
- - If `ollama` is missing, install it first with the official download or install script for that OS.
46
- - If OpenClaw itself or a usable OpenClaw management entrypoint is missing, install OpenClaw through `ollama launch openclaw` instead of inventing a custom path.
47
- - Treat Windows as a special case: native Windows and WSL2 are both supported, but WSL2 remains the more stable and recommended path for the full CLI, Gateway, and tooling flow. If the machine already runs OpenClaw natively and the requested work stays within supported native CLI/Gateway paths, do not force a WSL migration.
48
- - If the user has nothing set up and wants to save money, prefer local Ollama deployment instead of cloud-first suggestions.
49
- - On resource-constrained hosts, start with `embeddinggemma:300m-qat-q8_0`, `nomic-embed-text:latest`, and `qwen3-embedding:0.6b`.
50
- - Treat `qwen3-embedding:latest` as a last resort on slow hardware.
51
- - If the same maintenance window also upgrades `grix`, upgrade `grix` first and rebuild memory once at the end.
52
- - Update `agents.defaults.memorySearch.provider` and `agents.defaults.memorySearch.model` at the profile level unless one agent truly needs a different model.
53
- - Restart the profile after a config change, then reindex memory.
54
- - Treat `0/0 files` or `no memory files found` as normal for empty agents. Treat `config validate` failure, crashed services, or missing indexed files as actual failures.
55
- - If reindex progress keeps moving, let it finish. Large session logs can take minutes on older machines.
56
-
57
- ## 1. Choose The Right Entry Path
58
-
59
- ### Direct config path
60
-
61
- Use this path when the user already provides most of these:
62
-
63
- - target profile names or config paths
64
- - target provider such as `openai` or `ollama`
65
- - target memory model
66
- - whether the machine already has Ollama and OpenClaw
67
- - whether the goal is just to switch memory settings
68
-
69
- In this path:
70
-
71
- - skip the readiness survey unless something important is still unclear
72
- - skip installation checks that do not affect the requested change
73
- - if the provider is not `ollama`, skip local model benchmarking unless the user explicitly asks for it
74
- - update the config directly
75
- - validate, restart, and rebuild
76
-
77
- ### Fresh machine path
78
-
79
- Use this path when the user says they have nothing set up yet, or wants a cheap setup from scratch.
80
-
81
- In this path:
82
-
83
- - recommend local Ollama first if the user wants to save money
84
- - survey the machine
85
- - install missing pieces through the official path
86
- - if the host is native Windows, prefer WSL for the full setup and heavier automation/tooling path, but do not falsely claim native Windows is unsupported when the requested steps already fit supported native CLI/Gateway flows
87
- - then benchmark and configure memory
88
-
89
- ### Provider-specific shortcut
90
-
91
- If the user directly gives provider settings such as `provider=openai`, API base, model, and target profiles:
92
-
93
- - do not route them through local Ollama setup unless they ask for a local option
94
- - write the memory settings directly
95
- - validate, restart, and rebuild
96
-
97
- ## 2. Survey The Machine
98
-
99
- Run [survey_host_readiness.js](scripts/survey_host_readiness.js):
100
-
101
- ```bash
102
- node scripts/survey_host_readiness.js
103
- ```
104
-
105
- This checks:
106
-
107
- - OS, architecture, CPU count, and total RAM
108
- - whether the current shell is macOS native, Linux native, WSL, or native Windows
109
- - whether `ollama`, `openclaw`, a usable OpenClaw management entrypoint, `node`, and `npm` exist
110
- - whether the local Ollama API is reachable
111
- - a starting shortlist of memory models based on a conservative RAM heuristic
112
-
113
- If the machine is clearly undersized for your original plan, downgrade the candidate list before pulling large models.
114
-
115
- ## 3. Install Missing Pieces
116
-
117
- Follow [host-readiness.md](references/host-readiness.md) for the official path.
118
-
119
- Use these rules:
120
-
121
- - If `ollama` is missing:
122
- - install Ollama first
123
- - If `ollama` exists but OpenClaw or a usable OpenClaw management entrypoint is missing:
124
- - run `ollama launch openclaw` for interactive setup
125
- - or run `ollama launch openclaw --model <model> --yes` for headless setup
126
- - If the machine is only being prepared and should not start the TUI:
127
- - run `ollama launch openclaw --config`
128
-
129
- If the user wants the cheapest practical setup from scratch:
130
-
131
- - recommend local Ollama for memory embeddings
132
- - start with smaller local embedding models
133
- - avoid steering them toward cloud models unless they explicitly want stronger remote models or their hardware cannot carry the workload
134
-
135
- Do not patch OpenClaw internals to skip the official setup flow.
136
-
137
- Skip this whole installation step when the user is only asking to apply already-known remote provider settings and the machine already has OpenClaw.
138
-
139
- ## 4. Pick Candidate Models
140
-
141
- On resource-constrained hosts, start with these candidates:
142
-
143
- ```bash
144
- ollama pull embeddinggemma:300m-qat-q8_0
145
- ollama pull nomic-embed-text:latest
146
- ollama pull qwen3-embedding:0.6b
147
- ```
148
-
149
- Only try `qwen3-embedding:latest` when the machine already handles the smaller models comfortably and a long rebuild window is acceptable.
150
-
151
- Use the readiness script output as the first filter on other machines:
152
-
153
- - low-memory hosts: start with the smallest shortlist it recommends
154
- - mid-range hosts: start with `embeddinggemma`, `nomic-embed-text`, and `qwen3-embedding:0.6b`
155
- - strong hosts: add larger candidates only if there is a real reason
156
-
157
- ## 5. Benchmark On The Target Machine
158
-
159
- Use [bench_ollama_embeddings.js](scripts/bench_ollama_embeddings.js):
160
-
161
- ```bash
162
- node scripts/bench_ollama_embeddings.js \
163
- embeddinggemma:300m-qat-q8_0 \
164
- nomic-embed-text:latest \
165
- qwen3-embedding:0.6b
166
- ```
167
-
168
- Use `--rounds 2` for a cleaner comparison. Use `--batch-size 2` for a quicker smoke test.
169
-
170
- Prefer the fastest model that succeeds cleanly. On smaller or older hosts, these rough bands work well:
171
-
172
- - Excellent: single <= 5s and batch-of-4 <= 15s
173
- - Acceptable: single <= 20s and batch-of-4 <= 60s
174
- - Poor: slower than that, or painful to repeat during rebuilds
175
-
176
- ## 6. Write The Chosen Provider Settings Into OpenClaw Config
177
-
178
- Preview the change first:
179
-
180
- ```bash
181
- node scripts/set_openclaw_memory_model.js \
182
- --model embeddinggemma:300m-qat-q8_0 \
183
- <profile-dir-1> \
184
- <profile-dir-2>
185
- ```
186
-
187
- Apply it only after the preview looks right:
188
-
189
- ```bash
190
- node scripts/set_openclaw_memory_model.js \
191
- --write \
192
- --model embeddinggemma:300m-qat-q8_0 \
193
- <profile-dir-1> \
194
- <profile-dir-2>
195
- ```
196
-
197
- The script creates a timestamped backup beside each `openclaw.json`.
198
- Its preview output redacts common secret-like fields such as API keys, tokens, and authorization headers.
199
-
200
- For a direct remote-provider setup, change the provider flag and supply the target model:
201
-
202
- ```bash
203
- node scripts/set_openclaw_memory_model.js \
204
- --write \
205
- --provider openai \
206
- --model text-embedding-3-small \
207
- <profile-dir>
208
- ```
209
-
210
- If the provider needs extra keys, pass them in the same command with repeated `--set KEY=VALUE` flags. Keys are relative to `agents.defaults.memorySearch`, support dotted paths, and parse JSON values when possible.
211
- When the provider changes, the script replaces the previous `memorySearch` object before writing the new provider settings so that stale fields do not leak across providers.
212
-
213
- Examples:
214
-
215
- ```bash
216
- node scripts/set_openclaw_memory_model.js \
217
- --write \
218
- --provider openai \
219
- --model text-embedding-3-small \
220
- --set apiKey=env:OPENAI_API_KEY \
221
- --set baseURL=https://api.openai.com/v1 \
222
- <profile-dir>
223
- ```
224
-
225
- ```bash
226
- node scripts/set_openclaw_memory_model.js \
227
- --write \
228
- --provider custom \
229
- --model my-embed-model \
230
- --set 'headers.Authorization=Bearer token-value' \
231
- --set timeoutSeconds=30 \
232
- <profile-dir>
233
- ```
234
-
235
- ## 7. Validate, Restart, And Rebuild
236
-
237
- Use the official `openclaw` CLI by default on unknown hosts. If a local wrapper exists on a specific machine, adapt locally, but keep the skill examples on the official CLI. The shell examples below are for macOS, Linux, or WSL.
238
-
239
- ```bash
240
- openclaw --profile <profile> config validate
241
- openclaw --profile <profile> gateway restart
242
- openclaw --profile <profile> memory index --force
243
- openclaw --profile <profile> memory status
244
- openclaw --profile <profile> status
245
- ```
246
-
247
- For multiple profiles:
248
-
249
- ```bash
250
- for p in <profile-1> <profile-2>; do
251
- openclaw --profile "$p" config validate || break
252
- openclaw --profile "$p" gateway restart || break
253
- openclaw --profile "$p" memory index --force || break
254
- openclaw --profile "$p" memory status
255
- openclaw --profile "$p" status
256
- done
257
- ```
258
-
259
- If a given machine exposes only a wrapper around `openclaw`, map the same five actions onto that wrapper locally: validate config, restart, rebuild memory, inspect memory status, and inspect runtime status.
260
-
261
- Use `memory status --deep` when counts do not match what you expect.
262
-
263
- ## 8. Judge The Result Correctly
264
-
265
- A rollout is done when:
266
-
267
- - `config validate` passes
268
- - the service is running
269
- - the chosen model appears in `memory status`
270
- - indexed counts match real memory and session files for agents that actually have content
271
- - large agents finish eventually instead of bouncing forever
272
-
273
- Not a failure by itself:
274
-
275
- - empty agents showing `0/0 files`
276
- - empty agents showing `no memory files found`
277
- - one or two very large session logs taking much longer than the rest
278
-
279
- ## Reference
280
-
281
- Read [host-readiness.md](references/host-readiness.md) for the generic install and readiness path.
282
- Read [case-study-macpro.md](references/case-study-macpro.md) only as one measured example on an older machine.
1
+ ---
2
+ name: openclaw-memory-setup
3
+ description: Configure OpenClaw memory on the target machine from either user-provided provider settings or a measured local-model choice. Use when Codex needs to apply direct memory parameters such as `provider=openai` or `provider=ollama`, compare local Ollama embedding models by real machine speed, update one or more OpenClaw profiles, rebuild indexes after a model change, or verify that memory is healthy on resource-constrained hosts.
4
+ ---
5
+
6
+ # OpenClaw Memory Setup
7
+
8
+ ## Overview
9
+
10
+ Use this skill to either apply user-supplied memory provider settings directly or take a machine from readiness check through Ollama and OpenClaw installation, then choose a local embedding model by measurement and apply it to OpenClaw profiles safely.
11
+
12
+ Read [host-readiness.md](references/host-readiness.md) before working on a fresh machine.
13
+
14
+ ## Request Handling
15
+
16
+ Start by sorting the request into one of these paths:
17
+
18
+ - Direct config path:
19
+ - use when the user already gives the target profiles, target model, provider choice, machine facts, or existing install state
20
+ - do not force a full readiness survey first
21
+ - Guided config path:
22
+ - use when the user has partial information and needs a few missing parameters filled in
23
+ - Fresh machine path:
24
+ - use when the user has not installed the stack yet or cannot tell what exists
25
+
26
+ Ask only for the minimum missing inputs when the user already knows what they want. Do not make them re-prove that `ollama` exists if they already supplied enough concrete parameters to proceed safely.
27
+
28
+ ## Completion Standard
29
+
30
+ - Confirm the machine is supported and identify what is missing.
31
+ - If the chosen path uses local Ollama memory, install or verify Ollama with the official method for that OS.
32
+ - If the target machine still lacks OpenClaw, install or verify it with the official Ollama integration path.
33
+ - If the chosen path uses local Ollama memory, pull or confirm the candidate models on the target machine.
34
+ - If the chosen path uses local Ollama memory, benchmark the candidates on the target machine with [bench_ollama_embeddings.js](scripts/bench_ollama_embeddings.js).
35
+ - Write the chosen model into each target `openclaw.json`.
36
+ - Validate the config, restart the profile, and rebuild memory.
37
+ - Confirm that `memory status` and `status` both look healthy for every target profile.
38
+
39
+ ## Fast Rules
40
+
41
+ - Benchmark on the target machine. Do not benchmark locally and assume the same result remotely.
42
+ - If the user already provides enough concrete parameters to edit the config safely, skip the readiness survey and move straight to config update, validation, restart, and rebuild.
43
+ - If the user already provides a provider, model, and any required provider-specific settings, prefer direct configuration over local-model benchmarking.
44
+ - On a fresh machine or an unclear host, start with [survey_host_readiness.js](scripts/survey_host_readiness.js).
45
+ - If `ollama` is missing, install it first with the official download or install script for that OS.
46
+ - If OpenClaw itself or a usable OpenClaw management entrypoint is missing, install OpenClaw through `ollama launch openclaw` instead of inventing a custom path.
47
+ - Treat Windows as a special case: native Windows and WSL2 are both supported, but WSL2 remains the more stable and recommended path for the full CLI, Gateway, and tooling flow. If the machine already runs OpenClaw natively and the requested work stays within supported native CLI/Gateway paths, do not force a WSL migration.
48
+ - If the user has nothing set up and wants to save money, prefer local Ollama deployment instead of cloud-first suggestions.
49
+ - On resource-constrained hosts, start with `embeddinggemma:300m-qat-q8_0`, `nomic-embed-text:latest`, and `qwen3-embedding:0.6b`.
50
+ - Treat `qwen3-embedding:latest` as a last resort on slow hardware.
51
+ - If the same maintenance window also upgrades `grix`, upgrade `grix` first and rebuild memory once at the end.
52
+ - Update `agents.defaults.memorySearch.provider` and `agents.defaults.memorySearch.model` at the profile level unless one agent truly needs a different model.
53
+ - Restart the profile after a config change, then reindex memory.
54
+ - Treat `0/0 files` or `no memory files found` as normal for empty agents. Treat `config validate` failure, crashed services, or missing indexed files as actual failures.
55
+ - If reindex progress keeps moving, let it finish. Large session logs can take minutes on older machines.
56
+
57
+ ## 1. Choose The Right Entry Path
58
+
59
+ ### Direct config path
60
+
61
+ Use this path when the user already provides most of these:
62
+
63
+ - target profile names or config paths
64
+ - target provider such as `openai` or `ollama`
65
+ - target memory model
66
+ - whether the machine already has Ollama and OpenClaw
67
+ - whether the goal is just to switch memory settings
68
+
69
+ In this path:
70
+
71
+ - skip the readiness survey unless something important is still unclear
72
+ - skip installation checks that do not affect the requested change
73
+ - if the provider is not `ollama`, skip local model benchmarking unless the user explicitly asks for it
74
+ - update the config directly
75
+ - validate, restart, and rebuild
76
+
77
+ ### Fresh machine path
78
+
79
+ Use this path when the user says they have nothing set up yet, or wants a cheap setup from scratch.
80
+
81
+ In this path:
82
+
83
+ - recommend local Ollama first if the user wants to save money
84
+ - survey the machine
85
+ - install missing pieces through the official path
86
+ - if the host is native Windows, prefer WSL for the full setup and heavier automation/tooling path, but do not falsely claim native Windows is unsupported when the requested steps already fit supported native CLI/Gateway flows
87
+ - then benchmark and configure memory
88
+
89
+ ### Provider-specific shortcut
90
+
91
+ If the user directly gives provider settings such as `provider=openai`, API base, model, and target profiles:
92
+
93
+ - do not route them through local Ollama setup unless they ask for a local option
94
+ - write the memory settings directly
95
+ - validate, restart, and rebuild
96
+
97
+ ## 2. Survey The Machine
98
+
99
+ Run [survey_host_readiness.js](scripts/survey_host_readiness.js):
100
+
101
+ ```bash
102
+ node scripts/survey_host_readiness.js
103
+ ```
104
+
105
+ This checks:
106
+
107
+ - OS, architecture, CPU count, and total RAM
108
+ - whether the current shell is macOS native, Linux native, WSL, or native Windows
109
+ - whether `ollama`, `openclaw`, a usable OpenClaw management entrypoint, `node`, and `npm` exist
110
+ - whether the local Ollama API is reachable
111
+ - a starting shortlist of memory models based on a conservative RAM heuristic
112
+
113
+ If the machine is clearly undersized for your original plan, downgrade the candidate list before pulling large models.
114
+
115
+ ## 3. Install Missing Pieces
116
+
117
+ Follow [host-readiness.md](references/host-readiness.md) for the official path.
118
+
119
+ Use these rules:
120
+
121
+ - If `ollama` is missing:
122
+ - install Ollama first
123
+ - If `ollama` exists but OpenClaw or a usable OpenClaw management entrypoint is missing:
124
+ - run `ollama launch openclaw` for interactive setup
125
+ - or run `ollama launch openclaw --model <model> --yes` for headless setup
126
+ - If the machine is only being prepared and should not start the TUI:
127
+ - run `ollama launch openclaw --config`
128
+
129
+ If the user wants the cheapest practical setup from scratch:
130
+
131
+ - recommend local Ollama for memory embeddings
132
+ - start with smaller local embedding models
133
+ - avoid steering them toward cloud models unless they explicitly want stronger remote models or their hardware cannot carry the workload
134
+
135
+ Do not patch OpenClaw internals to skip the official setup flow.
136
+
137
+ Skip this whole installation step when the user is only asking to apply already-known remote provider settings and the machine already has OpenClaw.
138
+
139
+ ## 4. Pick Candidate Models
140
+
141
+ On resource-constrained hosts, start with these candidates:
142
+
143
+ ```bash
144
+ ollama pull embeddinggemma:300m-qat-q8_0
145
+ ollama pull nomic-embed-text:latest
146
+ ollama pull qwen3-embedding:0.6b
147
+ ```
148
+
149
+ Only try `qwen3-embedding:latest` when the machine already handles the smaller models comfortably and a long rebuild window is acceptable.
150
+
151
+ Use the readiness script output as the first filter on other machines:
152
+
153
+ - low-memory hosts: start with the smallest shortlist it recommends
154
+ - mid-range hosts: start with `embeddinggemma`, `nomic-embed-text`, and `qwen3-embedding:0.6b`
155
+ - strong hosts: add larger candidates only if there is a real reason
156
+
157
+ ## 5. Benchmark On The Target Machine
158
+
159
+ Use [bench_ollama_embeddings.js](scripts/bench_ollama_embeddings.js):
160
+
161
+ ```bash
162
+ node scripts/bench_ollama_embeddings.js \
163
+ embeddinggemma:300m-qat-q8_0 \
164
+ nomic-embed-text:latest \
165
+ qwen3-embedding:0.6b
166
+ ```
167
+
168
+ Use `--rounds 2` for a cleaner comparison. Use `--batch-size 2` for a quicker smoke test.
169
+
170
+ Prefer the fastest model that succeeds cleanly. On smaller or older hosts, these rough bands work well:
171
+
172
+ - Excellent: single <= 5s and batch-of-4 <= 15s
173
+ - Acceptable: single <= 20s and batch-of-4 <= 60s
174
+ - Poor: slower than that, or painful to repeat during rebuilds
175
+
176
+ ## 6. Write The Chosen Provider Settings Into OpenClaw Config
177
+
178
+ Preview the change first:
179
+
180
+ ```bash
181
+ node scripts/set_openclaw_memory_model.js \
182
+ --model embeddinggemma:300m-qat-q8_0 \
183
+ <profile-dir-1> \
184
+ <profile-dir-2>
185
+ ```
186
+
187
+ Apply it only after the preview looks right:
188
+
189
+ ```bash
190
+ node scripts/set_openclaw_memory_model.js \
191
+ --write \
192
+ --model embeddinggemma:300m-qat-q8_0 \
193
+ <profile-dir-1> \
194
+ <profile-dir-2>
195
+ ```
196
+
197
+ The script creates a timestamped backup beside each `openclaw.json`.
198
+ Its preview output redacts common secret-like fields such as API keys, tokens, and authorization headers.
199
+
200
+ For a direct remote-provider setup, change the provider flag and supply the target model:
201
+
202
+ ```bash
203
+ node scripts/set_openclaw_memory_model.js \
204
+ --write \
205
+ --provider openai \
206
+ --model text-embedding-3-small \
207
+ <profile-dir>
208
+ ```
209
+
210
+ If the provider needs extra keys, pass them in the same command with repeated `--set KEY=VALUE` flags. Keys are relative to `agents.defaults.memorySearch`, support dotted paths, and parse JSON values when possible.
211
+ When the provider changes, the script replaces the previous `memorySearch` object before writing the new provider settings so that stale fields do not leak across providers.
212
+
213
+ Examples:
214
+
215
+ ```bash
216
+ node scripts/set_openclaw_memory_model.js \
217
+ --write \
218
+ --provider openai \
219
+ --model text-embedding-3-small \
220
+ --set apiKey=env:OPENAI_API_KEY \
221
+ --set baseURL=https://api.openai.com/v1 \
222
+ <profile-dir>
223
+ ```
224
+
225
+ ```bash
226
+ node scripts/set_openclaw_memory_model.js \
227
+ --write \
228
+ --provider custom \
229
+ --model my-embed-model \
230
+ --set 'headers.Authorization=Bearer token-value' \
231
+ --set timeoutSeconds=30 \
232
+ <profile-dir>
233
+ ```
234
+
235
+ ## 7. Validate, Restart, And Rebuild
236
+
237
+ Use the official `openclaw` CLI by default on unknown hosts. If a local wrapper exists on a specific machine, adapt locally, but keep the skill examples on the official CLI. The shell examples below are for macOS, Linux, or WSL.
238
+
239
+ ```bash
240
+ openclaw --profile <profile> config validate
241
+ openclaw --profile <profile> gateway restart
242
+ openclaw --profile <profile> memory index --force
243
+ openclaw --profile <profile> memory status
244
+ openclaw --profile <profile> status
245
+ ```
246
+
247
+ For multiple profiles:
248
+
249
+ ```bash
250
+ for p in <profile-1> <profile-2>; do
251
+ openclaw --profile "$p" config validate || break
252
+ openclaw --profile "$p" gateway restart || break
253
+ openclaw --profile "$p" memory index --force || break
254
+ openclaw --profile "$p" memory status
255
+ openclaw --profile "$p" status
256
+ done
257
+ ```
258
+
259
+ If a given machine exposes only a wrapper around `openclaw`, map the same five actions onto that wrapper locally: validate config, restart, rebuild memory, inspect memory status, and inspect runtime status.
260
+
261
+ Use `memory status --deep` when counts do not match what you expect.
262
+
263
+ ## 8. Judge The Result Correctly
264
+
265
+ A rollout is done when:
266
+
267
+ - `config validate` passes
268
+ - the service is running
269
+ - the chosen model appears in `memory status`
270
+ - indexed counts match real memory and session files for agents that actually have content
271
+ - large agents finish eventually instead of bouncing forever
272
+
273
+ Not a failure by itself:
274
+
275
+ - empty agents showing `0/0 files`
276
+ - empty agents showing `no memory files found`
277
+ - one or two very large session logs taking much longer than the rest
278
+
279
+ ## Reference
280
+
281
+ Read [host-readiness.md](references/host-readiness.md) for the generic install and readiness path.
282
+ Read [case-study-macpro.md](references/case-study-macpro.md) only as one measured example on an older machine.