开发者

verify

verify 允许一次检索执行额外的检索轮次。每一轮都会排除此前各轮已返回的结果,因此第二轮能够触及第一轮未覆盖的记忆。

Tablet 2 及更新版本支持。向未实现该功能的引擎请求时,调用在发出前即被拒绝,因此不会为一次静默无效的轮次计费。

searchrecall 上的整数,取值 0-3。表示额外轮次的数量,因此 3 允许四次检索。默认 0。

hits = mem.search("what did I eat", verify=3)
# the SDKs hand back the memories; `verify_used` is on the HTTP response (curl tab)
const hits = await mem.search("what did I eat", undefined, 10, { verify: 3 });
// the SDKs hand back the memories; `verify_used` is on the HTTP response (curl tab)
let hits = mem.search_opts("what did I eat", None, 10,
                            &SearchOpts { verify: Some(3), ..Default::default() }).await?;
// the SDKs hand back the memories; `verify_used` is on the HTTP response (curl tab)
curl -X POST https://api.wontopos.com/api/v1/memory/search \
  -H "X-API-Key: $WOS_KEY" -H "Content-Type: application/json" \
  -d '{"user_id":"alice","query":"what did I eat","verify":3}'
# → {"memories":[…], "verify_used":1}

该循环中不运行语言模型

每一轮会带上已返回的 id,引擎将其排除并继续向后检索。查询不会被改写,因此同一请求的结果是确定的,也不涉及任何模型凭据。是否再消耗一轮由你的代码决定。

请求字段与响应字段

调用作用
verify0 到 3。允许的额外轮次数量。超出范围会以 400 拒绝,而不是静默截断到边界值。
verify_used实际执行的额外轮次数量。可能低于请求的数量。

当某一轮没有返回新结果时,轮次提前停止,未使用的轮次不计费。若后续某一轮失败,则返回此前已收集到的结果。

当第一轮已经包含答案时,额外轮次可能降低准确率,LongMemEval-S 上的单会话用户类问题下降 4.2 个百分点。收益与单次检索未命中的频率成正比,因此存储库越大收益越高。