You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: Adds an optional excludeSessionKey parameter to the memory_search recall pipeline in apps/memos-local-openclaw so callers (e.g. OpenClaw) can suppress recall of chunks belonging to the current conversation session. This avoids redundant tokens and echoed content in LLM context, and surfaces only historical memories.
Surface changes: RecallOptions.excludeSessionKey on src/recall/engine.ts; new optional argument plumbed through SqliteStore.ftsSearch, SqliteStore.patternSearch, SqliteStore.getAllEmbeddings, SqliteStore.getRecentEmbeddings, and the vectorSearch helper in src/storage/vector.ts; new excludeSessionKey input on the memory_search tool schema and handler in src/tools/memory-search.ts. The filter is implemented at the SQL layer as AND c.session_key != ?, applied only when the caller supplies the field — existing call sites are byte-for-byte equivalent. Hub-memory hits are intentionally not filtered because they carry a synthetic sessionKey (hub-shared:<userId>) and represent cross-user shared knowledge.
Tests: 11 new vitest cases across tests/storage.test.ts, tests/memory-search-tool.test.ts, and tests/recall-engine-exclude-session.test.ts. All 37 tests across the touched suites pass; tsc --noEmit is clean. The full vitest run shows 233 passing and 5 pre-existing failures (accuracy.test.ts × 2 — local ONNX embedding model not available in the sandbox; skill-auto-install / task-processor / update-install — unrelated to recall/storage, verified by re-running them against the stashed baseline before this change).
Confidence at Phase 1 was 0.85 so no clarification was requested; assumptions and Phase progress are logged in the opsp task file. The opsp artifacts (.ai-tasks/2026-06-29-1362-…md, openspec/changes/2026-06-29-1362-…/tasks.md + test-cases.md) stay out of the MemOS PR (via .git/info/exclude) and have been archived to the sibling memos-autodev-specs repo on main.
Activity
Memtensor-AI commentedon Jun 30, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
673e879094851408Working branch:
feature/autodev-1362Target branch:
latest dev* branchWorkflow: opsp (analysis → coding → testing → PR)
I will post the PR link here once done. If I need more information, I will ask in the comments.
feat(memos-local-openclaw): add excludeSessionKey to memory_search re…
Memtensor-AI commentedon Jun 30, 2026
✅ AutoDev task
673e879094851408completed.Summary: Adds an optional
excludeSessionKeyparameter to thememory_searchrecall pipeline inapps/memos-local-openclawso callers (e.g. OpenClaw) can suppress recall of chunks belonging to the current conversation session. This avoids redundant tokens and echoed content in LLM context, and surfaces only historical memories.Surface changes:
RecallOptions.excludeSessionKeyonsrc/recall/engine.ts; new optional argument plumbed throughSqliteStore.ftsSearch,SqliteStore.patternSearch,SqliteStore.getAllEmbeddings,SqliteStore.getRecentEmbeddings, and thevectorSearchhelper insrc/storage/vector.ts; newexcludeSessionKeyinput on thememory_searchtool schema and handler insrc/tools/memory-search.ts. The filter is implemented at the SQL layer asAND c.session_key != ?, applied only when the caller supplies the field — existing call sites are byte-for-byte equivalent. Hub-memory hits are intentionally not filtered because they carry a syntheticsessionKey(hub-shared:<userId>) and represent cross-user shared knowledge.Tests: 11 new vitest cases across
tests/storage.test.ts,tests/memory-search-tool.test.ts, andtests/recall-engine-exclude-session.test.ts. All 37 tests across the touched suites pass;tsc --noEmitis clean. The fullvitest runshows 233 passing and 5 pre-existing failures (accuracy.test.ts × 2 — local ONNX embedding model not available in the sandbox; skill-auto-install / task-processor / update-install — unrelated to recall/storage, verified by re-running them against the stashed baseline before this change).Confidence at Phase 1 was 0.85 so no clarification was requested; assumptions and Phase progress are logged in the opsp task file. The opsp artifacts (
.ai-tasks/2026-06-29-1362-…md,openspec/changes/2026-06-29-1362-…/tasks.md+test-cases.md) stay out of the MemOS PR (via.git/info/exclude) and have been archived to the siblingmemos-autodev-specsrepo onmain.Base branch:
mainBranch:
feature/autodev-1362Commit:
9f405aaPR: #1978
Assigned to: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller
Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller
Fix #1362: 添加 excludeSessionKey 选项,避免召回当前会话内容 (#1978)