@basicmemory/openclaw-basic-memory 0.24.1 → 1.1.0

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 (93) hide show
  1. package/README.md +28 -16
  2. package/bm-client.ts +461 -140
  3. package/commands/cli.ts +5 -6
  4. package/commands/slash.ts +4 -4
  5. package/config.ts +5 -0
  6. package/context-engine/basic-memory-context-engine.ts +74 -9
  7. package/context-engine/types.ts +21 -0
  8. package/dist/bm-client.d.ts +101 -32
  9. package/dist/bm-client.js +346 -108
  10. package/dist/commands/cli.d.ts +1 -1
  11. package/dist/commands/cli.js +5 -5
  12. package/dist/commands/slash.d.ts +1 -1
  13. package/dist/commands/slash.js +4 -3
  14. package/dist/config.d.ts +1 -0
  15. package/dist/config.js +1 -0
  16. package/dist/context-engine/basic-memory-context-engine.d.ts +20 -1
  17. package/dist/context-engine/basic-memory-context-engine.js +50 -2
  18. package/dist/context-engine/types.d.ts +9 -0
  19. package/dist/context-engine/types.js +1 -0
  20. package/dist/index.d.ts +10 -4
  21. package/dist/index.js +78 -69
  22. package/dist/memory/basic-memory-capability.d.ts +19 -0
  23. package/dist/memory/basic-memory-capability.js +196 -0
  24. package/dist/tools/build-context.d.ts +1 -1
  25. package/dist/tools/build-context.js +12 -4
  26. package/dist/tools/delete-note.d.ts +1 -1
  27. package/dist/tools/delete-note.js +2 -1
  28. package/dist/tools/edit-note.d.ts +1 -1
  29. package/dist/tools/edit-note.js +22 -12
  30. package/dist/tools/list-memory-projects.d.ts +1 -1
  31. package/dist/tools/list-memory-projects.js +2 -1
  32. package/dist/tools/list-workspaces.d.ts +1 -1
  33. package/dist/tools/list-workspaces.js +4 -4
  34. package/dist/tools/move-note.d.ts +1 -1
  35. package/dist/tools/move-note.js +2 -1
  36. package/dist/tools/read-note.d.ts +1 -1
  37. package/dist/tools/read-note.js +2 -1
  38. package/dist/tools/schema-diff.d.ts +1 -1
  39. package/dist/tools/schema-diff.js +7 -4
  40. package/dist/tools/schema-infer.d.ts +1 -1
  41. package/dist/tools/schema-infer.js +3 -2
  42. package/dist/tools/schema-validate.d.ts +1 -1
  43. package/dist/tools/schema-validate.js +7 -5
  44. package/dist/tools/search-notes.d.ts +1 -1
  45. package/dist/tools/search-notes.js +13 -6
  46. package/dist/tools/write-note.d.ts +1 -1
  47. package/dist/tools/write-note.js +11 -12
  48. package/index.ts +92 -84
  49. package/memory/basic-memory-capability.ts +259 -0
  50. package/openclaw.plugin.json +1 -3
  51. package/package.json +6 -5
  52. package/scripts/setup-bm.sh +1 -4
  53. package/skills/manifest.json +10 -5
  54. package/skills/memory-agents/SKILL.md +23 -10
  55. package/skills/memory-capture/SKILL.md +29 -18
  56. package/skills/memory-comark/SKILL.md +17 -6
  57. package/skills/memory-continue/SKILL.md +47 -27
  58. package/skills/memory-curate/SKILL.md +40 -24
  59. package/skills/memory-defrag/SKILL.md +18 -7
  60. package/skills/memory-doctor/SKILL.md +93 -0
  61. package/skills/memory-ingest/SKILL.md +35 -18
  62. package/skills/memory-lifecycle/SKILL.md +35 -22
  63. package/skills/memory-literary-analysis/SKILL.md +112 -75
  64. package/skills/memory-metadata-search/SKILL.md +39 -28
  65. package/skills/memory-notes/SKILL.md +75 -50
  66. package/skills/memory-okf/SKILL.md +27 -15
  67. package/skills/memory-quest/SKILL.md +24 -8
  68. package/skills/memory-reflect/SKILL.md +25 -13
  69. package/skills/memory-research/SKILL.md +28 -13
  70. package/skills/memory-schema/SKILL.md +36 -24
  71. package/skills/memory-start/SKILL.md +116 -0
  72. package/skills/memory-tasks/SKILL.md +34 -22
  73. package/tools/build-context.ts +14 -5
  74. package/tools/delete-note.ts +2 -2
  75. package/tools/edit-note.ts +27 -14
  76. package/tools/list-memory-projects.ts +6 -2
  77. package/tools/list-workspaces.ts +8 -5
  78. package/tools/move-note.ts +2 -2
  79. package/tools/read-note.ts +2 -2
  80. package/tools/schema-diff.ts +9 -5
  81. package/tools/schema-infer.ts +3 -3
  82. package/tools/schema-validate.ts +7 -6
  83. package/tools/search-notes.ts +18 -7
  84. package/tools/write-note.ts +12 -12
  85. package/dist/tools/memory-provider.d.ts +0 -15
  86. package/dist/tools/memory-provider.js +0 -275
  87. package/skills/memory-onboarding/SKILL.md +0 -142
  88. package/skills/memory-onboarding/evals/evals.json +0 -29
  89. package/skills/memory-onboarding/references/assistant-setup.md +0 -72
  90. package/skills/memory-onboarding/references/conventions.md +0 -118
  91. package/skills/memory-onboarding/references/domain-playbooks.md +0 -159
  92. package/skills/memory-onboarding/references/schema-guide.md +0 -136
  93. package/tools/memory-provider.ts +0 -336
