dsh-memory-bond 0.3.0-beta.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CHANGELOG.md +6 -7
  2. package/README.md +125 -91
  3. package/README.zh-CN.md +122 -92
  4. package/SECURITY.md +29 -0
  5. package/dist/audit.js +155 -80
  6. package/dist/automatic.js +10 -2
  7. package/dist/client.js +2035 -0
  8. package/dist/command-scope.js +4 -4
  9. package/dist/commands.js +15 -9
  10. package/dist/consolidation-store.js +87 -20
  11. package/dist/consolidation.js +2 -6
  12. package/dist/domain.js +8 -4
  13. package/dist/encoder.js +46 -5
  14. package/dist/file-import-store.js +120 -0
  15. package/dist/file-import.js +265 -0
  16. package/dist/foreground-attempts.js +91 -0
  17. package/dist/guidance.js +133 -92
  18. package/dist/host.js +13 -0
  19. package/dist/index-policy.js +91 -48
  20. package/dist/index.js +102 -40
  21. package/dist/knowledge-hooks.js +70 -27
  22. package/dist/knowledge.js +2 -3
  23. package/dist/maintenance-store.js +38 -4
  24. package/dist/maintenance.js +29 -5
  25. package/dist/personal.js +37 -0
  26. package/dist/policy.js +45 -47
  27. package/dist/prompt-copy.js +93 -0
  28. package/dist/proposal-receipts.js +70 -0
  29. package/dist/proposal-review.js +656 -0
  30. package/dist/propose-contract.js +32 -36
  31. package/dist/question-answers.js +86 -29
  32. package/dist/retrieval.js +25 -8
  33. package/dist/scope-narrowing.js +49 -0
  34. package/dist/search-index.js +93 -13
  35. package/dist/semantic.js +69 -207
  36. package/dist/service.js +633 -204
  37. package/dist/sharing.js +7 -13
  38. package/dist/sources.js +28 -3
  39. package/dist/store.js +432 -96
  40. package/dist/tool-experience.js +87 -0
  41. package/dist/turn-review-store.js +83 -16
  42. package/dist/turn-review.js +155 -59
  43. package/dist/ui.js +128 -26
  44. package/dist/vector-index.js +69 -33
  45. package/docs/architecture.zh-CN.md +52 -0
  46. package/docs/benchmark.zh-CN.md +60 -0
  47. package/docs/benchmarks/repository-tasks.json +5355 -0
  48. package/docs/images/bond-memory-principle-en.svg +644 -0
  49. package/docs/images/bond-memory-principle-zh.svg +644 -0
  50. package/docs/images/bond-memory-principle.drawio +644 -0
  51. package/docs/images/memory-settings-en.png +0 -0
  52. package/docs/images/memory-settings-zh.png +0 -0
  53. package/docs/images/memory-turn-recalled-en.png +0 -0
  54. package/docs/images/memory-turn-recalled-zh.png +0 -0
  55. package/docs/images/memory-turn-saved-en.png +0 -0
  56. package/docs/images/memory-turn-saved-zh.png +0 -0
  57. package/docs/media/memory-bond-name-en.gif +0 -0
  58. package/docs/media/memory-bond-name-en.mp4 +0 -0
  59. package/docs/media/memory-bond-name-zh.gif +0 -0
  60. package/docs/media/memory-bond-name-zh.mp4 +0 -0
  61. package/locale/detail.en.md +5 -1
  62. package/locale/detail.zh.md +5 -1
  63. package/locale/en.json +338 -0
  64. package/locale/zh.json +338 -0
  65. package/native/embeddings/NOTICE.md +2 -2
  66. package/package.json +39 -19
  67. package/scripts/benchmark-bond.mjs +72 -0
  68. package/scripts/benchmark-conditions.mjs +144 -0
  69. package/scripts/benchmark-example.mjs +37 -0
  70. package/scripts/benchmark-scale.mjs +119 -0
  71. package/scripts/benchmark-scenarios.mjs +57 -0
  72. package/scripts/benchmark-tasks.mjs +244 -0
  73. package/src/audit.ts +144 -85
  74. package/src/automatic.ts +12 -2
  75. package/src/command-scope.ts +4 -4
  76. package/src/commands.ts +12 -8
  77. package/src/consolidation-store.ts +80 -18
  78. package/src/consolidation.ts +2 -6
  79. package/src/domain.ts +9 -4
  80. package/src/encoder.ts +46 -6
  81. package/src/file-import-store.ts +139 -0
  82. package/src/file-import.ts +256 -0
  83. package/src/foreground-attempts.ts +97 -0
  84. package/src/guidance.ts +138 -102
  85. package/src/host.ts +22 -2
  86. package/src/index-policy.ts +93 -46
  87. package/src/index.ts +87 -43
  88. package/src/knowledge-hooks.ts +71 -29
  89. package/src/knowledge.ts +2 -3
  90. package/src/maintenance-store.ts +37 -4
  91. package/src/maintenance.ts +25 -5
  92. package/src/personal.ts +36 -0
  93. package/src/policy.ts +55 -52
  94. package/src/prompt-copy.ts +99 -0
  95. package/src/proposal-receipts.ts +59 -0
  96. package/src/proposal-review.ts +614 -0
  97. package/src/propose-contract.ts +31 -35
  98. package/src/question-answers.ts +99 -29
  99. package/src/retrieval.ts +26 -9
  100. package/src/scope-narrowing.ts +58 -0
  101. package/src/search-index.ts +94 -14
  102. package/src/semantic.ts +67 -188
  103. package/src/service.ts +595 -210
  104. package/src/sharing.ts +7 -14
  105. package/src/sources.ts +26 -4
  106. package/src/store.ts +434 -97
  107. package/src/tool-experience.ts +93 -0
  108. package/src/turn-review-store.ts +86 -15
  109. package/src/turn-review.ts +142 -60
  110. package/src/ui.ts +122 -27
  111. package/src/vector-index.ts +57 -29
  112. package/client/index.js +0 -1186
  113. package/design/dsh-memory-plugin-design.md +0 -46
  114. package/design/dsh-memory-plugin-evaluation.md +0 -135
  115. package/design/evaluations/locomo-conv-26-2026-12-03.json +0 -252
  116. package/design/evaluations/locomo-conv-26-paired-2026-12-03.json +0 -549
  117. package/design/evaluations/locomo-conv-26-write-replay-2026-12-03.json +0 -289
  118. package/design/evaluations/project-memory-tasks-2026-12-03.json +0 -1059
  119. package/design/memory-lifecycle-consolidation.excalidraw +0 -1212
  120. package/design/memory-lifecycle-consolidation.mobile.excalidraw +0 -1083
  121. package/design/memory-lifecycle-consolidation.mobile.svg +0 -2
  122. package/design/memory-lifecycle-consolidation.mobile.zh-CN.excalidraw +0 -1083
  123. package/design/memory-lifecycle-consolidation.mobile.zh-CN.svg +0 -94
  124. package/design/memory-lifecycle-consolidation.svg +0 -2
  125. package/design/memory-lifecycle-consolidation.zh-CN.excalidraw +0 -1212
  126. package/design/memory-lifecycle-consolidation.zh-CN.svg +0 -94
  127. package/design/memory-lifecycle.excalidraw +0 -2105
  128. package/design/memory-lifecycle.mobile.excalidraw +0 -1896
  129. package/design/memory-lifecycle.mobile.svg +0 -95
  130. package/design/memory-lifecycle.mobile.zh-CN.excalidraw +0 -1896
  131. package/design/memory-lifecycle.mobile.zh-CN.svg +0 -97
  132. package/design/memory-lifecycle.svg +0 -95
  133. package/design/memory-lifecycle.zh-CN.excalidraw +0 -2105
  134. package/design/memory-lifecycle.zh-CN.svg +0 -97
  135. package/native/embeddings/LICENSE +0 -21
  136. package/native/embeddings/en/model.onnx +0 -4
  137. package/native/embeddings/en/vocab.txt +0 -30522
  138. package/native/embeddings/runtime/LICENSE +0 -21
  139. package/native/embeddings/runtime/ThirdPartyNotices.txt +0 -6156
  140. package/native/embeddings/runtime/ort-wasm-simd-threaded.mjs +0 -70
  141. package/native/embeddings/runtime/ort-wasm-simd-threaded.wasm +0 -0
  142. package/native/embeddings/runtime/ort.wasm.min.mjs +0 -7
  143. package/native/embeddings/worker.mjs +0 -97
  144. package/native/embeddings/zh/model.onnx +0 -0
  145. package/native/embeddings/zh/vocab.txt +0 -21128
