clawvault 3.1.0 → 3.2.1

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 (273) hide show
  1. package/README.md +422 -141
  2. package/bin/clawvault.js +10 -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 -28
  6. package/bin/register-maintenance-commands.js +39 -3
  7. package/bin/register-query-commands.js +58 -29
  8. package/bin/register-tailscale-commands.js +106 -0
  9. package/bin/register-task-commands.js +18 -1
  10. package/bin/register-task-commands.test.js +16 -0
  11. package/bin/register-vault-operations-commands.js +29 -1
  12. package/bin/register-workgraph-commands.js +451 -0
  13. package/dashboard/lib/graph-diff.js +104 -0
  14. package/dashboard/lib/graph-diff.test.js +75 -0
  15. package/dashboard/lib/vault-parser.js +556 -0
  16. package/dashboard/lib/vault-parser.test.js +254 -0
  17. package/dashboard/public/app.js +796 -0
  18. package/dashboard/public/index.html +52 -0
  19. package/dashboard/public/styles.css +221 -0
  20. package/dashboard/server.js +374 -0
  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-F2JEUD4J.js → chunk-4ITRXIVT.js} +5 -7
  24. package/dist/{chunk-GUKMRGM7.js → chunk-4OXMU5S2.js} +1 -1
  25. package/dist/chunk-5PJ4STIC.js +465 -0
  26. package/dist/{chunk-62YTUT6J.js → chunk-AZYOKJYC.js} +2 -2
  27. package/dist/chunk-BSJ6RIT7.js +447 -0
  28. package/dist/chunk-ECRZL5XR.js +50 -0
  29. package/dist/chunk-ERNE2FZ5.js +189 -0
  30. package/dist/{chunk-WAZ3NLWL.js → chunk-F55HGNU4.js} +0 -47
  31. package/dist/{chunk-VGLOTGAS.js → chunk-FAKNOB7Y.js} +2 -2
  32. package/dist/{chunk-QK3UCXWL.js → chunk-FHFUXL6G.js} +2 -2
  33. package/dist/chunk-GNJL4YGR.js +79 -0
  34. package/dist/chunk-HR4KN6S2.js +152 -0
  35. package/dist/{chunk-OZ7RIXTO.js → chunk-IIOU45CK.js} +1 -1
  36. package/dist/chunk-IJBFGPCS.js +33 -0
  37. package/dist/chunk-IVRIKYFE.js +520 -0
  38. package/dist/chunk-K7PNYS45.js +93 -0
  39. package/dist/chunk-MDIH26GC.js +183 -0
  40. package/dist/{chunk-LYHGEHXG.js → chunk-MFAWT5O5.js} +0 -1
  41. package/dist/{chunk-H34S76MB.js → chunk-MNPUYCHQ.js} +6 -6
  42. package/dist/chunk-NTOPJI7W.js +207 -0
  43. package/dist/{chunk-QBLMXKF2.js → chunk-OIWVQYQF.js} +1 -1
  44. package/dist/chunk-PG56HX5T.js +154 -0
  45. package/dist/{chunk-LNJA2UGL.js → chunk-PI4WMLMG.js} +7 -84
  46. package/dist/chunk-QMHPQYUV.js +363 -0
  47. package/dist/{chunk-H62BP7RI.js → chunk-QPDDIHXE.js} +209 -43
  48. package/dist/{chunk-N2AXRYLC.js → chunk-QWQ3TIKS.js} +1 -1
  49. package/dist/{chunk-3DHXQHYG.js → chunk-R2MIW5G7.js} +1 -1
  50. package/dist/{chunk-SJSFRIYS.js → chunk-S5OJEGFG.js} +2 -2
  51. package/dist/chunk-SS4B7P7V.js +99 -0
  52. package/dist/chunk-TIGW564L.js +628 -0
  53. package/dist/chunk-U67V476Y.js +35 -0
  54. package/dist/{chunk-JY6FYXIT.js → chunk-UCQAOZHW.js} +6 -11
  55. package/dist/{chunk-ITPEXLHA.js → chunk-URXDAUVH.js} +24 -5
  56. package/dist/chunk-WIOLLGAD.js +190 -0
  57. package/dist/{chunk-3WRJEKN4.js → chunk-WJVWINEM.js} +72 -8
  58. package/dist/chunk-WMGIIABP.js +15 -0
  59. package/dist/{chunk-33UGEQRT.js → chunk-X3SPPUFG.js} +151 -64
  60. package/dist/{chunk-3NSBOUT3.js → chunk-Y3TIJEBP.js} +314 -79
  61. package/dist/chunk-Y6VJKXGL.js +373 -0
  62. package/dist/{chunk-LI4O6NVK.js → chunk-YDWHS4LJ.js} +49 -9
  63. package/dist/{chunk-U55BGUAU.js → chunk-YNIPYN4F.js} +5 -5
  64. package/dist/chunk-YXQCA6B7.js +226 -0
  65. package/dist/cli/index.js +26 -22
  66. package/dist/commands/archive.js +3 -3
  67. package/dist/commands/backlog.js +3 -3
  68. package/dist/commands/blocked.js +3 -3
  69. package/dist/commands/canvas.d.ts +15 -0
  70. package/dist/commands/canvas.js +200 -0
  71. package/dist/commands/checkpoint.js +2 -2
  72. package/dist/commands/compat.js +2 -2
  73. package/dist/commands/context.js +7 -5
  74. package/dist/commands/doctor.d.ts +11 -7
  75. package/dist/commands/doctor.js +16 -14
  76. package/dist/commands/embed.js +5 -6
  77. package/dist/commands/entities.js +2 -2
  78. package/dist/commands/graph.js +3 -3
  79. package/dist/commands/inject.d.ts +1 -1
  80. package/dist/commands/inject.js +4 -5
  81. package/dist/commands/kanban.js +4 -4
  82. package/dist/commands/link.js +2 -2
  83. package/dist/commands/migrate-observations.js +4 -4
  84. package/dist/commands/observe.d.ts +0 -1
  85. package/dist/commands/observe.js +13 -12
  86. package/dist/commands/project.js +5 -5
  87. package/dist/commands/rebuild-embeddings.d.ts +21 -0
  88. package/dist/commands/rebuild-embeddings.js +91 -0
  89. package/dist/commands/rebuild.js +12 -11
  90. package/dist/commands/recover.js +3 -3
  91. package/dist/commands/reflect.js +6 -7
  92. package/dist/commands/repair-session.js +1 -1
  93. package/dist/commands/replay.js +14 -14
  94. package/dist/commands/session-recap.js +1 -1
  95. package/dist/commands/setup.d.ts +2 -89
  96. package/dist/commands/setup.js +3 -21
  97. package/dist/commands/shell-init.js +1 -1
  98. package/dist/commands/sleep.d.ts +1 -1
  99. package/dist/commands/sleep.js +18 -17
  100. package/dist/commands/status.d.ts +2 -0
  101. package/dist/commands/status.js +40 -30
  102. package/dist/commands/sync-bd.d.ts +10 -0
  103. package/dist/commands/sync-bd.js +10 -0
  104. package/dist/commands/tailscale.d.ts +52 -0
  105. package/dist/commands/tailscale.js +26 -0
  106. package/dist/commands/task.js +4 -4
  107. package/dist/commands/template.js +2 -2
  108. package/dist/commands/wake.d.ts +1 -1
  109. package/dist/commands/wake.js +11 -10
  110. package/dist/index.d.ts +334 -191
  111. package/dist/index.js +432 -108
  112. package/dist/{inject-Bzi5E-By.d.ts → inject-DYUrDqQO.d.ts} +3 -3
  113. package/dist/ledger-B7g7jhqG.d.ts +44 -0
  114. package/dist/lib/auto-linker.js +1 -1
  115. package/dist/lib/canvas-layout.d.ts +115 -0
  116. package/dist/lib/canvas-layout.js +35 -0
  117. package/dist/lib/config.d.ts +27 -3
  118. package/dist/lib/config.js +4 -2
  119. package/dist/lib/entity-index.js +1 -1
  120. package/dist/lib/project-utils.js +4 -4
  121. package/dist/lib/session-repair.js +1 -1
  122. package/dist/lib/session-utils.js +1 -1
  123. package/dist/lib/tailscale.d.ts +225 -0
  124. package/dist/lib/tailscale.js +50 -0
  125. package/dist/lib/task-utils.js +3 -3
  126. package/dist/lib/template-engine.js +1 -1
  127. package/dist/lib/webdav.d.ts +109 -0
  128. package/dist/lib/webdav.js +35 -0
  129. package/dist/plugin/index.d.ts +344 -28
  130. package/dist/plugin/index.js +3919 -227
  131. package/dist/registry-BR4326o0.d.ts +30 -0
  132. package/dist/store-CA-6sKCJ.d.ts +34 -0
  133. package/dist/thread-B9LhXNU0.d.ts +41 -0
  134. package/dist/{types-Y2_Um2Ls.d.ts → types-BbWJoC1c.d.ts} +1 -44
  135. package/dist/workgraph/index.d.ts +5 -0
  136. package/dist/workgraph/index.js +23 -0
  137. package/dist/workgraph/ledger.d.ts +2 -0
  138. package/dist/workgraph/ledger.js +25 -0
  139. package/dist/workgraph/registry.d.ts +2 -0
  140. package/dist/workgraph/registry.js +19 -0
  141. package/dist/workgraph/store.d.ts +2 -0
  142. package/dist/workgraph/store.js +25 -0
  143. package/dist/workgraph/thread.d.ts +2 -0
  144. package/dist/workgraph/thread.js +25 -0
  145. package/dist/workgraph/types.d.ts +54 -0
  146. package/dist/workgraph/types.js +7 -0
  147. package/hooks/clawvault/HOOK.md +113 -0
  148. package/hooks/clawvault/handler.js +1559 -0
  149. package/hooks/clawvault/handler.test.js +510 -0
  150. package/hooks/clawvault/openclaw.plugin.json +72 -0
  151. package/openclaw.plugin.json +235 -30
  152. package/package.json +20 -20
  153. package/dist/chunk-3RG5ZIWI.js +0 -10
  154. package/dist/chunk-3ZIH425O.js +0 -871
  155. package/dist/chunk-6U6MK36V.js +0 -205
  156. package/dist/chunk-CMB7UL7C.js +0 -327
  157. package/dist/chunk-D2H45LON.js +0 -1074
  158. package/dist/chunk-E7MFQB6D.js +0 -163
  159. package/dist/chunk-GQSLDZTS.js +0 -560
  160. package/dist/chunk-MFM6K7PU.js +0 -374
  161. package/dist/chunk-MXSSG3QU.js +0 -42
  162. package/dist/chunk-OCGVIN3L.js +0 -88
  163. package/dist/chunk-PAH27GSN.js +0 -108
  164. package/dist/chunk-YCUNCH2I.js +0 -78
  165. package/dist/cli/index.cjs +0 -8584
  166. package/dist/cli/index.d.cts +0 -5
  167. package/dist/commands/archive.cjs +0 -287
  168. package/dist/commands/archive.d.cts +0 -11
  169. package/dist/commands/backlog.cjs +0 -721
  170. package/dist/commands/backlog.d.cts +0 -53
  171. package/dist/commands/blocked.cjs +0 -204
  172. package/dist/commands/blocked.d.cts +0 -26
  173. package/dist/commands/checkpoint.cjs +0 -244
  174. package/dist/commands/checkpoint.d.cts +0 -41
  175. package/dist/commands/compat.cjs +0 -294
  176. package/dist/commands/compat.d.cts +0 -28
  177. package/dist/commands/context.cjs +0 -2990
  178. package/dist/commands/context.d.cts +0 -2
  179. package/dist/commands/doctor.cjs +0 -2986
  180. package/dist/commands/doctor.d.cts +0 -21
  181. package/dist/commands/embed.cjs +0 -232
  182. package/dist/commands/embed.d.cts +0 -17
  183. package/dist/commands/entities.cjs +0 -141
  184. package/dist/commands/entities.d.cts +0 -7
  185. package/dist/commands/graph.cjs +0 -501
  186. package/dist/commands/graph.d.cts +0 -21
  187. package/dist/commands/inject.cjs +0 -1636
  188. package/dist/commands/inject.d.cts +0 -2
  189. package/dist/commands/kanban.cjs +0 -884
  190. package/dist/commands/kanban.d.cts +0 -63
  191. package/dist/commands/link.cjs +0 -965
  192. package/dist/commands/link.d.cts +0 -11
  193. package/dist/commands/migrate-observations.cjs +0 -362
  194. package/dist/commands/migrate-observations.d.cts +0 -19
  195. package/dist/commands/observe.cjs +0 -4099
  196. package/dist/commands/observe.d.cts +0 -23
  197. package/dist/commands/project.cjs +0 -1341
  198. package/dist/commands/project.d.cts +0 -85
  199. package/dist/commands/rebuild.cjs +0 -3136
  200. package/dist/commands/rebuild.d.cts +0 -11
  201. package/dist/commands/recover.cjs +0 -361
  202. package/dist/commands/recover.d.cts +0 -38
  203. package/dist/commands/reflect.cjs +0 -1008
  204. package/dist/commands/reflect.d.cts +0 -11
  205. package/dist/commands/repair-session.cjs +0 -457
  206. package/dist/commands/repair-session.d.cts +0 -38
  207. package/dist/commands/replay.cjs +0 -4103
  208. package/dist/commands/replay.d.cts +0 -16
  209. package/dist/commands/session-recap.cjs +0 -353
  210. package/dist/commands/session-recap.d.cts +0 -27
  211. package/dist/commands/setup.cjs +0 -1278
  212. package/dist/commands/setup.d.cts +0 -99
  213. package/dist/commands/shell-init.cjs +0 -75
  214. package/dist/commands/shell-init.d.cts +0 -7
  215. package/dist/commands/sleep.cjs +0 -6029
  216. package/dist/commands/sleep.d.cts +0 -36
  217. package/dist/commands/status.cjs +0 -2737
  218. package/dist/commands/status.d.cts +0 -52
  219. package/dist/commands/task.cjs +0 -1236
  220. package/dist/commands/task.d.cts +0 -97
  221. package/dist/commands/template.cjs +0 -457
  222. package/dist/commands/template.d.cts +0 -36
  223. package/dist/commands/wake.cjs +0 -2627
  224. package/dist/commands/wake.d.cts +0 -22
  225. package/dist/context-BUGaWpyL.d.cts +0 -46
  226. package/dist/index.cjs +0 -12373
  227. package/dist/index.d.cts +0 -854
  228. package/dist/inject-Bzi5E-By.d.cts +0 -137
  229. package/dist/lib/auto-linker.cjs +0 -176
  230. package/dist/lib/auto-linker.d.cts +0 -26
  231. package/dist/lib/config.cjs +0 -78
  232. package/dist/lib/config.d.cts +0 -11
  233. package/dist/lib/entity-index.cjs +0 -84
  234. package/dist/lib/entity-index.d.cts +0 -26
  235. package/dist/lib/project-utils.cjs +0 -864
  236. package/dist/lib/project-utils.d.cts +0 -97
  237. package/dist/lib/session-repair.cjs +0 -239
  238. package/dist/lib/session-repair.d.cts +0 -110
  239. package/dist/lib/session-utils.cjs +0 -209
  240. package/dist/lib/session-utils.d.cts +0 -63
  241. package/dist/lib/task-utils.cjs +0 -1137
  242. package/dist/lib/task-utils.d.cts +0 -208
  243. package/dist/lib/template-engine.cjs +0 -47
  244. package/dist/lib/template-engine.d.cts +0 -11
  245. package/dist/plugin/index.cjs +0 -1907
  246. package/dist/plugin/index.d.cts +0 -36
  247. package/dist/plugin/inject.cjs +0 -356
  248. package/dist/plugin/inject.d.cts +0 -54
  249. package/dist/plugin/inject.d.ts +0 -54
  250. package/dist/plugin/inject.js +0 -17
  251. package/dist/plugin/observe.cjs +0 -631
  252. package/dist/plugin/observe.d.cts +0 -39
  253. package/dist/plugin/observe.d.ts +0 -39
  254. package/dist/plugin/observe.js +0 -18
  255. package/dist/plugin/templates.cjs +0 -593
  256. package/dist/plugin/templates.d.cts +0 -52
  257. package/dist/plugin/templates.d.ts +0 -52
  258. package/dist/plugin/templates.js +0 -25
  259. package/dist/plugin/types.cjs +0 -18
  260. package/dist/plugin/types.d.cts +0 -209
  261. package/dist/plugin/types.d.ts +0 -209
  262. package/dist/plugin/types.js +0 -0
  263. package/dist/plugin/vault.cjs +0 -927
  264. package/dist/plugin/vault.d.cts +0 -68
  265. package/dist/plugin/vault.d.ts +0 -68
  266. package/dist/plugin/vault.js +0 -22
  267. package/dist/types-Y2_Um2Ls.d.cts +0 -205
  268. package/templates/memory-event.md +0 -67
  269. package/templates/party.md +0 -63
  270. package/templates/primitive-registry.yaml +0 -551
  271. package/templates/run.md +0 -68
  272. package/templates/trigger.md +0 -68
  273. package/templates/workspace.md +0 -50
