clawvault 3.0.0 → 3.2.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 (291) hide show
  1. package/README.md +352 -20
  2. package/bin/clawvault.js +8 -2
  3. package/bin/command-registration.test.js +3 -1
  4. package/bin/command-runtime.js +9 -1
  5. package/bin/register-core-commands.js +23 -10
  6. package/bin/register-maintenance-commands.js +39 -3
  7. package/bin/register-query-commands.js +58 -29
  8. package/bin/register-task-commands.js +18 -1
  9. package/bin/register-task-commands.test.js +16 -0
  10. package/bin/register-vault-operations-commands.js +29 -1
  11. package/bin/register-workgraph-commands.js +1368 -0
  12. package/dashboard/lib/graph-diff.js +104 -0
  13. package/dashboard/lib/graph-diff.test.js +75 -0
  14. package/dashboard/lib/vault-parser.js +556 -0
  15. package/dashboard/lib/vault-parser.test.js +254 -0
  16. package/dashboard/public/app.js +796 -0
  17. package/dashboard/public/index.html +52 -0
  18. package/dashboard/public/styles.css +221 -0
  19. package/dashboard/server.js +374 -0
  20. package/dist/{chunk-F2JEUD4J.js → chunk-23YDQ3QU.js} +6 -8
  21. package/dist/{chunk-C7OK5WKP.js → chunk-2JQ3O2YL.js} +4 -4
  22. package/dist/{chunk-VR5NE7PZ.js → chunk-2RAZ4ZFE.js} +1 -1
  23. package/dist/chunk-2ZDO52B4.js +52 -0
  24. package/dist/{chunk-ZZA73MFY.js → chunk-33DOSHTA.js} +176 -36
  25. package/dist/chunk-33VSQP4J.js +37 -0
  26. package/dist/chunk-4BQTQMJP.js +93 -0
  27. package/dist/{chunk-GUKMRGM7.js → chunk-4OXMU5S2.js} +1 -1
  28. package/dist/{chunk-62YTUT6J.js → chunk-4PY655YM.js} +15 -3
  29. package/dist/chunk-6FH3IULF.js +352 -0
  30. package/dist/{chunk-3NSBOUT3.js → chunk-77Q5CSPJ.js} +404 -80
  31. package/dist/{chunk-4VQTUVH7.js → chunk-7YZWHM36.js} +52 -26
  32. package/dist/chunk-BSJ6RIT7.js +447 -0
  33. package/dist/chunk-BUEW6IIK.js +364 -0
  34. package/dist/{chunk-WGRQ6HDV.js → chunk-CLJTREDS.js} +74 -14
  35. package/dist/chunk-EK6S23ZB.js +469 -0
  36. package/dist/{chunk-LNJA2UGL.js → chunk-ESFLMDRB.js} +9 -86
  37. package/dist/{chunk-H34S76MB.js → chunk-ESVS6K2B.js} +6 -6
  38. package/dist/{chunk-WAZ3NLWL.js → chunk-F55HGNU4.js} +0 -47
  39. package/dist/{chunk-QK3UCXWL.js → chunk-FHFUXL6G.js} +2 -2
  40. package/dist/{chunk-YKTA5JOJ.js → chunk-GAOWA7GR.js} +212 -46
  41. package/dist/chunk-GGA32J2R.js +784 -0
  42. package/dist/chunk-GNJL4YGR.js +79 -0
  43. package/dist/chunk-MDIH26GC.js +183 -0
  44. package/dist/{chunk-LYHGEHXG.js → chunk-MFAWT5O5.js} +0 -1
  45. package/dist/chunk-MM6QGW3P.js +207 -0
  46. package/dist/{chunk-P5EPF6MB.js → chunk-MW5C6ZQA.js} +110 -13
  47. package/dist/chunk-NCKFNBHJ.js +257 -0
  48. package/dist/{chunk-QBLMXKF2.js → chunk-OIWVQYQF.js} +1 -1
  49. package/dist/{chunk-42MXU7A6.js → chunk-P62WHA27.js} +58 -47
  50. package/dist/chunk-PBACDKKP.js +66 -0
  51. package/dist/{chunk-VGLOTGAS.js → chunk-QSHD36LH.js} +2 -2
  52. package/dist/{chunk-OZ7RIXTO.js → chunk-QSRRMEYM.js} +2 -2
  53. package/dist/chunk-QVEERJSP.js +152 -0
  54. package/dist/{chunk-N2AXRYLC.js → chunk-QWQ3TIKS.js} +1 -1
  55. package/dist/{chunk-3DHXQHYG.js → chunk-R2MIW5G7.js} +1 -1
  56. package/dist/{chunk-SJSFRIYS.js → chunk-SLXOR3CC.js} +2 -2
  57. package/dist/chunk-SS4B7P7V.js +99 -0
  58. package/dist/{chunk-JY6FYXIT.js → chunk-STCQGCEQ.js} +6 -11
  59. package/dist/chunk-U4O6C46S.js +154 -0
  60. package/dist/{chunk-ITPEXLHA.js → chunk-URXDAUVH.js} +24 -5
  61. package/dist/chunk-VSL7KY3M.js +189 -0
  62. package/dist/{chunk-U55BGUAU.js → chunk-W4SPAEE7.js} +6 -6
  63. package/dist/chunk-WMGIIABP.js +15 -0
  64. package/dist/{chunk-3D6BCTP6.js → chunk-X3SPPUFG.js} +51 -39
  65. package/dist/{chunk-THRJVD4L.js → chunk-Y6VJKXGL.js} +1 -1
  66. package/dist/{chunk-ZVVFWOLW.js → chunk-ZN54U2OZ.js} +123 -10
  67. package/dist/cli/index.js +32 -25
  68. package/dist/commands/archive.js +3 -3
  69. package/dist/commands/backlog.js +3 -3
  70. package/dist/commands/blocked.js +3 -3
  71. package/dist/commands/canvas.d.ts +15 -0
  72. package/dist/commands/canvas.js +200 -0
  73. package/dist/commands/checkpoint.js +2 -2
  74. package/dist/commands/compat.js +2 -2
  75. package/dist/commands/context.js +8 -6
  76. package/dist/commands/doctor.d.ts +11 -7
  77. package/dist/commands/doctor.js +18 -16
  78. package/dist/commands/embed.js +5 -6
  79. package/dist/commands/entities.js +2 -2
  80. package/dist/commands/graph.js +4 -4
  81. package/dist/commands/inject.d.ts +1 -1
  82. package/dist/commands/inject.js +5 -6
  83. package/dist/commands/kanban.js +4 -4
  84. package/dist/commands/link.js +5 -5
  85. package/dist/commands/migrate-observations.js +4 -4
  86. package/dist/commands/observe.d.ts +0 -1
  87. package/dist/commands/observe.js +14 -13
  88. package/dist/commands/project.js +5 -5
  89. package/dist/commands/rebuild-embeddings.d.ts +21 -0
  90. package/dist/commands/rebuild-embeddings.js +91 -0
  91. package/dist/commands/rebuild.js +12 -11
  92. package/dist/commands/recover.js +3 -3
  93. package/dist/commands/reflect.js +6 -7
  94. package/dist/commands/repair-session.js +1 -1
  95. package/dist/commands/replay.js +14 -14
  96. package/dist/commands/session-recap.js +1 -1
  97. package/dist/commands/setup.d.ts +2 -90
  98. package/dist/commands/setup.js +3 -21
  99. package/dist/commands/shell-init.js +1 -1
  100. package/dist/commands/sleep.d.ts +1 -1
  101. package/dist/commands/sleep.js +20 -19
  102. package/dist/commands/status.d.ts +2 -0
  103. package/dist/commands/status.js +57 -35
  104. package/dist/commands/sync-bd.d.ts +10 -0
  105. package/dist/commands/sync-bd.js +10 -0
  106. package/dist/commands/tailscale.js +3 -3
  107. package/dist/commands/task.js +4 -4
  108. package/dist/commands/template.js +2 -2
  109. package/dist/commands/wake.d.ts +1 -1
  110. package/dist/commands/wake.js +11 -10
  111. package/dist/commands/workgraph.d.ts +124 -0
  112. package/dist/commands/workgraph.js +38 -0
  113. package/dist/index.d.ts +337 -191
  114. package/dist/index.js +387 -118
  115. package/dist/{inject-Bzi5E-By.d.cts → inject-DYUrDqQO.d.ts} +3 -3
  116. package/dist/ledger-B7g7jhqG.d.ts +44 -0
  117. package/dist/lib/auto-linker.js +2 -2
  118. package/dist/lib/canvas-layout.d.ts +100 -16
  119. package/dist/lib/canvas-layout.js +21 -78
  120. package/dist/lib/config.d.ts +27 -3
  121. package/dist/lib/config.js +4 -2
  122. package/dist/lib/entity-index.js +1 -1
  123. package/dist/lib/project-utils.js +4 -4
  124. package/dist/lib/session-repair.js +1 -1
  125. package/dist/lib/session-utils.js +1 -1
  126. package/dist/lib/tailscale.js +1 -1
  127. package/dist/lib/task-utils.js +3 -3
  128. package/dist/lib/template-engine.js +1 -1
  129. package/dist/lib/webdav.js +1 -1
  130. package/dist/onnxruntime_binding-5QEF3SUC.node +0 -0
  131. package/dist/onnxruntime_binding-BKPKNEGC.node +0 -0
  132. package/dist/onnxruntime_binding-FMOXGIUT.node +0 -0
  133. package/dist/onnxruntime_binding-OI2KMXC5.node +0 -0
  134. package/dist/onnxruntime_binding-UX44MLAZ.node +0 -0
  135. package/dist/onnxruntime_binding-Y2W7N7WY.node +0 -0
  136. package/dist/openclaw-plugin.d.ts +8 -0
  137. package/dist/openclaw-plugin.js +14 -0
  138. package/dist/registry-BR4326o0.d.ts +30 -0
  139. package/dist/store-CA-6sKCJ.d.ts +34 -0
  140. package/dist/thread-B9LhXNU0.d.ts +41 -0
  141. package/dist/transformers.node-A2ZRORSQ.js +46775 -0
  142. package/dist/{types-Y2_Um2Ls.d.cts → types-BbWJoC1c.d.ts} +1 -44
  143. package/dist/workgraph/index.d.ts +5 -0
  144. package/dist/workgraph/index.js +23 -0
  145. package/dist/workgraph/ledger.d.ts +2 -0
  146. package/dist/workgraph/ledger.js +25 -0
  147. package/dist/workgraph/registry.d.ts +2 -0
  148. package/dist/workgraph/registry.js +19 -0
  149. package/dist/workgraph/store.d.ts +2 -0
  150. package/dist/workgraph/store.js +25 -0
  151. package/dist/workgraph/thread.d.ts +2 -0
  152. package/dist/workgraph/thread.js +25 -0
  153. package/dist/workgraph/types.d.ts +54 -0
  154. package/dist/workgraph/types.js +7 -0
  155. package/hooks/clawvault/HOOK.md +34 -4
  156. package/hooks/clawvault/handler.js +760 -78
  157. package/hooks/clawvault/handler.test.js +235 -79
  158. package/hooks/clawvault/openclaw.plugin.json +72 -0
  159. package/openclaw.plugin.json +65 -38
  160. package/package.json +15 -18
  161. package/dist/chunk-3RG5ZIWI.js +0 -10
  162. package/dist/chunk-6U6MK36V.js +0 -205
  163. package/dist/chunk-7R7O6STJ.js +0 -88
  164. package/dist/chunk-CMB7UL7C.js +0 -327
  165. package/dist/chunk-DEFFDRVP.js +0 -938
  166. package/dist/chunk-E7MFQB6D.js +0 -163
  167. package/dist/chunk-GAJV4IGR.js +0 -82
  168. package/dist/chunk-GQSLDZTS.js +0 -560
  169. package/dist/chunk-K234IDRJ.js +0 -1073
  170. package/dist/chunk-MFM6K7PU.js +0 -374
  171. package/dist/chunk-MXSSG3QU.js +0 -42
  172. package/dist/chunk-PAH27GSN.js +0 -108
  173. package/dist/cli/index.cjs +0 -10033
  174. package/dist/cli/index.d.cts +0 -5
  175. package/dist/commands/archive.cjs +0 -287
  176. package/dist/commands/archive.d.cts +0 -11
  177. package/dist/commands/backlog.cjs +0 -721
  178. package/dist/commands/backlog.d.cts +0 -53
  179. package/dist/commands/blocked.cjs +0 -204
  180. package/dist/commands/blocked.d.cts +0 -26
  181. package/dist/commands/checkpoint.cjs +0 -244
  182. package/dist/commands/checkpoint.d.cts +0 -41
  183. package/dist/commands/compat.cjs +0 -369
  184. package/dist/commands/compat.d.cts +0 -28
  185. package/dist/commands/context.cjs +0 -2989
  186. package/dist/commands/context.d.cts +0 -2
  187. package/dist/commands/doctor.cjs +0 -3062
  188. package/dist/commands/doctor.d.cts +0 -21
  189. package/dist/commands/embed.cjs +0 -232
  190. package/dist/commands/embed.d.cts +0 -17
  191. package/dist/commands/entities.cjs +0 -141
  192. package/dist/commands/entities.d.cts +0 -7
  193. package/dist/commands/graph.cjs +0 -501
  194. package/dist/commands/graph.d.cts +0 -21
  195. package/dist/commands/inject.cjs +0 -1636
  196. package/dist/commands/inject.d.cts +0 -2
  197. package/dist/commands/kanban.cjs +0 -884
  198. package/dist/commands/kanban.d.cts +0 -63
  199. package/dist/commands/link.cjs +0 -965
  200. package/dist/commands/link.d.cts +0 -11
  201. package/dist/commands/migrate-observations.cjs +0 -362
  202. package/dist/commands/migrate-observations.d.cts +0 -19
  203. package/dist/commands/observe.cjs +0 -4099
  204. package/dist/commands/observe.d.cts +0 -23
  205. package/dist/commands/project.cjs +0 -1341
  206. package/dist/commands/project.d.cts +0 -85
  207. package/dist/commands/rebuild.cjs +0 -3136
  208. package/dist/commands/rebuild.d.cts +0 -11
  209. package/dist/commands/recover.cjs +0 -361
  210. package/dist/commands/recover.d.cts +0 -38
  211. package/dist/commands/reflect.cjs +0 -1008
  212. package/dist/commands/reflect.d.cts +0 -11
  213. package/dist/commands/repair-session.cjs +0 -457
  214. package/dist/commands/repair-session.d.cts +0 -38
  215. package/dist/commands/replay.cjs +0 -4103
  216. package/dist/commands/replay.d.cts +0 -16
  217. package/dist/commands/session-recap.cjs +0 -353
  218. package/dist/commands/session-recap.d.cts +0 -27
  219. package/dist/commands/setup.cjs +0 -1345
  220. package/dist/commands/setup.d.cts +0 -100
  221. package/dist/commands/shell-init.cjs +0 -75
  222. package/dist/commands/shell-init.d.cts +0 -7
  223. package/dist/commands/sleep.cjs +0 -6028
  224. package/dist/commands/sleep.d.cts +0 -36
  225. package/dist/commands/status.cjs +0 -2736
  226. package/dist/commands/status.d.cts +0 -52
  227. package/dist/commands/tailscale.cjs +0 -1532
  228. package/dist/commands/tailscale.d.cts +0 -52
  229. package/dist/commands/task.cjs +0 -1236
  230. package/dist/commands/task.d.cts +0 -97
  231. package/dist/commands/template.cjs +0 -457
  232. package/dist/commands/template.d.cts +0 -36
  233. package/dist/commands/wake.cjs +0 -2626
  234. package/dist/commands/wake.d.cts +0 -22
  235. package/dist/context-BUGaWpyL.d.cts +0 -46
  236. package/dist/index.cjs +0 -14526
  237. package/dist/index.d.cts +0 -858
  238. package/dist/inject-Bzi5E-By.d.ts +0 -137
  239. package/dist/lib/auto-linker.cjs +0 -176
  240. package/dist/lib/auto-linker.d.cts +0 -26
  241. package/dist/lib/canvas-layout.cjs +0 -136
  242. package/dist/lib/canvas-layout.d.cts +0 -31
  243. package/dist/lib/config.cjs +0 -78
  244. package/dist/lib/config.d.cts +0 -11
  245. package/dist/lib/entity-index.cjs +0 -84
  246. package/dist/lib/entity-index.d.cts +0 -26
  247. package/dist/lib/project-utils.cjs +0 -864
  248. package/dist/lib/project-utils.d.cts +0 -97
  249. package/dist/lib/session-repair.cjs +0 -239
  250. package/dist/lib/session-repair.d.cts +0 -110
  251. package/dist/lib/session-utils.cjs +0 -209
  252. package/dist/lib/session-utils.d.cts +0 -63
  253. package/dist/lib/tailscale.cjs +0 -1183
  254. package/dist/lib/tailscale.d.cts +0 -225
  255. package/dist/lib/task-utils.cjs +0 -1137
  256. package/dist/lib/task-utils.d.cts +0 -208
  257. package/dist/lib/template-engine.cjs +0 -47
  258. package/dist/lib/template-engine.d.cts +0 -11
  259. package/dist/lib/webdav.cjs +0 -568
  260. package/dist/lib/webdav.d.cts +0 -109
  261. package/dist/plugin/index.cjs +0 -1907
  262. package/dist/plugin/index.d.cts +0 -36
  263. package/dist/plugin/index.d.ts +0 -36
  264. package/dist/plugin/index.js +0 -572
  265. package/dist/plugin/inject.cjs +0 -356
  266. package/dist/plugin/inject.d.cts +0 -54
  267. package/dist/plugin/inject.d.ts +0 -54
  268. package/dist/plugin/inject.js +0 -17
  269. package/dist/plugin/observe.cjs +0 -631
  270. package/dist/plugin/observe.d.cts +0 -39
  271. package/dist/plugin/observe.d.ts +0 -39
  272. package/dist/plugin/observe.js +0 -18
  273. package/dist/plugin/templates.cjs +0 -593
  274. package/dist/plugin/templates.d.cts +0 -52
  275. package/dist/plugin/templates.d.ts +0 -52
  276. package/dist/plugin/templates.js +0 -25
  277. package/dist/plugin/types.cjs +0 -18
  278. package/dist/plugin/types.d.cts +0 -209
  279. package/dist/plugin/types.d.ts +0 -209
  280. package/dist/plugin/types.js +0 -0
  281. package/dist/plugin/vault.cjs +0 -927
  282. package/dist/plugin/vault.d.cts +0 -68
  283. package/dist/plugin/vault.d.ts +0 -68
  284. package/dist/plugin/vault.js +0 -22
  285. package/dist/types-Y2_Um2Ls.d.ts +0 -205
  286. package/templates/memory-event.md +0 -67
  287. package/templates/party.md +0 -63
  288. package/templates/primitive-registry.yaml +0 -551
  289. package/templates/run.md +0 -68
  290. package/templates/trigger.md +0 -68
  291. package/templates/workspace.md +0 -50
