@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
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: memory-doctor
3
+ description: "Check local Basic Memory projects with bm doctor, explain the findings, and run the suggested fixes once the user agrees. Use when search misses or repeats notes, or a save looks lost."
4
+ ---
5
+
6
+ # Memory Doctor
7
+
8
+ `bm doctor` checks the user's local Basic Memory projects and reports what is
9
+ wrong. Each problem comes with the command that fixes it, when one exists.
10
+ Doctor's checks only read; they never change a project's notes or index. The
11
+ fixes it suggests do change things, so run them only after the user agrees.
12
+
13
+ This skill needs a shell with the `bm` (or `basic-memory`) command.
14
+
15
+ ## When to Use
16
+
17
+ - Search misses a note the user knows exists, or returns the same note twice
18
+ - A note was saved but its file did not change, or the reverse
19
+ - The user asks whether Basic Memory is working, or to "check" or "fix" it
20
+ - After a crash, an interrupted import, or moving a project's folder
21
+
22
+ ## Run It
23
+
24
+ Start with the report alone. It is fast and has a stable JSON shape:
25
+
26
+ ```bash
27
+ bm doctor --skip-self-test --json
28
+ ```
29
+
30
+ Add `--project NAME` to check one project. Without `--skip-self-test`, doctor
31
+ also runs a self-test: it writes, indexes and searches a note in a throwaway
32
+ sandbox, which takes a few seconds and proves the install itself works. Run it
33
+ when the report is clean but something still seems broken.
34
+
35
+ ## Read the Report
36
+
37
+ ```json
38
+ {
39
+ "projects": [
40
+ {
41
+ "name": "work",
42
+ "findings": [
43
+ {
44
+ "check": "search_index",
45
+ "severity": "error",
46
+ "summary": "1 search row does not match a current note, observation or relation.",
47
+ "evidence": ["entity id=99, entity_id=99"],
48
+ "action": {"kind": "reindex_search", "full": true},
49
+ "command": "bm reindex --search --full --project work"
50
+ }
51
+ ],
52
+ "has_errors": true
53
+ }
54
+ ],
55
+ "skipped_cloud_projects": ["research"],
56
+ "self_test": {"outcome": "skipped"},
57
+ "has_errors": true
58
+ }
59
+ ```
60
+
61
+ | Severity | Meaning | What to do |
62
+ |---|---|---|
63
+ | `error` | Will not go away without a fix | Offer the `command`; if it is null, explain the evidence |
64
+ | `warning` | Needs attention, may recover on its own | Offer the `command` if there is one |
65
+ | `info` | Expected while work is in progress | Mention it; a running server finishes it, and the `command` finishes it now |
66
+
67
+ Indexing catches up in the background. A duplicate, missing or extra search row
68
+ is a `warning` while file indexing is still running, because the pass may clear
69
+ it, and becomes an `error` once indexing has settled. If the report has only `info` findings, nothing is wrong. When no
70
+ Basic Memory server is running, nothing indexes in the background, so offer the
71
+ `command` on an `info` finding too.
72
+
73
+ Cloud projects are listed under `skipped_cloud_projects`: they are indexed on the
74
+ server, and local commands cannot fix them.
75
+
76
+ ## Fix
77
+
78
+ 1. Summarize the findings for the user in plain words: which project, what is
79
+ wrong, and what the fix does. Group findings that share a command.
80
+ 2. Show each `command` exactly as doctor printed it and ask before running it.
81
+ `bm reindex --search --full` re-reads every file in the project and can take
82
+ a while on a large one.
83
+ 3. Run the commands the user approves.
84
+ 4. Run `bm doctor --skip-self-test --json` again and confirm the findings are gone.
85
+
86
+ When a finding has no `command`, do not invent one. Say what the evidence shows
87
+ (for example, which files changed on disk while a newer save was waiting) and
88
+ let the user decide.
89
+
90
+ ## Exit Codes
91
+
92
+ `bm doctor` exits 0 when there are no errors and the self-test passed (or was
93
+ skipped), and 1 otherwise. Warnings and info never fail it.
@@ -7,6 +7,17 @@ description: "Turn meeting transcripts, conversation logs, or pasted documents i
7
7
 
8
8
  Turn raw, unstructured input into structured Basic Memory entities. Meeting transcripts, conversation logs, pasted documents, email threads — anything with information worth preserving gets parsed, cross-referenced against existing knowledge, and written as proper notes.
9
9
 
10
+ ## Project scope
11
+
12
+ If the project is unknown, discover it with `bm_project_list()`.
13
+ Pass a nonempty `project` on every note, folder, context and schema call, even
14
+ with one project or a qualified `memory://` URL. Use the chosen project's name,
15
+ `workspace/project`, or external ID; `<project>` below is a placeholder for it.
16
+ Recent activity also requires `project`. Search accepts `project` for one
17
+ project, `projects` for selected projects, or `all_projects=True` explicitly.
18
+ Discovery and bundled manuals need no project. Keep the same scope when following
19
+ returned paths, paginating, or recovering from a refusal.
20
+
10
21
  ## When to Use
