fix(memory): honor empty extraction results
Memind CI / Test, build, and release guards (push) Successful in 2m55s
Memind CI / Test, build, and release guards (push) Successful in 2m55s
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
包含已注入的 `[Memory Context]`。提取器因此可能把旧记忆再次沉淀,而忽略用户本轮明确
|
||||
要求保存的内容,形成旧记忆自我复制。
|
||||
|
||||
提取器返回 `{"memories":[]}` 时,旧逻辑仍会触发规则回退,可能把“……是什么”一类
|
||||
问句误存为事实。空数组必须视为成功的“无需保存”判断;只有提取不可用并返回 `null`
|
||||
时才允许规则回退。
|
||||
|
||||
当前生产使用的本地 hash embedding 只有 3 维,且连续中文可能被视为单个 token。即使正确
|
||||
记忆已进入 pgvector,它也可能排在向量 Top-K 之外。因此 pgvector 读取必须合并有界的
|
||||
向量候选与最近候选,再以中文字符 n-gram 查询覆盖率重排;无词法重合时保持向量排序。
|
||||
@@ -41,11 +45,13 @@
|
||||
原始消息查询失败时必须 fail-open 到现有可见会话,不能阻塞保存接口。
|
||||
8. pgvector 召回必须同时覆盖有界向量候选和有界最近候选,去重后只返回请求的 limit;
|
||||
中文词法重排用于弥补低维本地 hash 的排序缺陷,且候选池上限不得超过 100。
|
||||
9. LLM 提取明确返回空数组时不得再走规则回退;提取提示必须明确排除没有提供答案的
|
||||
问题、请求、指令和待办,避免把问句本身沉淀为长期记忆。
|
||||
|
||||
## 回归检查
|
||||
|
||||
```bash
|
||||
node --test conversation-repair.test.mjs memory-v2-personal-store.test.mjs memory-v2-lifecycle.test.mjs \
|
||||
node --test conversation-memory.test.mjs conversation-repair.test.mjs memory-v2-personal-store.test.mjs memory-v2-lifecycle.test.mjs \
|
||||
memory-v2-pgvector-backfill.test.mjs memory-v2-runtime.test.mjs
|
||||
npm test
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user