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
{{ message }}
Repository navigation
fix: Search_memories在默认dedup=mmr下调试用 info 日志打印完整 embedding 向量 #2103
Summary: Fixes issue #2103: SingleCubeView.search_memories no longer leaks full embedding vectors into INFO logs.
Root cause: logger.info(f"Search memories result: {memories_result}") in src/memos/multi_mem_cube/single_cube.py interpolated the entire result dict; under the default APISearchRequest.dedup="mmr" (also dedup="sim"), format_memory_item(..., include_embedding=True) keeps metadata.embedding populated, so every search dumped MBs of floats into logs and buried the useful memory_id / text / relativity fields — plus a potential privacy / compliance concern.
Fix: added a small pure helper _redact_embeddings_for_log() at module level that returns a shallow copy of memories_result with each text_mem / pref_mem / tool_mem / skill_mem memory's metadata.embedding list replaced by a <embedding len=N> placeholder. The caller's live dict is not mutated — downstream consumers (dedup, API response) still see the real vector. Only the log line changes; no API / schema / behavior change.
Tests: new tests/multi_mem_cube/test_search_log_redaction.py — 6 pure-helper unit tests (covering multi-partition, empty vector, missing metadata, non-mutation, partial dict) + 3 integration tests through the actual SingleCubeView.search_memories flow (default dedup=mmr, embedding never appears in the INFO log, useful fields preserved, count log preserved). 9/9 passing. Ruff check + format clean. Independent code-reviewer sub-agent returned APPROVE.
Note: 4 pre-existing failures in tests/api/test_mcp_serve.py are unrelated baseline failures on this branch (confirmed via git stash comparison against the pristine tree) — not caused by this change.
Activity
fix(multi_mem_cube): sanitize search_memories INFO log to drop embedd…
fix(multi_mem_cube): address OCR review — accurate bucket count + str…
fix(multi_mem_cube): address OCR review round 2 — surface non-str pre…
24 remaining items
Memtensor-AI commentedon Jul 15, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
9c482c4b3ae26fe4Working branch:
feature/autodev-2103-20260715081424787Target 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.
fix(multi_mem_cube): redact embedding vectors in search_memories INFO…
Memtensor-AI commentedon Jul 15, 2026
✅ AutoDev task
9c482c4b3ae26fe4completed.Summary: Fixes issue #2103:
SingleCubeView.search_memoriesno longer leaks full embedding vectors into INFO logs.Root cause:
logger.info(f"Search memories result: {memories_result}")insrc/memos/multi_mem_cube/single_cube.pyinterpolated the entire result dict; under the defaultAPISearchRequest.dedup="mmr"(alsodedup="sim"),format_memory_item(..., include_embedding=True)keepsmetadata.embeddingpopulated, so every search dumped MBs of floats into logs and buried the useful memory_id / text / relativity fields — plus a potential privacy / compliance concern.Fix: added a small pure helper
_redact_embeddings_for_log()at module level that returns a shallow copy ofmemories_resultwith eachtext_mem / pref_mem / tool_mem / skill_memmemory'smetadata.embeddinglist replaced by a<embedding len=N>placeholder. The caller's live dict is not mutated — downstream consumers (dedup, API response) still see the real vector. Only the log line changes; no API / schema / behavior change.Tests: new
tests/multi_mem_cube/test_search_log_redaction.py— 6 pure-helper unit tests (covering multi-partition, empty vector, missing metadata, non-mutation, partial dict) + 3 integration tests through the actualSingleCubeView.search_memoriesflow (defaultdedup=mmr, embedding never appears in the INFO log, useful fields preserved, count log preserved). 9/9 passing. Ruff check + format clean. Independent code-reviewer sub-agent returned APPROVE.Note: 4 pre-existing failures in
tests/api/test_mcp_serve.pyare unrelated baseline failures on this branch (confirmed viagit stashcomparison against the pristine tree) — not caused by this change.Base branch:
mainBranch:
feature/autodev-2103-20260715081424787Commit:
3ecf326PR: #2110
Assigned to: @NydiaChung
Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller
github-actions commentedon Aug 15, 2026
This issue has been automatically marked as stale due to inactivity.
github-actions commentedon Aug 22, 2026
This issue has been automatically closed due to inactivity.