research(nightly): semantic-drift-detector — distribution shift detection + spectral memory eviction#515
Draft
ruvnet wants to merge 1 commit into
Draft
Conversation
Introduces three drift detectors (CentroidDrift, MmdDrift, FrechetDrift) and three eviction policies (RandomEviction, LruEviction, SpectralEviction) for agent memory lifecycle management. Key results (Intel Xeon 2.80 GHz, rustc 1.94.1, --release, N=4000, D=64): - FrechetDrift: 23-query detection latency, 0 false positives, 191ms - CentroidDrift: 150-query latency, 0 false positives, 84.8ms - SpectralEviction: conductance=0.100, recall preserved, 178ms at N=1000 - All 20 unit + integration tests pass https://claude.ai/code/session_01LMKLpK5poKy2cfHkgkcnje
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.
Nightly RuVector Research — 2026-05-29: Semantic Drift Detection + Spectral Memory Eviction
Introduces
crates/ruvector-drift— a zero-dependency Rust crate for detectingquery-distribution drift in agent memory indexes and selecting eviction targets using
spectral graph partitioning.
What this adds
Three drift detectors (common
DriftDetectortrait):CentroidDrift— L2 centroid shift, O(D) per step, 150-query detection latencyMmdDrift— Maximum Mean Discrepancy with RBF kernel, detects any distributional shift, 27-query latency (use async)FrechetDrift— diagonal Fréchet distance (mean + variance), O(W·D), 23-query latency, recommended defaultThree eviction policies (common
EvictionPolicytrait):RandomEviction— benchmark baselineLruEviction— production standardSpectralEviction— Fiedler vector of k-NN similarity graph, minimum-conductance sweep cutKey benchmark results
Hardware: Intel Xeon @ 2.80 GHz · rustc 1.94.1 ·
--release· N=4000 · D=64 · W=500 · Δ=4.0All 20 tests pass. Overall acceptance: PASS ✓
Includes
crates/ruvector-drift) — 6 source files, all under 500 linesdocs/adr/ADR-194-semantic-drift-detector.mddocs/research/nightly/2026-05-29-semantic-drift-detector/README.mddocs/research/nightly/2026-05-29-semantic-drift-detector/gist.mdEcosystem connections
ruvector-coreruvector-drift(this)ruvector-coherenceruvector-mincutruvector-verifiedon_drift_score > threshold → compact_agent_memoryvector_memory_drift_score,compact_agent_memorytool endpointsResearch loop: 3 passes completed
Research doc:
docs/research/nightly/2026-05-29-semantic-drift-detector/README.mdADR:
docs/adr/ADR-194-semantic-drift-detector.mdhttps://claude.ai/code/session_01LMKLpK5poKy2cfHkgkcnje
Generated by Claude Code