package/README.md CHANGED
@@ -33,7 +33,7 @@ This plugin connects Basic Memory to OpenClaw so your agent can:
33
33
  - **Remember across sessions** — search and recall past conversations, decisions, and context
34
34
  - **Track work in progress** — structured tasks that survive context compaction
35
35
  - **Build knowledge over time** — notes, observations, and relations that grow into a connected graph
36
- - **Search intelligently** — composited search across working memory, the knowledge graph, and active tasks in parallel
36
+ - **Search intelligently** — hybrid full-text and vector search across the knowledge graph
37
37
 
38
38
  All data stays on your machine as Markdown files indexed locally with SQLite. Cloud sync is available but entirely optional.
39
39
 
@@ -53,10 +53,18 @@ Then install the plugin:
53
53
 
54
54
  ```bash
55
55
  openclaw plugins install @basicmemory/openclaw-basic-memory
56
- openclaw plugins enable openclaw-basic-memory --slot memory
56
+ openclaw config set plugins.slots.memory openclaw-basic-memory
57
+ openclaw config set plugins.slots.contextEngine openclaw-basic-memory
57
58
  openclaw gateway restart
58
59
  ```
59
60
 
61
+ The plugin fills two OpenClaw slots, and each one does a different job:
62
+
63
+ - **`memory`** registers Basic Memory as OpenClaw's memory provider: gateway memory search and status, `openclaw doctor` health, Active Memory recall, and the pre-compaction memory flush.
64
+ - **`contextEngine`** runs automatic recall at session start and automatic conversation capture after each turn. **Without this slot, nothing is captured or recalled automatically**; the agent only remembers what it saves with an explicit tool call.
65
+
66
+ Tested with OpenClaw 2026.10.9. OpenClaw 2026.10 and later require context engines to commit turns through `commitTurn`, which this plugin implements; older plugin versions are degraded to OpenClaw's legacy engine on those hosts and capture nothing.
67
+
60
68
  That's it. The plugin auto-installs the `bm` CLI on first startup if it's not already on your PATH. See [SECURITY.md](./SECURITY.md) for details on how this works.
61
69
 
62
70
  Verify:
@@ -80,7 +88,8 @@ openclaw plugins doctor
80
88
  }
81
89
  },
82
90
  slots: {
83
- memory: "openclaw-basic-memory"
91
+ memory: "openclaw-basic-memory",
92
+ contextEngine: "openclaw-basic-memory"
84
93
  }
85
94
  }
86
95
  }
@@ -98,7 +107,7 @@ This uses sensible defaults: auto-generated project name, maps to your workspace
98
107
  enabled: true,
99
108
  config: {
100
109
  project: "my-agent", // BM project name (default: "openclaw-{hostname}")
101
- projectPath: ".", // Project directory (default: workspace root)
110
+ projectPath: ".", // Project directory (default: workspace root, or an existing project's folder)
102
111
  memoryDir: "memory/", // Where task notes live
103
112
  memoryFile: "MEMORY.md", // Working memory file
104
113
  autoCapture: true, // Record conversations as daily notes
@@ -108,7 +117,8 @@ This uses sensible defaults: auto-generated project name, maps to your workspace
108
117
  }
109
118
  },
110
119
  slots: {
111
- memory: "openclaw-basic-memory"
120
+ memory: "openclaw-basic-memory",
121
+ contextEngine: "openclaw-basic-memory"
112
122
  }
113
123
  }
114
124
  }
@@ -118,7 +128,7 @@ This uses sensible defaults: auto-generated project name, maps to your workspace
118
128
  |--------|---------|-------------|
119
129
  | `project` | `"openclaw-{hostname}"` | Basic Memory project name |
120
130
  | `bmPath` | `"bm"` | Path to BM CLI binary |
