whale-memory-core 0.8.1 → 0.8.2

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 (2) hide show
  1. package/demo.mjs +7 -2
  2. package/package.json +1 -1
package/demo.mjs CHANGED
@@ -26,8 +26,13 @@ const e = exp.addExperience(dir, {
26
26
  console.log('\n[写] id=', e.id, '| 重要度=', e.weight)
27
27
 
28
28
  // 2) 第二天她想起(相关话题触发);mark:true 表示这次取回也记一次“想起”
29
- const hits = exp.recall(dir, '那本书里那个人后来怎样了', { limit: 1, mark: true })
30
- console.log('\n[想起]\n' + exp.renderTwoPart(hits[0]))
29
+ // 查询要用能命中的短锚点;长问句会被“≥8 字要求 60% 命中”的门槛挡住(这是故意的)
30
+ const hits = exp.recall(dir, '烤肉', { limit: 1, mark: true })
31
+ if (!hits.length) {
32
+ console.log('\n[想起] 这次什么都没想起来(查询和记录没有足够重叠)')
33
+ } else {
34
+ console.log('\n[想起]\n' + exp.renderTwoPart(hits[0]))
35
+ }
31
36
 
32
37
  // 3) 她改主意:只往 later 追加,不动"当时"
33
38
  exp.reviseExperience(dir, { id: e.id, thought: '现在觉得那个人其实是在护着朋友', reason: '读到后面那段' })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whale-memory-core",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Self-layer autobiographical memory core: then / later, append-only. Vault, evidence and consolidation live in the QQ Agent plugin.",
5
5
  "type": "module",
6
6
  "main": "./index.js",