Repository navigation
Conversation
Vector-mode hits were stored as fuzzy, and a closer title outside the window could not replace a weaker card already inside it. Search now forwards status and keeps enough candidates for that exchange. Co-authored-by: Cursor <cursoragent@cursor.com> Assisted-by: Cursor / Grok 4.7
The neighbor pass was skipping candidates by observation number alone. Use the same project-scoped key as the rest of search so one project's row cannot occupy another's slot. Co-authored-by: Cursor <cursoragent@cursor.com>
The extra lexical pass ran for every project search, so probes, personal memories, and the session-replay baseline changed. Only Lance vector order adds neighbors, and those rows pass the same visibility filters as the main result. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
审核时先看的边界
这支基于
v1.10.5(96ed8b77,#411)。Lance 合并键仍是project_id + observation_id。补写、缓存和按项目删除都沿用 1.10.5。这支不恢复deleteMismatchedProjectRows。近邻去重用
makeEntryKey(projectId, observationId),不用纯 observation 编号占位。小库融合门槛只属于 #412。这支不改searchPersistentSemantically的调用条件。2026-11-27 第一版把词法补词加到了每一次带项目的检索上,CI 三端各失败 15 条。修复提交是
09af2468。补词现在只发生在 Lance 向量序已经接管结果的时候,补进行还要过项目、可见性、状态和 probe 过滤。修复后的运行46027621476七项检查都通过。前因
向量序已经把一条记忆排进窗口,标题却对不上问话词时,原因列表里没有向量标记,最后被写成
fuzzy。调用方无法区分「向量排上来的」和「只是模糊词法蹭上的」。另一条是窗口。项目过滤或会话去重会超取再截断。截断前留下的候选不够时,窗口外标题更贴题的卡进不来。
memorix memory search和顶层search收下了--status,没有传给检索,archived 记录在默认的 active 过滤下不可见。这次改了什么
src/search/match-reasons.tslabelMatchReasons:模式是vector、vector-only…或vector …时,没有字段贴上问话,原因写vector,不再只写fuzzy。已经有 title、entity 等字段命中时,再追加一个vector。hybrid 且没有字段命中,仍然是fuzzy。promoteOverlappingNeighbors:第 1 名不动。从第 2 名起到窗口末尾,词重叠更少的位置换成窗口外重叠严格更多的卡。重叠数相同就保持原顺序。只看标题和实体名。queryOverlapTokens:按 Unicode 字母数字切词,中文再切成两字。三对近邻词写在这个文件里:密钥对应凭据/credential/secret,泄露对应leak,复盘对应收尾。覆盖的是问话和卡片用了不同写法的情况。src/store/orama-store.tslimit * 3。lanceOrderUsed为真,也就是这次结果来自 Lance 向量序时,才再取一轮词法命中,把窗口里还没有的卡补到候选尾部,然后做近邻交换。projectIds里;canReadObservation通过;状态符合本次过滤;caller 没有显式要 probe 时不收 probe;source与 caller 一致。同一条候选用makeEntryKey(projectId, observationId)识别。src/cli/commands/memory.ts和src/cli/index.ts:memory search和顶层search把--status(active、resolved、archived)传进检索。以前参数被收下后丢掉。余弦权重不动。窗口宽度仍是调用方的
limit。第一版为什么被 CI 打回来
第一版的条件是「有查询、有原文、有 projectIds」就补一轮词法。主结果上的可见性、probe 和状态过滤发生在这轮之前,补进来的行没有再走一遍。失败都在本仓库的测试里:
tests/memory/probe-observation.test.ts:默认搜索收进了 probe。期望 0,实际 1。tests/cli/identity-command.test.ts:身份清除后,个人记忆仍出现在项目搜索里。期望 0 条,实际 1 条。tests/integration/visibility-boundary.test.ts:第三方搜索能看到只应给发送方和接收方的交接。tests/evaluation/session-replay-evaluation.test.ts:重复率从测试里写死的基线 0.25 变成 0.125。命中率仍是 4/4,但去重考试不再低于基线。tests/search/persistent-semantic-recovery.test.ts:多了一次searchLexical。期望 2 次,实际 3 次。tests/sdk/memory-client.test.ts:9 条失败是前面的检索把不该看见的记录带进来之后,同一进程里的客户端收尾被带倒。修复把补词收进向量序,并补上同一套过滤。提交前重跑这 7 个文件,64 条通过。GitHub 运行
46027621476:Ubuntu、macOS、Windows 测试,加上 typecheck、docker、native-sqlite、mcp-registry,七项都成功。明确不碰
和相邻拉取请求
vector标记,并允许窗口外更贴题的卡在向量序结果里换进来。searchPersistentSemantically的条件。两支都改orama-store.ts的不同函数。验收
这些断言都在本仓库的测试里,审核时可以直接打开:
tests/search/match-reasons.test.ts覆盖标记和近邻交换这两个纯函数。vector。memorix memory search --status archived能把 archived 传进检索。tests/memory/probe-observation.test.ts:默认搜索仍排除 probe。tests/cli/identity-command.test.ts:身份清除后,个人记忆不出现在项目搜索里。tests/integration/visibility-boundary.test.ts:定向交接不出现在第三方搜索里。tests/evaluation/session-replay-evaluation.test.ts:重复率基线保持 0.25,去重考试仍低于基线。这是补词不再介入纯词法检索的结果。tests/search/semantic-index.test.ts:同编号两项目的向量行都还在。