fix(memory): deduplicate session summaries in Qdrant (#1917)#1933
Merged
fix(memory): deduplicate session summaries in Qdrant (#1917)#1933
Conversation
…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
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.
Summary
uuid::Uuid::new_v4()with a deterministic UUID v5 derived fromconversation_idinstore_session_summary()(crates/zeph-memory/src/semantic/cross_session.rs)store_to_collection()to the existingupsert_to_collection()so repeated compaction calls overwrite the same Qdrant point instead of accumulating duplicatesstore_session_summary_point_id_is_deterministicandstore_session_summary_point_id_boundary_idscovering the deduplication invariant, distinct IDs, edge values (0, -1), and UUID version assertionTest plan
cargo +nightly fmt --check— passcargo 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)upsert_to_collection()overwrites vector + payload: SQLite backend usesON CONFLICT DO UPDATE, Qdrant backend callsupsert_points()withwait=trueCloses #1917