package/README.md CHANGED
@@ -1,17 +1,301 @@
1
+ <div align="center">
2
+
1
3
  # ClawVault 🐘
2
4
 
3
- Structured memory system for AI agents and operators: typed markdown memory, graph-aware context, task/project primitives, Obsidian views, and OpenClaw hook integration.
5
+ **Persistent Memory for AI Agents**
4
6
 
7
+ [![Tests](https://img.shields.io/badge/tests-466%20passing-brightgreen)](https://github.com/Versatly/clawvault)
5
8
  [![npm](https://img.shields.io/npm/v/clawvault)](https://www.npmjs.com/package/clawvault)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
10
+ [![PRs Merged](https://img.shields.io/badge/PRs%20merged-20%2B-purple)](https://github.com/Versatly/clawvault/pulls?q=is%3Amerged)
11
+ [![Contributors](https://img.shields.io/badge/contributors-6-orange)](https://github.com/Versatly/clawvault/graphs/contributors)
12
+
13
+ *An elephant never forgets. Neither should your AI.*
14
+
15
+ [Documentation](https://clawvault.dev) · [npm Package](https://www.npmjs.com/package/clawvault) · [Obsidian Plugin](https://clawvault.dev/obsidian) · [GitHub](https://github.com/Versatly/clawvault)
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ ## What is ClawVault?
22
+
23
+ ClawVault is a **structured memory system** for AI agents that uses **markdown as the storage primitive**. It solves the fundamental problem of AI agents losing context between sessions — what we call "context death."
24
+
25
+ Unlike vector databases or cloud-based memory solutions, ClawVault is:
26
+
27
+ - **Local-first** — Your data stays on your machine. No cloud sync, no vendor lock-in.
28
+ - **Markdown-native** — Human-readable, git-friendly, works with Obsidian out of the box.
29
+ - **Graph-aware** — Wiki-links build a knowledge graph that enriches context retrieval.
30
+ - **Session-resilient** — Checkpoint/recover primitives survive crashes and context resets.
31
+ - **Fact-aware** — Write-time extraction builds structured facts with conflict resolution.
32
+
33
+ ```
34
+ ┌─────────────────────────────────────────────────────────────────────────────┐
35
+ │ ClawVault Architecture │
36
+ ├─────────────────────────────────────────────────────────────────────────────┤
37
+ │ │
38
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
39
+ │ │ Agent │───▶│ Session │───▶│ Observer │───▶│ Router │ │
40
+ │ │ (Claude, │ │ Watcher │ │Compressor│ │ │ │
41
+ │ │ GPT..) │ └──────────┘ └──────────┘ └────┬─────┘ │
42
+ │ └──────────┘ │ │
43
+ │ │ ▼ │
44
+ │ │ ┌─────────────────────────────────────────────────────┐ │
45
+ │ │ │ Markdown Vault │ │
46
+ │ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐ │ │
47
+ │ │ │ │decisions/│ │ lessons/ │ │ people/ │ │projects│ │ │
48
+ │ │ │ └──────────┘ └──────────┘ └──────────┘ └────────┘ │ │
49
+ │ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐ │ │
50
+ │ │ │ │ tasks/ │ │ backlog/ │ │handoffs/ │ │ inbox/ │ │ │
51
+ │ │ │ └──────────┘ └──────────┘ └──────────┘ └────────┘ │ │
52
+ │ │ └─────────────────────────────────────────────────────┘ │
53
+ │ │ │ │
54
+ │ │ ┌──────────────────────────┴──────────────────────────┐ │
55
+ │ │ │ .clawvault/ (Internal State) │ │
56
+ │ │ │ graph-index.json │ last-checkpoint.json │ config │ │
57
+ │ │ └─────────────────────────────────────────────────────┘ │
58
+ │ │ │ │
59
+ │ ▼ ▼ │
60
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
61
+ │ │ wake │◀──▶│ context │◀──▶│ Graph │◀──▶│ Search │ │
62
+ │ │ sleep │ │ profiles │ │ Traversal│ │(qmd/vec) │ │
63
+ │ │checkpoint│ └──────────┘ └──────────┘ └──────────┘ │
64
+ │ └──────────┘ │
65
+ │ │
66
+ │ Data Flow: Session → Observe → Score → Route → Store → Reflect → Promote │
67
+ │ │
68
+ └─────────────────────────────────────────────────────────────────────────────┘
69
+ ```
70
+
71
+ ---
72
+
73
+ ## The 8 Primitives
74
+
75
+ ClawVault is built around 8 core primitives that model how agents should interact with persistent memory:
76
+
77
+ | Primitive | Description | ClawVault Implementation |
78
+ |-----------|-------------|--------------------------|
79
+ | **Goals** | What the agent is trying to achieve | `tasks/`, `projects/`, `--working-on` flags |
80
+ | **Agents** | Identity and ownership tracking | `--owner` metadata, agent handoffs |
81
+ | **State Space** | Current context and environment | `checkpoint`, `recover`, session state |
82
+ | **Feedback** | Learning from outcomes | `lessons/`, `observations/`, reflection engine |
83
+ | **Capital** | Resources and constraints | Token budgets, context profiles, priority scoring |
84
+ | **Institution** | Rules and patterns | `decisions/`, `preferences/`, injection rules |
85
+ | **Synthesis** | Combining information | Graph traversal, context blending, semantic search |
86
+ | **Recursion** | Self-improvement loops | `reflect`, weekly promotion, archival |
87
+
88
+ These primitives map directly to CLI commands and vault structure, creating a coherent system for agent memory.
89
+
90
+ ---
91
+
92
+ ## Quick Start
93
+
94
+ ### Installation
95
+
96
+ ```bash
97
+ # Install ClawVault CLI
98
+ npm install -g clawvault
99
+
100
+ # Install qmd (required for search/context features)
101
+ npm install -g github:tobi/qmd
102
+ ```
103
+
104
+ ### Initialize Your Vault
105
+
106
+ ```bash
107
+ # Create a new vault
108
+ clawvault init ~/memory --name my-brain
109
+
110
+ # Optional: Set up Obsidian integration
111
+ clawvault setup --theme neural --canvas
112
+ ```
113
+
114
+ ### Basic Workflow
115
+
116
+ ```bash
117
+ # Start your session
118
+ clawvault wake
119
+
120
+ # Store memories as you work
121
+ clawvault remember decision "Use PostgreSQL" --content "Chosen for JSONB support"
122
+ clawvault capture "TODO: Review PR tomorrow"
123
+
124
+ # Checkpoint during heavy work
125
+ clawvault checkpoint --working-on "auth rollout" --focus "token refresh"
126
+
127
+ # End your session
128
+ clawvault sleep "finished auth rollout" --next "implement migration"
129
+ ```
130
+
131
+ ### Search and Context
132
+
133
+ ```bash
134
+ # Keyword search
135
+ clawvault search "postgresql"
136
+
137
+ # Semantic search
138
+ clawvault vsearch "what did we decide about storage"
139
+
140
+ # Get context for a task
141
+ clawvault context "database migration"
142
+ clawvault context --profile planning "Q1 roadmap"
143
+ ```
144
+
145
+ ---
146
+
147
+ ## v3.0 — Structured Memory
148
+
149
+ ClawVault v3 adds **write-time fact extraction** and **entity graphs** to the core memory pipeline:
150
+
151
+ - **Fact Store** — Extracts structured facts (preferences, attributes, relationships) at write time with conflict resolution and deduplication
152
+ - **Entity Graph** — Builds a relational graph enabling multi-hop queries ("Alice works at Google + Google is in CA → Alice is in CA")
153
+ - **Hybrid Search** — BM25 + semantic embeddings + Reciprocal Rank Fusion (RRF)
154
+
155
+ ### Project Stats
6
156
 
7
- > Local-first. Markdown-first. Built to survive long-running autonomous work.
157
+ - **466 tests** passing across **71 test files**
158
+ - **20+ PRs** merged from **6 external contributors**
159
+ - Published on npm as [`clawvault`](https://www.npmjs.com/package/clawvault)
160
+ - Active development since February 2026
161
+
162
+ ---
163
+
164
+ ## Features
165
+
166
+ ### Memory Graph
167
+
168
+ ClawVault builds a typed knowledge graph from wiki-links, tags, and frontmatter:
169
+
170
+ ```bash
171
+ # View graph summary
172
+ clawvault graph
173
+
174
+ # Refresh graph index
175
+ clawvault graph --refresh
176
+ ```
177
+
178
+ ### Context Profiles
179
+
180
+ Different tasks need different context. Use profiles to tune retrieval:
181
+
182
+ | Profile | Purpose |
183
+ |---------|---------|
184
+ | `default` | Balanced retrieval |
185
+ | `planning` | Broader strategic context |
186
+ | `incident` | Recent events, blockers, urgent items |
187
+ | `handoff` | Session transition context |
188
+ | `auto` | Hook-selected based on session intent |
189
+
190
+ ```bash
191
+ clawvault context --profile incident "production outage"
192
+ ```
193
+
194
+ ### Task Management
195
+
196
+ Full task lifecycle with Kanban support:
197
+
198
+ ```bash
199
+ # Create tasks
200
+ clawvault task add "Ship v2 onboarding" --owner agent --project core --priority high
201
+
202
+ # View blocked items
203
+ clawvault blocked
204
+
205
+ # Sync with Obsidian Kanban
206
+ clawvault kanban sync
207
+ ```
208
+
209
+ ### Dynamic Prompt Injection
210
+
211
+ Pull relevant decisions and preferences into agent context automatically:
212
+
213
+ ```bash
214
+ clawvault inject "How should we handle the deployment?"
215
+ clawvault inject --enable-llm "What's our pricing strategy?"
216
+ ```
217
+
218
+ ---
219
+
220
+ ## Obsidian Integration
221
+
222
+ ClawVault is designed to work seamlessly with Obsidian:
223
+
224
+ - **Graph themes** — Neural/minimal themes with colored nodes by category
225
+ - **Bases views** — Auto-generated task views (`all-tasks.base`, `blocked.base`, `by-project.base`)
226
+ - **Canvas dashboards** — `clawvault canvas` generates visual dashboards
227
+ - **Kanban round-trip** — Export/import between ClawVault and Obsidian Kanban
228
+
229
+ ```bash
230
+ # Generate canvas dashboard
231
+ clawvault canvas --template brain
232
+
233
+ # Set up Obsidian integration
234
+ clawvault setup --theme neural --canvas --bases
235
+ ```
236
+
237
+ ---
238
+
239
+ ## OpenClaw Integration
240
+
241
+ For hook-based lifecycle integration with OpenClaw:
242
+
243
+ ```bash
244
+ # Install and enable hook pack
245
+ openclaw hooks install clawvault
246
+ openclaw hooks enable clawvault
247
+
248
+ # Verify
249
+ openclaw hooks list --verbose
250
+ openclaw hooks check
251
+ clawvault compat
252
+ ```
253
+
254
+ The hook automatically:
255
+ - Detects context death and injects recovery alerts
256
+ - Auto-checkpoints before session resets
257
+ - Provides `--profile auto` for context queries
258
+
259
+ ### MEMORY.md vs Vault
260
+
261
+ If you use both a `MEMORY.md` workspace file and a ClawVault vault, understand their roles:
262
+
263
+ - **MEMORY.md** = Boot context (executive summary the agent sees instantly)
264
+ - **Vault** = Full knowledge store (searchable, structured, versioned)
265
+
266
+ MEMORY.md should contain high-level identity, key decisions, and current focus. The vault stores everything else. Update MEMORY.md periodically to reflect vault state, but it doesn't need to mirror it.
267
+
268
+ See [docs/openclaw-plugin-usage.md](docs/openclaw-plugin-usage.md) for detailed guidance on this pattern.
269
+
270
+ ---
8
271
 
9
272
  ## Requirements
10
273
 
11
274
  - Node.js 18+
12
- - `qmd` installed and available on `PATH`
275
+ - `qmd` installed and available on `PATH` (for search/context features)
276
+
277
+ ## LLM Providers
278
+
279
+ ClawVault supports multiple LLM providers for features like context generation, observation compression, and semantic search. Set the appropriate environment variable to enable a provider:
13
280
 
14
- ClawVault currently relies on `qmd` for core vault/query flows. Install it before first use.
281
+ | Provider | Environment Variable | Default Model | Notes |
282
+ |----------|---------------------|---------------|-------|
283
+ | **Anthropic** | `ANTHROPIC_API_KEY` | `claude-3-5-haiku-latest` | Claude models |
284
+ | **OpenAI** | `OPENAI_API_KEY` | `gpt-4o-mini` | GPT models |
285
+ | **Google Gemini** | `GEMINI_API_KEY` | `gemini-2.0-flash` | Gemini models |
286
+ | **xAI (Grok)** | `XAI_API_KEY` | `grok-2-latest` | Grok models via OpenAI-compatible API |
287
+ | **Ollama** | (local) | `llama3.2` | Local models, no API key needed |
288
+ | **OpenAI-compatible** | `OPENAI_API_KEY` | `gpt-4o-mini` | Any OpenAI-compatible endpoint |
289
+
290
+ Provider priority (when multiple keys are set): OpenClaw > Anthropic > OpenAI > Gemini > xAI
291
+
292
+ ```bash
293
+ # Example: Use xAI (Grok) as your LLM provider
294
+ export XAI_API_KEY="your-xai-api-key"
295
+
296
+ # Example: Use Anthropic
297
+ export ANTHROPIC_API_KEY="your-anthropic-api-key"
298
+ ```
15
299
 
16
300
  ## Install
17
301
 
@@ -68,35 +352,39 @@ Append these to your existing memory workflow. Do not replace your full prompt s
68
352
  - Use `clawvault context "<task>"` or `clawvault inject "<message>"` before complex decisions.
69
353
  ```
70
354
 
71
- ## Real CLI Surface (Current)
355
+ ---
356
+
357
+ ## CLI Reference
72
358
 
73
- Core:
359
+ ### Core Commands
74
360
 
75
361
  - `init`, `setup`, `store`, `capture`
76
362
  - `remember`, `list`, `get`, `stats`, `reindex`, `sync`
77
363
 
78
- Context + memory:
364
+ ### Context + Memory
79
365
 
80
366
  - `search`, `vsearch`, `context`, `inject`
81
367
  - `observe`, `reflect`, `session-recap`
82
368
  - `graph`, `entities`, `link`, `embed`
83
369
 
84
- Resilience:
370
+ ### Resilience
85
371
 
86
372
  - `wake`, `sleep`, `handoff`, `recap`
87
373
  - `checkpoint`, `recover`, `status`, `clean-exit`, `repair-session`
88
374
  - `compat`, `doctor`
89
375
 
90
- Execution primitives:
376
+ ### Execution Primitives
91
377
 
92
378
  - `task ...`, `backlog ...`, `blocked`, `project ...`, `kanban ...`
93
379
  - `canvas` (generates default `dashboard.canvas`)
94
380
 
95
- Networking:
381
+ ### Networking
96
382
 
97
383
  - `tailscale-status`, `tailscale-sync`, `tailscale-serve`, `tailscale-discover`
98
384
 
99
- ## Quick Usage
385
+ ---
386
+
387
+ ## Quick Usage Examples
100
388
 
101
389
  ```bash
102
390
  # Store and retrieve memory
@@ -119,15 +407,7 @@ clawvault kanban sync
119
407
  clawvault canvas
120
408
  ```
121
409
 
122
- ## Obsidian Integration
123
-
124
- - Setup can generate:
125
- - graph theme/snippet config (`--theme neural|minimal|none`)
126
- - Bases views (`all-tasks.base`, `blocked.base`, `by-project.base`, `by-owner.base`, `backlog.base`)
127
- - default canvas (`dashboard.canvas`) via `--canvas` or `clawvault canvas`
128
- - Kanban round-trip:
129
- - export: `clawvault kanban sync`
130
- - import lane changes back to task metadata: `clawvault kanban import`
410
+ ---
131
411
 
132
412
  ## Tailscale + WebDAV
133
413
 
@@ -139,6 +419,29 @@ clawvault tailscale-serve --vault ~/memory
139
419
  clawvault tailscale-discover
140
420
  ```
141
421
 
422
+ ---
423
+
424
+ ## Vault Structure
425
+
426
+ ```
427
+ vault/
428
+ ├── .clawvault/ # Internal state
429
+ │ ├── graph-index.json # Knowledge graph
430
+ │ ├── last-checkpoint.json
431
+ │ └── config.json
432
+ ├── decisions/ # Key choices with reasoning
433
+ ├── lessons/ # Insights and patterns
434
+ ├── people/ # One file per person
435
+ ├── projects/ # Active work tracking
436
+ ├── tasks/ # Task files with frontmatter
437
+ ├── backlog/ # Quick captures and ideas
438
+ ├── handoffs/ # Session continuity
439
+ ├── inbox/ # Quick captures
440
+ └── templates/ # Document templates
441
+ ```
442
+
443
+ ---
444
+
142
445
  ## Troubleshooting
143
446
 
144
447
  - Hook not found after enable:
@@ -154,6 +457,35 @@ clawvault tailscale-discover
154
457
  - Session transcript corruption:
155
458
  - run `clawvault repair-session --dry-run` then `clawvault repair-session`
156
459
 
460
+ ---
461
+
462
+ ## Links
463
+
464
+ | Resource | URL |
465
+ |----------|-----|
466
+ | **Documentation** | [clawvault.dev](https://clawvault.dev) |
467
+ | **npm Package** | [npmjs.com/package/clawvault](https://www.npmjs.com/package/clawvault) |
468
+ | **GitHub** | [github.com/Versatly/clawvault](https://github.com/Versatly/clawvault) |
469
+ | **Issues** | [github.com/Versatly/clawvault/issues](https://github.com/Versatly/clawvault/issues) |
470
+ | **Obsidian Plugin** | [clawvault.dev/obsidian](https://clawvault.dev/obsidian) |
471
+
472
+ ---
473
+
474
+ ## Contributing
475
+
476
+ We welcome contributions! ClawVault has had **20+ PRs merged** from **6 external contributors**.
477
+
478
+ 1. Fork the repository
479
+ 2. Create a feature branch
480
+ 3. Run tests: `npm test`
481
+ 4. Submit a PR
482
+
483
+ See our [contribution guidelines](https://github.com/Versatly/clawvault/blob/main/CONTRIBUTING.md) for details.
484
+
485
+ ---
486
+
487
+ **$CLAW**: [`5Fjr82MTB8mvxkzi9FYtvrUsPiDGE2M29w3dYcZpump`](https://pump.fun/coin/5Fjr82MTB8mvxkzi9FYtvrUsPiDGE2M29w3dYcZpump)
488
+
157
489
  ## License
158
490
 
159
491
  MIT
package/bin/clawvault.js CHANGED
@@ -23,13 +23,16 @@ import { registerProjectCommands } from './register-project-commands.js';
23
23
 
24
24
  import { registerTaskCommands } from './register-task-commands.js';
25
25
 
26
+ import { registerWorkgraphCommands } from './register-workgraph-commands.js';
26
27
  import { registerTailscaleCommands } from './register-tailscale-commands.js';
27
28
  import {
28
29
  getVault,
29
30
  resolveVaultPath,
30
31
  runQmd,
31
32
  printQmdMissing,
32
- QmdUnavailableError
33
+ printQmdConfigError,
34
+ QmdUnavailableError,
35
+ QmdConfigurationError
33
36
  } from './command-runtime.js';
34
37
  import {
35
38
  createVault
@@ -66,7 +69,9 @@ registerQueryCommands(program, {
66
69
  getVault,
67
70
  resolveVaultPath,
68
71
  QmdUnavailableError,
69
- printQmdMissing
72
+ QmdConfigurationError,
73
+ printQmdMissing,
74
+ printQmdConfigError
70
75
  });
71
76
 
72
77
  registerSessionLifecycleCommands(program, {
@@ -104,6 +109,7 @@ registerProjectCommands(program, {
104
109
  resolveVaultPath
105
110
  });
106
111
 
112
+ registerWorkgraphCommands(program, { chalk, resolveVaultPath });
107
113
  registerTailscaleCommands(program, { chalk });
108
114
  registerConfigCommands(program, { chalk, resolveVaultPath });
109
115
  registerRouteCommands(program, { chalk, resolveVaultPath });
@@ -83,7 +83,8 @@ describe('CLI command registration modules', () => {
83
83
  'sync',
84
84
  'reindex',
85
85
  'remember',
86
- 'shell-init'
86
+ 'shell-init',
87
+ 'dashboard'
87
88
  ]));
88
89
  });
89
90
 
@@ -129,6 +130,7 @@ describe('CLI command registration modules', () => {
129
130
  'archive',
130
131
  'migrate-observations',
131
132
  'replay',
133
+ 'sync-bd',
132
134
  'checkpoint',
133
135
  'recover',
134
136
  'status',
@@ -4,6 +4,7 @@ import path from 'path';
4
4
  import {
5
5
  ClawVault,
6
6
  QmdUnavailableError,
7
+ QmdConfigurationError,
7
8
  QMD_INSTALL_COMMAND,
8
9
  resolveVaultPath as resolveConfiguredVaultPath
9
10
  } from '../dist/index.js';
@@ -90,4 +91,11 @@ export function printQmdMissing() {
90
91
  console.log(chalk.dim(`Install: ${QMD_INSTALL_COMMAND}`));
91
92
  }
92
93
 
93
- export { QmdUnavailableError };
94
+ export function printQmdConfigError(err) {
95
+ console.error(chalk.red(`Error: ${err.message}`));
96
+ if (err.hint) {
97
+ console.log(chalk.yellow(`Hint: ${err.hint}`));
98
+ }
99
+ }
100
+
101
+ export { QmdUnavailableError, QmdConfigurationError };
@@ -19,6 +19,7 @@ export function registerCoreCommands(
19
19
  .option('--no-tasks', 'Skip tasks/ and backlog/ directories')
20
20
  .option('--no-graph', 'Skip initial graph build')
21
21
  .option('--categories <list>', 'Comma-separated list of custom categories to create')
22
+ .option('--canvas', 'Generate a vault status canvas dashboard on init')
22
23
  .option('--theme <style>', 'Graph color theme to apply (neural, minimal, none) (default: none)', 'none')
23
24
  .option('--minimal', 'Create minimal vault (memory categories only, no tasks/bases/graph)')
24
25
  .action(async (vaultPath, options) => {
@@ -80,14 +81,8 @@ export function registerCoreCommands(
80
81
  '**/*.md'
81
82
  ]);
82
83
  console.log(chalk.green('✓ qmd collection created'));
83
- } catch (err) {
84
- if (err instanceof QmdUnavailableError || err?.message?.includes('ENOENT') || err?.message?.includes('ERR_MODULE_NOT_FOUND')) {
85
- console.log(chalk.yellow('⚠ qmd not available — skipping semantic search setup'));
86
- console.log(chalk.dim(' Install qmd for semantic search: npm install -g github:tobi/qmd'));
87
- console.log(chalk.dim(' Vault initialized successfully without qmd.'));
88
- } else {
89
- console.log(chalk.yellow('⚠ qmd collection may already exist'));
90
- }
84
+ } catch {
85
+ console.log(chalk.yellow('⚠ qmd collection may already exist'));
91
86
  }
92
87
 
93
88
  // Apply theme if requested
@@ -97,6 +92,7 @@ export function registerCoreCommands(
97
92
  await setupCommand({
98
93
  graphColors: true,
99
94
  bases: false,
95
+ canvas: false,
100
96
  theme: options.theme,
101
97
  vault: resolvedPath
102
98
  });
@@ -105,6 +101,22 @@ export function registerCoreCommands(
105
101
  }
106
102
  }
107
103
 
104
+ // Generate canvas if requested
105
+ if (options.canvas) {
106
+ try {
107
+ const { setupCommand } = await import('../dist/commands/setup.js');
108
+ await setupCommand({
109
+ graphColors: false,
110
+ bases: false,
111
+ canvas: true,
112
+ theme: 'none',
113
+ vault: resolvedPath
114
+ });
115
+ } catch {
116
+ console.log(chalk.yellow(`⚠ Could not generate canvas`));
117
+ }
118
+ }
119
+
108
120
  console.log(chalk.green('\n✅ ClawVault ready!\n'));
109
121
  console.log(' ' + chalk.bold('Try these:'));
110
122
  console.log(chalk.dim(' clawvault capture "my first thought" # quick capture'));
@@ -128,8 +140,9 @@ export function registerCoreCommands(
128
140
  .option('--no-graph-colors', 'Skip graph color configuration')
129
141
  .option('--bases', 'Generate Obsidian Bases views for task management')
130
142
  .option('--no-bases', 'Skip Bases file generation')
143
+ .option('--canvas', 'Generate vault status canvas dashboard')
144
+ .option('--no-canvas', 'Skip canvas generation')
131
145
  .option('--theme <style>', 'Graph color theme (neural, minimal, none) (default: neural)', 'neural')
132
- .option('--from <path>', 'Import from existing agent memory directory (MEMORY.md, memory/*.md, etc)')
133
146
  .option('--force', 'Overwrite existing configuration files')
134
147
  .option('-v, --vault <path>', 'Vault path')
135
148
  .action(async (options) => {
@@ -138,8 +151,8 @@ export function registerCoreCommands(
138
151
  await setupCommand({
139
152
  graphColors: options.graphColors,
140
153
  bases: options.bases,
154
+ canvas: options.canvas,
141
155
  theme: options.theme,
142
- from: options.from,
143
156
  force: options.force,
144
157
  vault: options.vault
145
158
  });
@@ -26,8 +26,8 @@ export function registerMaintenanceCommands(program, { chalk }) {
26
26
 
27
27
  console.log(chalk.cyan('\n🩺 ClawVault Health Check\n'));
28
28
  console.log(chalk.dim(`Vault: ${report.vaultPath}`));
29
- if (report.qmdCollection) console.log(chalk.dim(`qmd collection: ${report.qmdCollection}`));
30
- if (report.qmdRoot) console.log(chalk.dim(`qmd root: ${report.qmdRoot}`));
29
+ console.log(chalk.dim(`qmd collection: ${report.qmdCollection}`));
30
+ console.log(chalk.dim(`qmd root: ${report.qmdRoot}`));
31
31
  console.log();
32
32
 
33
33
  for (const check of report.checks) {
@@ -36,7 +36,7 @@ export function registerMaintenanceCommands(program, { chalk }) {
36
36
  : check.status === 'warn'
37
37
  ? chalk.yellow('⚠')
38
38
  : chalk.red('✗');
39
- const line = check.detail ? `${check.label}: ${check.detail}` : check.label;
39
+ const line = `${check.label}: ${check.detail}`;
40
40
  const renderedLine = check.status === 'ok'
41
41
  ? chalk.green(line)
42
42
  : check.status === 'warn'
@@ -80,6 +80,25 @@ export function registerMaintenanceCommands(program, { chalk }) {
80
80
  }
81
81
  });
82
82
 
83
+ // === REBUILD-EMBEDDINGS ===
84
+ program
85
+ .command('rebuild-embeddings')
86
+ .description('Rebuild local embedding cache for hybrid search (uses all-MiniLM-L6-v2)')
87
+ .option('-v, --vault <path>', 'Vault path')
88
+ .option('--force', 'Force rebuild all embeddings (ignore cache)')
89
+ .action(async (options) => {
90
+ try {
91
+ const { rebuildEmbeddingsCommand } = await import('../dist/commands/rebuild-embeddings.js');
92
+ await rebuildEmbeddingsCommand({
93
+ vaultPath: options.vault,
94
+ force: options.force
95
+ });
96
+ } catch (err) {
97
+ console.error(chalk.red(`Error: ${err.message}`));
98
+ process.exit(1);
99
+ }
100
+ });
101
+
83
102
  // === COMPAT (OpenClaw compatibility) ===
84
103
  program
85
104
  .command('compat')
@@ -262,4 +281,21 @@ export function registerMaintenanceCommands(program, { chalk }) {
262
281
  });
263
282
 
264
283
  // === SYNC-BD ===
284
+ program
285
+ .command('sync-bd')
286
+ .description('Sync active Beads tasks into views/now.md (optional)')
287
+ .option('--dry-run', 'Show sync output without writing')
288
+ .option('-v, --vault <path>', 'Vault path')
289
+ .action(async (options) => {
290
+ try {
291
+ const { syncBdCommand } = await import('../dist/commands/sync-bd.js');
292
+ await syncBdCommand({
293
+ vaultPath: options.vault,
294
+ dryRun: options.dryRun
295
+ });
296
+ } catch (err) {
297
+ console.error(chalk.red(`Error: ${err.message}`));
298
+ process.exit(1);
299
+ }
300
+ });
265
301
  }