@basicmemory/openclaw-basic-memory 0.24.0 → 1.0.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 (87) hide show
  1. package/README.md +24 -12
  2. package/bm-client.ts +302 -112
  3. package/commands/cli.ts +5 -6
  4. package/commands/slash.ts +4 -4
  5. package/context-engine/basic-memory-context-engine.ts +74 -9
  6. package/context-engine/types.ts +21 -0
  7. package/dist/bm-client.d.ts +61 -12
  8. package/dist/bm-client.js +250 -101
  9. package/dist/commands/cli.d.ts +1 -1
  10. package/dist/commands/cli.js +5 -5
  11. package/dist/commands/slash.d.ts +1 -1
  12. package/dist/commands/slash.js +4 -3
  13. package/dist/context-engine/basic-memory-context-engine.d.ts +20 -1
  14. package/dist/context-engine/basic-memory-context-engine.js +50 -2
  15. package/dist/context-engine/types.d.ts +9 -0
  16. package/dist/context-engine/types.js +1 -0
  17. package/dist/index.d.ts +10 -4
  18. package/dist/index.js +79 -69
  19. package/dist/memory/basic-memory-capability.d.ts +19 -0
  20. package/dist/memory/basic-memory-capability.js +190 -0
  21. package/dist/tools/build-context.d.ts +1 -1
  22. package/dist/tools/build-context.js +12 -4
  23. package/dist/tools/delete-note.d.ts +1 -1
  24. package/dist/tools/delete-note.js +2 -1
  25. package/dist/tools/edit-note.d.ts +1 -1
  26. package/dist/tools/edit-note.js +22 -12
  27. package/dist/tools/list-memory-projects.d.ts +1 -1
  28. package/dist/tools/list-memory-projects.js +2 -1
  29. package/dist/tools/list-workspaces.d.ts +1 -1
  30. package/dist/tools/list-workspaces.js +4 -4
  31. package/dist/tools/move-note.d.ts +1 -1
  32. package/dist/tools/move-note.js +2 -1
  33. package/dist/tools/read-note.d.ts +1 -1
  34. package/dist/tools/read-note.js +2 -1
  35. package/dist/tools/schema-diff.d.ts +1 -1
  36. package/dist/tools/schema-diff.js +2 -1
  37. package/dist/tools/schema-infer.d.ts +1 -1
  38. package/dist/tools/schema-infer.js +2 -1
  39. package/dist/tools/schema-validate.d.ts +1 -1
  40. package/dist/tools/schema-validate.js +2 -1
  41. package/dist/tools/search-notes.d.ts +1 -1
  42. package/dist/tools/search-notes.js +13 -6
  43. package/dist/tools/write-note.d.ts +1 -1
  44. package/dist/tools/write-note.js +11 -12
  45. package/index.ts +93 -84
  46. package/memory/basic-memory-capability.ts +253 -0
  47. package/openclaw.plugin.json +0 -2
  48. package/package.json +6 -5
  49. package/skills/manifest.json +5 -0
  50. package/skills/memory-agents/SKILL.md +23 -10
  51. package/skills/memory-capture/SKILL.md +29 -18
  52. package/skills/memory-comark/SKILL.md +17 -6
  53. package/skills/memory-continue/SKILL.md +47 -27
  54. package/skills/memory-curate/SKILL.md +40 -24
  55. package/skills/memory-defrag/SKILL.md +18 -7
  56. package/skills/memory-doctor/SKILL.md +93 -0
  57. package/skills/memory-ingest/SKILL.md +33 -17
  58. package/skills/memory-lifecycle/SKILL.md +35 -22
  59. package/skills/memory-literary-analysis/SKILL.md +112 -75
  60. package/skills/memory-metadata-search/SKILL.md +39 -28
  61. package/skills/memory-notes/SKILL.md +75 -50
  62. package/skills/memory-okf/SKILL.md +27 -15
  63. package/skills/memory-onboarding/SKILL.md +20 -9
  64. package/skills/memory-onboarding/references/assistant-setup.md +1 -1
  65. package/skills/memory-onboarding/references/conventions.md +4 -4
  66. package/skills/memory-onboarding/references/domain-playbooks.md +1 -1
  67. package/skills/memory-onboarding/references/schema-guide.md +9 -8
  68. package/skills/memory-quest/SKILL.md +18 -7
  69. package/skills/memory-reflect/SKILL.md +25 -13
  70. package/skills/memory-research/SKILL.md +28 -13
  71. package/skills/memory-schema/SKILL.md +36 -24
  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 +2 -2
  81. package/tools/schema-infer.ts +2 -2
  82. package/tools/schema-validate.ts +2 -2
  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/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
  }
@@ -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
  }
@@ -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 |