package/README.md CHANGED
@@ -1,209 +1,490 @@
1
- # ClawVault
1
+ <div align="center">
2
2
 
3
- Structured memory for AI agents. Typed markdown primitives that compound over time.
3
+ # ClawVault 🐘
4
4
 
5
+ **Persistent Memory for AI Agents**
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)
6
12
 
7
- Every memory is a markdown file with YAML frontmatter — a task, a decision, a person, a lesson — each following a schema defined in `templates/`. The agent reads and writes these files. The human browses them in Obsidian. No database. No vendor lock-in. Just files.
13
+ *An elephant never forgets. Neither should your AI.*
8
14
 
9
- ## Requirements
15
+ [Documentation](https://clawvault.dev) · [npm Package](https://www.npmjs.com/package/clawvault) · [Obsidian Plugin](https://clawvault.dev/obsidian) · [Community](https://github.com/Versatly/clawvault/discussions) · [GitHub](https://github.com/Versatly/clawvault)
10
16
 
11
- - Node.js 18+
12
- - [`qmd`](https://github.com/qmd-project/qmd) installed and on `PATH` (hybrid BM25 + vector search)
17
+ </div>
13
18
 
14
- ## Install
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 |
15
87
 
16
- ### As an OpenClaw Plugin (recommended)
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
17
95
 
18
96
  ```bash
19
- openclaw plugins install clawvault
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
20
102
  ```
21
103
 
22
- This installs ClawVault as a memory plugin. It replaces OpenClaw's built-in memory with:
104
+ ### Initialize Your Vault
23
105
 
24
- - **Auto-recall** — injects relevant memories before each agent turn
25
- - **Auto-capture** observes conversations and stores durable knowledge automatically
26
- - **Session recap** on wake, provides context from active tasks, recent decisions, and preferences
27
- - **4 tools** — `memory_search`, `memory_store`, `memory_get`, `memory_forget`
106
+ ```bash
107
+ # Create a new vault
108
+ clawvault init ~/memory --name my-brain
28
109
 
29
- After install, configure the vault path:
110
+ # Optional: Set up Obsidian integration
111
+ clawvault setup --theme neural --canvas
112
+ ```
113
+
114
+ ### Basic Workflow
30
115
 
31
116
  ```bash
32
- openclaw config set plugins.clawvault.config.vaultPath ~/my-vault
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"
33
129
  ```
34
130
 
35
- ### As a Standalone CLI
131
+ ### Search and Context
36
132
 
37
133
  ```bash
38
- npm install -g clawvault
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"
39
143
  ```
40
144
 
41
- ## Quick Start
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
156
+
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:
42
169
 
43
170
  ```bash
44
- # Initialize a new vault
45
- clawvault init ~/my-vault --name my-brain
171
+ # View graph summary
172
+ clawvault graph
173
+
174
+ # Refresh graph index
175
+ clawvault graph --refresh
176
+ ```
46
177
 
47
- # Set up Obsidian Bases views (tasks, projects, backlog)
48
- clawvault setup
178
+ ### Context Profiles
49
179
 
50
- # Check vault health
51
- clawvault doctor
180
+ Different tasks need different context. Use profiles to tune retrieval:
52
181
 
53
- # Search your vault
54
- clawvault search "deployment decision"
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"
55
192
  ```
56
193
 
57
- ## How It Works
194
+ ### Task Management
58
195
 
59
- ### Typed Primitives
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
60
201
 
61
- Every piece of memory has a type defined by a template:
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
+ ```
62
236
 
63
- ```yaml
64
237
  ---
65
- primitive: task
66
- fields:
67
- status:
68
- type: string
69
- required: true
70
- default: open
71
- enum: [open, in-progress, blocked, done]
72
- priority:
73
- type: string
74
- enum: [critical, high, medium, low]
75
- owner:
76
- type: string
77
- due:
78
- type: date
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
+
79
270
  ---
271
+
272
+ ## Requirements
273
+
274
+ - Node.js 18+
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:
280
+
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"
80
298
  ```
81
299
 
82
- Default templates: `task`, `decision`, `lesson`, `person`, `project`, `checkpoint`, `handoff`, `daily`, `trigger`, `run`, `party`, `workspace`.
300
+ ## Install
83
301
 
84
- ### Malleable Schemas
302
+ ```bash
303
+ npm install -g clawvault
304
+ ```
85
305
 
86
- Don't like the defaults? Drop your own template in your vault's `templates/` directory. Add fields, remove fields, create entirely new types. The plugin reads YOUR schemas, not ours.
306
+ ## 5-Minute Setup
87
307
 
88
- ### Hybrid Search
308
+ ```bash
309
+ # 1) Create or initialize a vault
310
+ clawvault init ~/memory --name my-brain
89
311
 
90
- ClawVault uses `qmd` for search BM25 keyword matching combined with vector similarity and reranking. Entirely local. No API keys needed.
312
+ # 2) Optional vault bootstrap for Obsidian
313
+ clawvault setup --theme neural --canvas
91
314
 
92
- ### Obsidian Integration
315
+ # 3) Verify OpenClaw compatibility in this environment
316
+ clawvault compat
317
+ ```
93
318
 
94
- Your vault IS an Obsidian vault. Tasks become Kanban boards. Decisions are searchable. Wiki-links build a knowledge graph. Five generated Bases views out of the box:
319
+ ## OpenClaw Setup (Canonical)
95
320
 
96
- - All tasks
97
- - Blocked items
98
- - By project
99
- - By owner
100
- - Backlog
321
+ If you want hook-based lifecycle integration, use this sequence:
101
322
 
102
- ## CLI Commands
323
+ ```bash
324
+ # Install CLI
325
+ npm install -g clawvault
103
326
 
104
- ### Core
327
+ # Install and enable hook pack
328
+ openclaw hooks install clawvault
329
+ openclaw hooks enable clawvault
105
330
 
106
- | Command | Description |
107
- |---------|-------------|
108
- | `init [path]` | Initialize a new vault |
109
- | `setup` | Auto-discover and configure a vault, create Obsidian views |
110
- | `store` | Store a new typed memory document |
111
- | `capture <note>` | Quick-capture a note to inbox |
112
- | `doctor` | Diagnose vault health |
331
+ # Verify
332
+ openclaw hooks list --verbose
333
+ openclaw hooks info clawvault
334
+ openclaw hooks check
335
+ clawvault compat
336
+ ```
113
337
 
114
- ### Search & Context
338
+ Important:
115
339
 
116
- | Command | Description |
117
- |---------|-------------|
118
- | `search <query>` | BM25 keyword search via qmd |
119
- | `vsearch <query>` | Semantic vector search via qmd |
120
- | `context <task>` | Generate task-relevant context |
121
- | `inject <message>` | Inject relevant rules and decisions |
340
+ - `clawhub install clawvault` installs skill guidance, but does not replace hook-pack installation.
341
+ - After enabling hooks, restart the OpenClaw gateway process so hook registration reloads.
122
342
 
123
- ### Session Lifecycle
343
+ ## Minimal AGENTS.md Additions
124
344
 
125
- | Command | Description |
126
- |---------|-------------|
127
- | `wake` | Start a session (recover + recap) |
128
- | `sleep <summary>` | End a session with a handoff |
129
- | `checkpoint` | Save state for context-death resilience |
130
- | `recover` | Check for and recover from context death |
345
+ Append these to your existing memory workflow. Do not replace your full prompt setup:
131
346
 
132
- ### Observation Pipeline
347
+ ```markdown
348
+ ## ClawVault
349
+ - Run `clawvault wake` at session start.
350
+ - Run `clawvault checkpoint` during heavy work.
351
+ - Run `clawvault sleep "summary" --next "next steps"` before ending.
352
+ - Use `clawvault context "<task>"` or `clawvault inject "<message>"` before complex decisions.
353
+ ```
133
354
 
134
- | Command | Description |
135
- |---------|-------------|
136
- | `observe` | Process sessions into observational memory |
137
- | `reflect` | Promote observations to weekly reflections |
138
- | `reweave` | Backward consolidation — mark superseded observations |
355
+ ---
139
356
 
140
- ### Tasks & Projects
357
+ ## CLI Reference
141
358
 
142
- | Command | Description |
143
- |---------|-------------|
144
- | `task` | Task management (create, list, update, transition) |
145
- | `project` | Project management |
146
- | `kanban` | Kanban board view |
147
- | `status` | Vault health and statistics |
359
+ ### Core Commands
148
360
 
149
- ### Utilities
361
+ - `init`, `setup`, `store`, `capture`
362
+ - `remember`, `list`, `get`, `stats`, `reindex`, `sync`
150
363
 
151
- | Command | Description |
152
- |---------|-------------|
153
- | `template` | Manage document templates |
154
- | `graph` | Show typed memory graph summary |
155
- | `entities` | List all linkable entities |
156
- | `link [file]` | Auto-link entity mentions |
157
- | `compat` | Check OpenClaw compatibility |
158
- | `embed` | Run qmd embedding for pending documents |
364
+ ### Context + Memory
159
365
 
160
- ## Architecture
366
+ - `search`, `vsearch`, `context`, `inject`
367
+ - `observe`, `reflect`, `session-recap`
368
+ - `graph`, `entities`, `link`, `embed`
161
369
 
370
+ ### Resilience
371
+
372
+ - `wake`, `sleep`, `handoff`, `recap`
373
+ - `checkpoint`, `recover`, `status`, `clean-exit`, `repair-session`
374
+ - `compat`, `doctor`
375
+
376
+ ### Execution Primitives
377
+
378
+ - `task ...`, `backlog ...`, `blocked`, `project ...`, `kanban ...`
379
+ - `canvas` (generates default `dashboard.canvas`)
380
+
381
+ ### Networking
382
+
383
+ - `tailscale-status`, `tailscale-sync`, `tailscale-serve`, `tailscale-discover`
384
+
385
+ ---
386
+
387
+ ## Quick Usage Examples
388
+
389
+ ```bash
390
+ # Store and retrieve memory
391
+ clawvault remember decision "Use PostgreSQL" --content "Chosen for JSONB and reliability"
392
+ clawvault search "postgresql"
393
+ clawvault vsearch "what did we decide about storage"
394
+
395
+ # Session lifecycle
396
+ clawvault wake
397
+ clawvault checkpoint --working-on "auth rollout" --focus "token refresh edge cases"
398
+ clawvault sleep "finished auth rollout plan" --next "implement migration"
399
+
400
+ # Work management
401
+ clawvault task add "Ship v2 onboarding" --owner agent --project core --priority high
402
+ clawvault blocked
403
+ clawvault project list --status active
404
+ clawvault kanban sync
405
+
406
+ # Obsidian projection
407
+ clawvault canvas
162
408
  ```
163
- HUMAN (Obsidian)
164
- Browse, edit, approve
165
-
166
-
167
- ┌─── VAULT (markdown) ───┐
168
- │ Typed primitives │
169
- │ Knowledge graph │
170
- │ Template schemas │
171
- └───┬──────────────┬──────┘
172
- │ │
173
- AGENT (Plugin) CLI (Developer)
174
- Auto-capture Direct CRUD
175
- Auto-recall Search, graph
176
- Session recap Tasks, projects
409
+
410
+ ---
411
+
412
+ ## Tailscale + WebDAV
413
+
414
+ ClawVault can serve vault content for sync over Tailscale and exposes WebDAV under `/webdav` for mobile-oriented workflows.
415
+
416
+ ```bash
417
+ clawvault tailscale-status
418
+ clawvault tailscale-serve --vault ~/memory
419
+ clawvault tailscale-discover
177
420
  ```
178
421
 
179
- ## OpenClaw Plugin Details
422
+ ---
180
423
 
181
- The plugin hooks into the OpenClaw lifecycle:
424
+ ## Vault Structure
182
425
 
183
- - **`before_agent_start`** — auto-recall: searches vault for context relevant to the current conversation and injects it
184
- - **`message_received`** — auto-capture: observes incoming messages for durable information worth storing
185
- - **`agent_end`** captures any final observations from the agent's response
186
- - **`before_compaction`** — preserves important context before conversation compaction
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
+
445
+ ## Troubleshooting
446
+
447
+ - Hook not found after enable:
448
+ - run `openclaw hooks install clawvault` first
449
+ - then `openclaw hooks enable clawvault`
450
+ - restart gateway
451
+ - verify with `openclaw hooks list --verbose`
452
+ - `qmd` errors:
453
+ - ensure `qmd --version` works from same shell
454
+ - rerun `clawvault setup` after qmd install
455
+ - OpenClaw integration drift:
456
+ - run `clawvault compat`
457
+ - Session transcript corruption:
458
+ - run `clawvault repair-session --dry-run` then `clawvault repair-session`
459
+
460
+ ---
461
+
462
+ ## Links
187
463
 
188
- Configuration in `openclaw.plugin.json`:
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
+ ---
189
486
 
190
- | Option | Default | Description |
191
- |--------|---------|-------------|
192
- | `vaultPath` | — | Path to vault directory |
193
- | `collection` | `clawvault` | qmd search collection name |
194
- | `autoRecall` | `true` | Inject memories before each turn |
195
- | `autoCapture` | `true` | Auto-store from conversations |
196
- | `recallLimit` | `5` | Max memories per recall |
197
-
198
- ## What Compounds
199
-
200
- - **Decisions** accumulate into institutional knowledge
201
- - **Lessons** prevent repeated mistakes
202
- - **Tasks** with transition ledgers track how work happened
203
- - **Projects** group related work across hundreds of sessions
204
- - **Wiki-links** build a knowledge graph that grows richer over time
205
-
206
- The agent that runs for a year generates compounding value. Every lesson stored makes the next task cheaper.
487
+ **$CLAWVAULT**: [`5Fjr82MTB8mvxkzi9FYtvrUsPiDGE2M29w3dYcZpump`](https://pump.fun/coin/5Fjr82MTB8mvxkzi9FYtvrUsPiDGE2M29w3dYcZpump)
207
488
 
208
489
  ## License
209
490
 
package/bin/clawvault.js CHANGED
@@ -23,12 +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';
27
+ import { registerTailscaleCommands } from './register-tailscale-commands.js';
26
28
  import {
27
29
  getVault,
28
30
  resolveVaultPath,
29
31
  runQmd,
30
32
  printQmdMissing,
31
- QmdUnavailableError
33
+ printQmdConfigError,
34
+ QmdUnavailableError,
35
+ QmdConfigurationError
32
36
  } from './command-runtime.js';
33
37
  import {
34
38
  createVault
@@ -65,7 +69,9 @@ registerQueryCommands(program, {
65
69
  getVault,
66
70
  resolveVaultPath,
67
71
  QmdUnavailableError,
68
- printQmdMissing
72
+ QmdConfigurationError,
73
+ printQmdMissing,
74
+ printQmdConfigError
69
75
  });
70
76
 
71
77
  registerSessionLifecycleCommands(program, {
@@ -103,6 +109,8 @@ registerProjectCommands(program, {
103
109
  resolveVaultPath
104
110
  });
105
111
 
112
+ registerWorkgraphCommands(program, { chalk, resolveVaultPath });
113
+ registerTailscaleCommands(program, { chalk });
106
114
  registerConfigCommands(program, { chalk, resolveVaultPath });
107
115
  registerRouteCommands(program, { chalk, resolveVaultPath });
108
116