121
- | `projectPath` | `"."` | Project data directory |
131
+ | `projectPath` | `"."` | Project data directory, relative to the workspace or absolute. When unset and a project named `project` already exists, the plugin uses that project's stored folder. When set, it must match the stored folder; otherwise Basic Memory refuses the project and the plugin logs where it is stored |
122
132
  | `memoryDir` | `"memory/"` | Relative path for task scanning |
123
133
  | `memoryFile` | `"MEMORY.md"` | Working memory file for text search |
124
134
  | `autoCapture` | `true` | Auto-index agent conversations |
@@ -131,13 +141,17 @@ This uses sensible defaults: auto-generated project name, maps to your workspace
131
141
 
132
142
  ### Memory search
133
143
 
134
- When your agent calls `memory_search`, three sources are queried in parallel:
144
+ Agents search Basic Memory with `search_notes` and read results with `read_note`. The plugin adds a short system-prompt section that points the agent at these tools.
145
+
146
+ OpenClaw's built-in `memory_search` and `memory_get` tools belong to its bundled Memory Core plugin, which OpenClaw keeps loaded even when this plugin holds the memory slot. Those tools search only the workspace `MEMORY.md` and `memory/` files, not Basic Memory.
147
+
148
+ As the memory slot owner, the plugin also serves OpenClaw's own memory consumers:
135
149
 
136
- 1. **MEMORY.md** — text search with surrounding context
137
- 2. **Knowledge Graph** — hybrid full-text + vector search across all indexed notes
138
- 3. **Active Tasks** — scans `memory/tasks/` for in-progress work
150
+ - **Gateway memory search, get and status, and `openclaw doctor`** read Basic Memory through the plugin's provider runtime.
151
+ - **Active Memory deep recall** uses `search_notes`, `read_note` and `build_context`.
152
+ - **Pre-compaction flush** saves durable context with `write_note` and `edit_note` instead of appending to a workspace file.
139
153
 
140
- Results come back in clear sections so the agent knows where each piece of context came from.
154
+ Search scores are shown as raw numbers. A score above 1 means the note matched on both keywords and meaning.
141
155
 
142
156
  ### Auto-recall
143
157
 
@@ -145,7 +159,7 @@ On each session start, the plugin loads active tasks and recently modified notes
145
159
 
146
160
  ### Auto-capture
147
161
 
148
- After each conversation turn, the plugin records the exchange as a timestamped entry in a daily note. This builds a searchable history of everything your agent has discussed.
162
+ After each conversation turn, the plugin records the exchange as a timestamped entry in a daily note. This builds a searchable history of everything your agent has discussed. Capture requires the `contextEngine` slot. Each entry carries a hidden `<!-- openclaw-turn:... -->` marker so a turn OpenClaw retries after a crash is recorded only once.
149
163
 
150
164
  ### Persistent connection
151
165
 
@@ -157,8 +171,6 @@ All tools accept an optional `project` parameter for cross-project operations.
157
171
 
158
172
  | Tool | Description |
159
173
  |------|-------------|
160
- | `memory_search` | Composited search across all memory sources |
161
- | `memory_get` | Read a specific note by title or path |
162
174
  | `search_notes` | Search the knowledge graph directly |
163
175
  | `read_note` | Read a note by title, permalink, or `memory://` URL |
164
176
  | `write_note` | Create or overwrite a note with optional tags, note type, and custom frontmatter metadata |
@@ -222,10 +234,10 @@ These skills ship with the plugin — no installation needed:
222
234
  - **memory-metadata-search** — query notes by frontmatter fields
223
235
  - **memory-notes** — guidance for writing well-structured notes
224
236
  - **memory-okf** — make a project ready for OKF export
225
- - **memory-onboarding** — guided setup of a new knowledge system
226
237
  - **memory-reflect** — periodic consolidation of recent notes into durable memory
227
238
  - **memory-research** — research synthesis into durable notes
228
239
  - **memory-schema** — schema lifecycle (infer, create, validate, diff)
240
+ - **memory-start** — a new user's first session: save one note, see it, get it back
229
241
  - **memory-tasks** — structured task tracking that survives context compaction
230
242
 
231
243
  ### Updating skills
@@ -272,7 +284,7 @@ Cloud extends local-first — still plain Markdown, still yours. [Start a free t
272
284
 
273
285
  ## Troubleshooting
274
286
 
275
- **`bm` not found** — Install uv, then restart the gateway. Or install manually: `uv tool install basic-memory --prerelease=allow` (the flag is required — basic-memory depends on a FastMCP pre-release, and without it uv silently installs an older release)
287
+ **`bm` not found** — Install uv, then restart the gateway. Or install manually: `uv tool install basic-memory`
276
288
 
277
289
  **Search returns nothing** — Check that Basic Memory connected (look for `connected to BM` in logs). Verify files exist in the project directory.
278
290