Skip to content

fix(memory): deduplicate session summaries in Qdrant (#1917)#1933

Merged
bug-ops merged 2 commits intomainfrom
1917-session-summary-dedup
Mar 16, 2026
Merged

fix(memory): deduplicate session summaries in Qdrant (#1917)#1933
bug-ops merged 2 commits intomainfrom
1917-session-summary-dedup

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 16, 2026

Summary

  • Replace uuid::Uuid::new_v4() with a deterministic UUID v5 derived from conversation_id in store_session_summary() (crates/zeph-memory/src/semantic/cross_session.rs)
  • Switch store_to_collection() to the existing upsert_to_collection() so repeated compaction calls overwrite the same Qdrant point instead of accumulating duplicates
  • Add two unit tests: store_session_summary_point_id_is_deterministic and store_session_summary_point_id_boundary_ids covering the deduplication invariant, distinct IDs, edge values (0, -1), and UUID version assertion

Test plan

  • cargo +nightly fmt --check — pass
  • cargo clippy --all-targets --all-features --workspace -- -D warnings — pass (0 warnings)
  • cargo nextest run --workspace --all-features --lib --bins — 6055 passed (+2 new tests in zeph-memory)
  • Verify upsert_to_collection() overwrites vector + payload: SQLite backend uses ON CONFLICT DO UPDATE, Qdrant backend calls upsert_points() with wait=true
  • Other collections (KEY_FACTS, CORRECTIONS, ENTITY) are unaffected — still use random UUIDs

Closes #1917

…nt (#1917)

Multiple compaction cycles for the same conversation were inserting new
random-UUID points into zeph_session_summaries on every call to
store_session_summary(), causing data bloat and redundant context injection.

Replace uuid::Uuid::new_v4() with UUID v5 derived from conversation_id, and
switch store_to_collection() to the existing upsert_to_collection() so
repeated compactions overwrite the same Qdrant point.

Closes #1917
@github-actions github-actions bot added documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 16, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 16, 2026 22:02
@bug-ops bug-ops merged commit 4ce0a7b into main Mar 16, 2026
20 checks passed
@bug-ops bug-ops deleted the 1917-session-summary-dedup branch March 16, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(memory): deduplicate session summaries in Qdrant — multiple compactions create duplicate vectors

1 participant