@@ -1,549 +0,0 @@
1
- {
2
- "model": "deepseek-flash",
3
- "dataset": "https://github.com/snap-research/locomo",
4
- "upstreamCommit": "3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376",
5
- "datasetSha256": "79fa87e90f04081343b8c8debecb80a9a6842b76a7aa537dc9fdf651ea698ff4",
6
- "sampleId": "conv-26",
7
- "questionSeed": "dsh-locomo-pilot-v1",
8
- "instruction": "Answer the following question in a short English phrase. If you have insufficient information, answer \"Unknown\".",
9
- "storedMemories": 118,
10
- "sessionCount": 19,
11
- "conditions": {
12
- "empty": "New chat, no plugin or transcript",
13
- "keeper": "New chat with stored memories and the plugin",
14
- "history": "New chat with the plugin off and all dated dialogue turns and image captions in the prompt"
15
- },
16
- "metric": "Official LoCoMo token F1 (0 to 1), averaged over all 20 items; five per category",
17
- "categoryNames": {
18
- "1": "multi-hop",
19
- "2": "temporal",
20
- "3": "open-domain",
21
- "4": "single-hop"
22
- },
23
- "usageScope": "QA requests only. The original ingestion cost is separate. Capped answers are scored as empty.",
24
- "results": {
25
- "empty": {
26
- "f1": 0,
27
- "byCategory": {
28
- "1": {
29
- "count": 5,
30
- "f1": 0
31
- },
32
- "2": {
33
- "count": 5,
34
- "f1": 0
35
- },
36
- "3": {
37
- "count": 5,
38
- "f1": 0
39
- },
40
- "4": {
41
- "count": 5,
42
- "f1": 0
43
- }
44
- },
45
- "usage": {
46
- "requests": 92,
47
- "reportedRequests": 92,
48
- "inputTokens": 577993,
49
- "cacheReadTokens": 555008,
50
- "cacheMissTokens": 22985,
51
- "outputTokens": 18691
52
- }
53
- },
54
- "keeper": {
55
- "f1": 0.27057692307692305,
56
- "byCategory": {
57
- "1": {
58
- "count": 5,
59
- "f1": 0.13
60
- },
61
- "2": {
62
- "count": 5,
63
- "f1": 0.39999999999999997
64
- },
65
- "3": {
66
- "count": 5,
67
- "f1": 0.026666666666666665
68
- },
69
- "4": {
70
- "count": 5,
71
- "f1": 0.5256410256410257
72
- }
73
- },
74
- "usage": {
75
- "requests": 54,
76
- "reportedRequests": 54,
77
- "inputTokens": 1031787,
78
- "cacheReadTokens": 781184,
79
- "cacheMissTokens": 250603,
80
- "outputTokens": 9675
81
- }
82
- },
83
- "history": {
84
- "f1": 0.4159011587916253,
85
- "byCategory": {
86
- "1": {
87
- "count": 5,
88
- "f1": 0.38492063492063494
89
- },
90
- "2": {
91
- "count": 5,
92
- "f1": 0.49606060606060604
93
- },
94
- "3": {
95
- "count": 5,
96
- "f1": 0.05517241379310345
97
- },
98
- "4": {
99
- "count": 5,
100
- "f1": 0.7274509803921568
101
- }
102
- },
103
- "usage": {
104
- "requests": 20,
105
- "reportedRequests": 20,
106
- "inputTokens": 452779,
107
- "cacheReadTokens": 428672,
108
- "cacheMissTokens": 24107,
109
- "outputTokens": 6747
110
- }
111
- }
112
- },
113
- "comparisons": {
114
- "empty": {
115
- "keeperMinusBaselinePoints": 27.057692307692307,
116
- "higher": 12,
117
- "equal": 8,
118
- "lower": 0
119
- },
120
- "history": {
121
- "keeperMinusBaselinePoints": -14.532423571470227,
122
- "higher": 3,
123
- "equal": 7,
124
- "lower": 10
125
- }
126
- },
127
- "questions": [
128
- {
129
- "index": 11,
130
- "category": 1,
131
- "answers": {
132
- "empty": {
133
- "prediction": "Unknown",
134
- "f1": 0,
135
- "stopReason": "completed"
136
- },
137
- "keeper": {
138
- "prediction": "Sweden (her home country)",
139
- "f1": 0.4,
140
- "stopReason": "completed"
141
- },
142
- "history": {
143
- "prediction": "Sweden",
144
- "f1": 1,
145
- "stopReason": "completed"
146
- }
147
- }
148
- },
149
- {
150
- "index": 12,
151
- "category": 2,
152
- "answers": {
153
- "empty": {
154
- "prediction": "Unknown",
155
- "f1": 0,
156
- "stopReason": "completed"
157
- },
158
- "keeper": {
159
- "prediction": "About 10 years ago (around 2013).",
160
- "f1": 0.6666666666666666,
161
- "stopReason": "completed"
162
- },
163
- "history": {
164
- "prediction": "About 10 years ago (in 2013).",
165
- "f1": 0.6666666666666666,
166
- "stopReason": "completed"
167
- }
168
- }
169
- },
170
- {
171
- "index": 14,
172
- "category": 3,
173
- "answers": {
174
- "empty": {
175
- "prediction": "Unknown",
176
- "f1": 0,
177
- "stopReason": "completed"
178
- },
179
- "keeper": {
180
- "prediction": "Unknown",
181
- "f1": 0,
182
- "stopReason": "completed"
183
- },
184
- "history": {
185
- "prediction": "Unknown",
186
- "f1": 0,
187
- "stopReason": "completed"
188
- }
189
- }
190
- },
191
- {
192
- "index": 24,
193
- "category": 1,
194
- "answers": {
195
- "empty": {
196
- "prediction": "Unknown",
197
- "f1": 0,
198
- "stopReason": "completed"
199
- },
200
- "keeper": {
201
- "prediction": "Painting.",
202
- "f1": 0,
203
- "stopReason": "completed"
204
- },
205
- "history": {
206
- "prediction": "She goes running.",
207
- "f1": 0.25,
208
- "stopReason": "completed"
209
- }
210
- }
211
- },
212
- {
213
- "index": 28,
214
- "category": 2,
215
- "answers": {
216
- "empty": {
217
- "prediction": "Unknown",
218
- "f1": 0,
219
- "stopReason": "completed"
220
- },
221
- "keeper": {
222
- "prediction": "Friday, 14 July 2023.",
223
- "f1": 0.6666666666666665,
224
- "stopReason": "completed"
225
- },
226
- "history": {
227
- "prediction": "On Friday, 14 July 2023.",
228
- "f1": 0.6,
229
- "stopReason": "completed"
230
- }
231
- }
232
- },
233
- {
234
- "index": 30,
235
- "category": 3,
236
- "answers": {
237
- "empty": {
238
- "prediction": "Unknown.",
239
- "f1": 0,
240
- "stopReason": "completed"
241
- },
242
- "keeper": {
243
- "prediction": "Unknown",
244
- "f1": 0,
245
- "stopReason": "completed"
246
- },
247
- "history": {
248
- "prediction": "No — she is a married woman with a husband and children and is portrayed as an ally, not an LGBTQ community member.",
249
- "f1": 0.27586206896551724,
250
- "stopReason": "completed"
251
- }
252
- }
253
- },
254
- {
255
- "index": 40,
256
- "category": 1,
257
- "answers": {
258
- "empty": {
259
- "prediction": "Unknown",
260
- "f1": 0,
261
- "stopReason": "completed"
262
- },
263
- "keeper": {
264
- "prediction": "Once or twice a year (one beach trip confirmed before July 2023).",
265
- "f1": 0,
266
- "stopReason": "completed"
267
- },
268
- "history": {
269
- "prediction": "",
270
- "f1": 0,
271
- "stopReason": "max-tokens"
272
- }
273
- }
274
- },
275
- {
276
- "index": 44,
277
- "category": 2,
278
- "answers": {
279
- "empty": {
280
- "prediction": "Unknown",
281
- "f1": 0,
282
- "stopReason": "completed"
283
- },
284
- "keeper": {
285
- "prediction": "August 13th.",
286
- "f1": 0.5,
287
- "stopReason": "completed"
288
- },
289
- "history": {
290
- "prediction": "August 13 (celebrated the night before the August 14, 2023 conversation).",
291
- "f1": 0.3636363636363636,
292
- "stopReason": "completed"
293
- }
294
- }
295
- },
296
- {
297
- "index": 49,
298
- "category": 2,
299
- "answers": {
300
- "empty": {
301
- "prediction": "Unknown",
302
- "f1": 0,
303
- "stopReason": "completed"
304
- },
305
- "keeper": {
306
- "prediction": "In 2022 (they described it as \"last year\" in August 2023).",
307
- "f1": 0.16666666666666669,
308
- "stopReason": "completed"
309
- },
310
- "history": {
311
- "prediction": "Last year (2022); the exact date isn’t specified.",
312
- "f1": 0.25,
313
- "stopReason": "completed"
314
- }
315
- }
316
- },
317
- {
318
- "index": 50,
319
- "category": 3,
320
- "answers": {
321
- "empty": {
322
- "prediction": "Unknown",
323
- "f1": 0,
324
- "stopReason": "completed"
325
- },
326
- "keeper": {
327
- "prediction": "Likely liberal/progressive.",
328
- "f1": 0,
329
- "stopReason": "completed"
330
- },
331
- "history": {
332
- "prediction": "Likely progressive/left-leaning.",
333
- "f1": 0,
334
- "stopReason": "completed"
335
- }
336
- }
337
- },
338
- {
339
- "index": 51,
340
- "category": 1,
341
- "answers": {
342
- "empty": {
343
- "prediction": "Unknown",
344
- "f1": 0,
345
- "stopReason": "completed"
346
- },
347
- "keeper": {
348
- "prediction": "A horse on a wooden wall (plus a lake sunrise).",
349
- "f1": 0.16666666666666666,
350
- "stopReason": "completed"
351
- },
352
- "history": {
353
- "prediction": "A lake sunrise.",
354
- "f1": 0.2222222222222222,
355
- "stopReason": "completed"
356
- }
357
- }
358
- },
359
- {
360
- "index": 59,
361
- "category": 3,
362
- "answers": {
363
- "empty": {
364
- "prediction": "Unknown.",
365
- "f1": 0,
366
- "stopReason": "completed"
367
- },
368
- "keeper": {
369
- "prediction": "Unknown — no clear indication of Caroline's personal religious beliefs.",
370
- "f1": 0.13333333333333333,
371
- "stopReason": "completed"
372
- },
373
- "history": {
374
- "prediction": "Yes, likely.",
375
- "f1": 0,
376
- "stopReason": "completed"
377
- }
378
- }
379
- },
380
- {
381
- "index": 69,
382
- "category": 3,
383
- "answers": {
384
- "empty": {
385
- "prediction": "Unknown",
386
- "f1": 0,
387
- "stopReason": "completed"
388
- },
389
- "keeper": {
390
- "prediction": "",
391
- "f1": 0,
392
- "stopReason": "Verification request limit"
393
- },
394
- "history": {
395
- "prediction": "Caring, empathetic, courageous, resilient, and inspiring.",
396
- "f1": 0,
397
- "stopReason": "completed"
398
- }
399
- }
400
- },
401
- {
402
- "index": 70,
403
- "category": 1,
404
- "answers": {
405
- "empty": {
406
- "prediction": "Unknown",
407
- "f1": 0,
408
- "stopReason": "completed"
409
- },
410
- "keeper": {
411
- "prediction": "A transgender conference and a school event where she spoke about her transgender journey.",
412
- "f1": 0.08333333333333334,
413
- "stopReason": "completed"
414
- },
415
- "history": {
416
- "prediction": "A transgender conference and a transgender poetry reading.",
417
- "f1": 0.45238095238095244,
418
- "stopReason": "completed"
419
- }
420
- }
421
- },
422
- {
423
- "index": 79,
424
- "category": 2,
425
- "answers": {
426
- "empty": {
427
- "prediction": "Unknown",
428
- "f1": 0,
429
- "stopReason": "completed"
430
- },
431
- "keeper": {
432
- "prediction": "Unknown",
433
- "f1": 0,
434
- "stopReason": "completed"
435
- },
436
- "history": {
437
- "prediction": "Last Friday, 20 October 2023.",
438
- "f1": 0.6,
439
- "stopReason": "completed"
440
- }
441
- }
442
- },
443
- {
444
- "index": 117,
445
- "category": 4,
446
- "answers": {
447
- "empty": {
448
- "prediction": "Unknown",
449
- "f1": 0,
450
- "stopReason": "completed"
451
- },
452
- "keeper": {
453
- "prediction": "Once or twice a year.",
454
- "f1": 1,
455
- "stopReason": "completed"
456
- },
457
- "history": {
458
- "prediction": "Once or twice a year.",
459
- "f1": 1,
460
- "stopReason": "completed"
461
- }
462
- }
463
- },
464
- {
465
- "index": 123,
466
- "category": 4,
467
- "answers": {
468
- "empty": {
469
- "prediction": "Unknown",
470
- "f1": 0,
471
- "stopReason": "completed"
472
- },
473
- "keeper": {
474
- "prediction": "A guinea pig named Oscar.",
475
- "f1": 0.6666666666666666,
476
- "stopReason": "completed"
477
- },
478
- "history": {
479
- "prediction": "A guinea pig named Oscar.",
480
- "f1": 0.6666666666666666,
481
- "stopReason": "completed"
482
- }
483
- }
484
- },
485
- {
486
- "index": 131,
487
- "category": 4,
488
- "answers": {
489
- "empty": {
490
- "prediction": "Unknown",
491
- "f1": 0,
492
- "stopReason": "completed"
493
- },
494
- "keeper": {
495
- "prediction": "**Ed Sheeran** (particularly his song “Perfect”).",
496
- "f1": 0.5,
497
- "stopReason": "completed"
498
- },
499
- "history": {
500
- "prediction": "Ed Sheeran",
501
- "f1": 1,
502
- "stopReason": "completed"
503
- }
504
- }
505
- },
506
- {
507
- "index": 132,
508
- "category": 4,
509
- "answers": {
510
- "empty": {
511
- "prediction": "Unknown",
512
- "f1": 0,
513
- "stopReason": "completed"
514
- },
515
- "keeper": {
516
- "prediction": "Unknown",
517
- "f1": 0,
518
- "stopReason": "completed"
519
- },
520
- "history": {
521
- "prediction": "Seven years.",
522
- "f1": 0.5,
523
- "stopReason": "completed"
524
- }
525
- }
526
- },
527
- {
528
- "index": 145,
529
- "category": 4,
530
- "answers": {
531
- "empty": {
532
- "prediction": "Unknown.",
533
- "f1": 0,
534
- "stopReason": "completed"
535
- },
536
- "keeper": {
537
- "prediction": "Family is super important to her—after the accident she realized how much she needs them and they mean the world to her.",
538
- "f1": 0.46153846153846156,
539
- "stopReason": "completed"
540
- },
541
- "history": {
542
- "prediction": "Family means the world to her and she's thankful to have them.",
543
- "f1": 0.47058823529411764,
544
- "stopReason": "completed"
545
- }
546
- }
547
- }
548
- ]
549
- }