Skip to content

fix(core): scope L1 memory search in stores#29

Open
Dimon94 wants to merge 1 commit into
Tencent:mainfrom
Dimon94:codex/scoped-l1-search
Open

fix(core): scope L1 memory search in stores#29
Dimon94 wants to merge 1 commit into
Tencent:mainfrom
Dimon94:codex/scoped-l1-search

Conversation

@Dimon94
Copy link
Copy Markdown

@Dimon94 Dimon94 commented May 16, 2026

Description | 描述

Make L1 memory search scope filters apply before result truncation:

  • accept sessionKey / sessionId in searchMemories() and Gateway /search/memories
  • pass scope filters through the L1 store interfaces
  • apply SQLite FTS filters in SQL and vector filters before final topK results are returned
  • apply TCVDB filters through the query filter expression
  • keep a caller-side scope check as a final defense
  • add regression coverage for vector and FTS paths where unscoped topK truncation could otherwise hide in-scope memories

This is a general shared-backend correctness fix. It is not tied to any specific downstream host.

Related Issue | 关联 Issue

None.

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能

Additional Notes | 其他说明

Local verification:

  • npm test -- src/core/tools/memory-search.test.ts
  • npm test
  • npm run build:plugin
  • git diff --cached --check before commit

Pass sessionKey and sessionId filters through L1 search APIs so shared backends apply scope before topK truncation. Keep a caller-side guard as a final defense and cover both vector and FTS recall paths with regression tests.

Signed-off-by: Dimon <lovedaih@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant