Skip to content

fix(memory): fix inflated edges_created, batch embed/search, add missing tests#1795

Merged
bug-ops merged 1 commit intomainfrom
amem-link-memory-notes
Mar 14, 2026
Merged

fix(memory): fix inflated edges_created, batch embed/search, add missing tests#1795
bug-ops merged 1 commit intomainfrom
amem-link-memory-notes

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

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

Summary

Test plan

  • All 6 link_memory_notes unit tests pass (including 3 new ones)
  • Full workspace test suite: 5630 passed, 0 failed
  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes

- Deduplicate (src, tgt) pairs within each link_memory_notes pass via a
  HashSet so both A→B and B→A directions count as one edge, not two.
  Previously insert_edge returned Ok for the second normalised call
  (confidence update), inflating edges_created by the number of
  bidirectional matches (#1792).

- Parallelize embed calls: all entity texts are embedded via
  futures::join_all, reducing N serial HTTP round-trips to one
  concurrent batch (#1793).

- Parallelize search calls: all Qdrant search_collection calls are run
  via futures::join_all, reducing N serial round-trips to one
  concurrent batch (#1794).

- Add link_memory_notes_edges_created_not_inflated: asserts edges_created
  == 1 when both endpoints of a pair are in entity_ids (#1792).

- Add link_memory_notes_secondary_self_skip_guard: entity A has no
  qdrant_point_id in SQLite (primary guard inactive), secondary guard
  target_id == entity_id must prevent self-edges (#1790).

- Add link_memory_notes_threshold_rejection: similarity_threshold = 2.0
  rejects all candidates (max cosine = 1.0), verifying the score <
  threshold filter path (#1791).

Closes #1790, #1791, #1792, #1793, #1794.
@bug-ops bug-ops force-pushed the amem-link-memory-notes branch from 4c5acbc to 24da3bf Compare March 14, 2026 21:59
@bug-ops bug-ops enabled auto-merge (squash) March 14, 2026 21:59
@github-actions github-actions bot added the bug Something isn't working label Mar 14, 2026
@bug-ops bug-ops merged commit 3e5f884 into main Mar 14, 2026
15 checks passed
@bug-ops bug-ops deleted the amem-link-memory-notes branch March 14, 2026 22:08
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/L Large PR (201-500 lines)

Projects

None yet

1 participant