11
22
 
12
23
  - User pastes a meeting transcript or conversation log
@@ -70,16 +81,16 @@ For each extracted entity, search Basic Memory with multiple query variations:
70
81
 
71
82
  ```python
72
83
  # Person — try full name, last name
73
- search_notes(query="Sarah Chen")
74
- search_notes(query="Chen")
84
+ bm_search(query="Sarah Chen", project="<project>")
85
+ bm_search(query="Chen", project="<project>")
75
86
 
76
87
  # Organization — try full name, abbreviation, acronym
77
- search_notes(query="National Renewable Energy Laboratory")
78
- search_notes(query="NREL")
88
+ bm_search(query="National Renewable Energy Laboratory", project="<project>")
89
+ bm_search(query="NREL", project="<project>")
79
90
 
80
91
  # Topic — try the full term and keywords
81
- search_notes(query="edge computing")
82
- search_notes(query="edge inference")
92
+ bm_search(query="edge computing", project="<project>")
93
+ bm_search(query="edge inference", project="<project>")
83
94
  ```
84
95
 
85
96
  Classify each entity as:
@@ -124,7 +135,7 @@ Create the primary note for the ingested content. This is the "record of what ha
124
135
  ### Meeting / Conversation Note
125
136
 
126
137
  ```python
127
- write_note(
138
+ bm_write(
128
139
  title="NovaTech Meeting - Jordan Rivera - Feb 22, 2026",
129
140
  directory="meetings/2026",
130
141
  note_type="meeting",
@@ -150,14 +161,15 @@ Brief one-sentence summary of what this meeting was about.
150
161
  - with [[NovaTech]]
151
162
  - discussed [[Federated Learning]]
152
163
  - follow_up [[Send NovaTech Technical Spec]]
153
- """
164
+ """,
165
+ project="<project>",
154
166
  )
155
167
  ```
156
168
 
157
169
  ### Document / Article Note
158
170
 
159
171
  ```python
160
- write_note(
172
+ bm_write(
161
173
  title="Edge Computing Architecture Whitepaper",
162
174
  directory="references",
163
175
  note_type="reference",
@@ -177,7 +189,8 @@ write_note(
177
189
  ## Relations
178
190
  - relates_to [[Edge Computing]]
179
191
  - relates_to [[Model Optimization]]
180
- """
192
+ """,
193
+ project="<project>",
181
194
  )
182
195
  ```
183
196
 
@@ -204,13 +217,14 @@ Invent categories as needed — these are suggestions, not a fixed list.
204
217
 
205
218
  For each entity the user approved, create a structured note. Match the entity type to an appropriate template.
206
219
 
207
- If `write_note` reports similar existing notes, treat that as a match Step 3 missed: merge into
208
- the existing note and delete the new one, or link the two.
220
+ If `bm_write` reports similar existing notes, treat that as a match Step 3 missed. Ask the
221
+ user whether to merge the new note into the existing one or link the two, and keep both
222
+ notes until they decide.
209
223
 
210
224
  ### Person
211
225
 
212
226
  ```python
213
- write_note(
227
+ bm_write(
214
228
  title="Jordan Rivera",
215
229
  directory="people",
216
230
  note_type="person",
@@ -232,14 +246,15 @@ VP of Engineering at NovaTech. Met during integration partnership discussion.
232
246
  ## Relations
233
247
  - works_at [[NovaTech]]
234
248
  - discussed_in [[NovaTech Meeting - Jordan Rivera - Feb 22, 2026]]
235
- """
249
+ """,
250
+ project="<project>",
236
251
  )
237
252
  ```
238
253
 
239
254
  ### Organization
240
255
 
241
256
  ```python
242
- write_note(
257
+ bm_write(
243
258
  title="NovaTech",
244
259
  directory="organizations",
245
260
  note_type="organization",
@@ -262,14 +277,15 @@ SaaS platform company. Series B stage.
262
277
  ## Relations
263
278
  - employs [[Jordan Rivera]]
264
279
  - discussed_in [[NovaTech Meeting - Jordan Rivera - Feb 22, 2026]]
265
- """
280
+ """,
281
+ project="<project>",
266
282
  )
267
283
  ```
268
284
 
269
285
  ### Concept / Topic
270
286
 
271
287
  ```python
272
- write_note(
288
+ bm_write(
273
289
  title="Federated Learning",
274
290
  directory="concepts",
275
291
  note_type="concept",
@@ -286,7 +302,8 @@ write_note(
286
302
 
287
303
  ## Relations
288
304
  - discussed_in [[NovaTech Meeting - Jordan Rivera - Feb 22, 2026]]
289
- """
305
+ """,
306
+ project="<project>",
290
307
  )
291
308
  ```
292
309
 
@@ -7,6 +7,17 @@ description: "Manage note status transitions in Basic Memory: archive completed
7
7
 
8
8
  Manage how entities move through status stages in Basic Memory. The core principle: **archive, never delete.** Completed work is valuable context — move it out of the active view, but keep it in the knowledge graph.
9
9
 
