Repository navigation
feat(#401): cosine-based auto-linking + dedup detection on remember() - #421
Merged
Merged
Conversation
Add auto_link_cosine() to edges.rs — runs after every remember(): - Searches vector index for top-20 similar memories - Creates similar_to edge when cosine >= 0.80 - Creates possible_duplicate edge when cosine >= 0.92 - Best-effort: errors logged, never fails remember() New edge types: EDGE_SIMILAR_TO, EDGE_POSSIBLE_DUPLICATE Thresholds are constants (will be configurable in future). Tests marked #[ignore] (require ONNX embedder like other integration tests).
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (1)
Review powered by cora-cli · BYOK · MIT |
| pub fn memories_in_namespace(&self, namespace: &str) -> Result<Vec<String>, Error> { | ||
| let mut stmt = self | ||
| .conn | ||
| .prepare("SELECT id FROM memories WHERE namespace = ?1") |
ajianaz
added a commit
that referenced
this pull request
Aug 13, 2026
…#421) Add auto_link_cosine() to edges.rs — runs after every remember(): - Searches vector index for top-20 similar memories - Creates similar_to edge when cosine >= 0.80 - Creates possible_duplicate edge when cosine >= 0.92 - Best-effort: errors logged, never fails remember() New edge types: EDGE_SIMILAR_TO, EDGE_POSSIBLE_DUPLICATE Thresholds are constants (will be configurable in future). Tests marked #[ignore] (require ONNX embedder like other integration tests).
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.
Implements #401.
Summary
Add cosine-similarity auto-linking to the remember() pipeline.
How it works
After every remember(), search the vector index for top-20 similar memories:
similar_toedgepossible_duplicateedgeKey decisions
New edge types
EDGE_SIMILAR_TO= "similar_to"EDGE_POSSIBLE_DUPLICATE= "possible_duplicate"Tests
2 integration tests (marked #[ignore] — require ONNX embedder like other Uteke::open tests).
Milestone: v0.3.0 — Graph RAG