10
+ ## Project scope
11
+
12
+ If the project is unknown, discover it with `bm_project_list()`.
13
+ Pass a nonempty `project` on every note, folder, context and schema call, even
14
+ with one project or a qualified `memory://` URL. Use the chosen project's name,
15
+ `workspace/project`, or external ID; `<project>` below is a placeholder for it.
16
+ Recent activity also requires `project`. Search accepts `project` for one
17
+ project, `projects` for selected projects, or `all_projects=True` explicitly.
18
+ Discovery and bundled manuals need no project. Keep the same scope when following
19
+ returned paths, paginating, or recovering from a refusal.
20
+
10
21
  ## When to Use
11
22
 
12
23
  - User says something is "done", "finished", "completed", "submitted", "missed", or "cancelled"
@@ -20,10 +31,10 @@ Deleting a note removes it from the knowledge graph — its observations and rel
20
31
 
21
32
  ```
22
33
  # Good — entity stays in the knowledge graph
23
- move_note → active/ to archive/
34
+ bm_move → active/ to archive/
24
35
 
25
36
  # Bad — knowledge is lost
26
- delete_note
37
+ bm_delete
27
38
  ```
28
39
 
29
40
  The only exception: notes created by mistake (typos, true duplicates) can be deleted.
@@ -77,8 +88,8 @@ When the user mentions completion or status change, extract the intent:
77
88
  Search Basic Memory with multiple variations to locate the entity:
78
89
 
79
90
  ```python
80
- search_notes(query="quarterly report")
81
- search_notes(query="Q1 report")
91
+ bm_search(query="quarterly report", project="<project>")
92
+ bm_search(query="Q1 report", project="<project>")
82
93
  ```
83
94
 
84
95
  If multiple matches come back, present options and ask which one.
@@ -87,12 +98,13 @@ If no match is found, ask for clarification — don't guess.
87
98
 
88
99
  ### 2. Move the File
89
100
 
90
- Use `move_note` to relocate the entity to the appropriate status folder:
101
+ Use `bm_move` to relocate the entity to the appropriate status folder:
91
102
 
92
103
  ```python
93
- move_note(
104
+ bm_move(
94
105
  identifier="tasks/active/quarterly-report",
95
- destination_path="tasks/completed/quarterly-report.md"
106
+ destination="tasks/completed/quarterly-report.md",
107
+ project="<project>",
96
108
  )
97
109
  ```
98
110
 
@@ -101,15 +113,15 @@ By default the permalink stays the same after a move, so links keep resolving. P
101
113
  ### 3. Update Frontmatter
102
114
 
103
115
  After moving, merge the new status (and completion date, if the type tracks one) into
104
- frontmatter with the `metadata` parameter. An `append` with empty `content` changes only
105
- the frontmatter:
116
+ frontmatter with `command="set_metadata"` and the `metadata` parameter; this leaves
117
+ the body unchanged:
106
118
 
107
119
  ```python
108
- edit_note(
109
- identifier="quarterly-report",
110
- operation="append",
111
- content="",
112
- metadata={"status": "completed", "completed": "2026-02-22"}
120
+ bm_edit(
121
+ identifier="tasks/completed/quarterly-report.md",
122
+ command="set_metadata",
123
+ metadata={"status": "completed", "completed": "2026-02-22"},
124
+ project="<project>",
113
125
  )
114
126
  ```
115
127
 
@@ -149,16 +161,17 @@ status is unchanged. Only the user can unlock it, by editing the file.
149
161
  If something was archived by mistake, move it back:
150
162
 
151
163
  ```python
152
- move_note(
164
+ bm_move(
153
165
  identifier="tasks/completed/quarterly-report",
154
- destination_path="tasks/active/quarterly-report.md"
166
+ destination="tasks/active/quarterly-report.md",
167
+ project="<project>",
155
168
  )
156
169
 
157
- edit_note(
158
- identifier="quarterly-report",
159
- operation="append",
160
- content="",
161
- metadata={"status": "active"}
170
+ bm_edit(
171
+ identifier="tasks/active/quarterly-report.md",
172
+ command="set_metadata",
173
+ metadata={"status": "active"},
174
+ project="<project>",
162
175
  )
163
176
  ```
164
177
 
@@ -176,7 +189,7 @@ Some status changes don't require a folder move — "paused" or "blocked" items
176
189
 
177
190
  - **Archive, never delete.** The knowledge graph benefits from historical context.
178
191
  - **Move first, then update frontmatter.** This order ensures the file is in the right place even if the edit step fails.
179
- - **Permalinks survive moves by default.** Links to the entity keep working after a `move_note` unless the project enables `update_permalinks_on_move`.
192
+ - **Permalinks survive moves by default.** Links to the entity keep working after a `bm_move` unless the project enables `update_permalinks_on_move`.
180
193
  - **Be concise in confirmations.** The user knows their system — just report what changed.
181
194
  - **Ask when ambiguous.** If multiple entities match or the target folder isn't clear, ask rather than guess.
182
195
  - **Batch operations are fine.** If the user says "archive all completed tasks", find them all, confirm the list, then move them in sequence.