research(nightly): streaming-semantic-drift — online distribution shift detection for agent vector memory#503
Draft
ruvnet wants to merge 4 commits into
Draft
Conversation
Adds ADR-194 design rationale and workspace membership for the streaming semantic drift detection crate (ruvector-drift). https://claude.ai/code/session_017kmy7aU2vDkc21CB8g2xB5
Introduces crates/ruvector-drift with three drift detector variants: - MeanShiftDetector: EMA distance, O(D) space, 124 ns/insert - CusumDetector: CUSUM on z-scored norms, 48 B space, 129 ns/insert - MmdRffDetector: RFF-MMD, O(D×R) space, 42 µs/insert All implement DriftDetector trait; benchmark binary in src/main.rs. https://claude.ai/code/session_017kmy7aU2vDkc21CB8g2xB5
Architecture decision record covering: design rationale, three variants, failure modes, security considerations, migration path, and benchmark evidence (48 B CUSUM, 124 ns MeanShift, 42 µs MMD-RFF, all PASS). https://claude.ai/code/session_017kmy7aU2vDkc21CB8g2xB5
Research README: SOTA survey, 10-20 year thesis, design, benchmark results (D=128 detection lag 1-2 vecs), 8 practical + 8 exotic apps, deep research notes, production layout proposal. Gist: SEO-optimized public technical article. https://claude.ai/code/session_017kmy7aU2vDkc21CB8g2xB5
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-23
Topic: Streaming Semantic Drift Detection for Agent Vector Memory
Slug:
streaming-semantic-driftADR: ADR-194
Crate:
crates/ruvector-driftSummary
Adds
ruvector-drift, a streaming semantic drift detector that fires within 1–2 vector insertions of a genuine distribution shift. Three trait-compatible variants:All three implement
DriftDetector, areBox<dyn DriftDetector>-compatible, and use zero unsafe code.What's included
crates/ruvector-drift/) — 5 source files, ~500 LOCdocs/adr/ADR-194-streaming-semantic-drift.md)docs/research/nightly/2026-05-23-streaming-semantic-drift/README.md)docs/research/nightly/2026-05-23-streaming-semantic-drift/gist.md)Real benchmark results (cargo run --release -p ruvector-drift, rustc 1.94.1, x86-64)
Dataset: D=128, 1000 reference vectors N(0,1), 1000 drift vectors N(2.0, 1), seed=42.
Why this matters
No production vector database detects semantic drift online. All rely on lagging offline metrics. RuVector as a cognition substrate for agents needs to know when its memory is going stale — before HNSW graph recall silently decays.
The 48-byte CUSUM is a strong candidate for always-on production deployment with no meaningful overhead.
Research doc
docs/research/nightly/2026-05-23-streaming-semantic-drift/README.mdADR
docs/adr/ADR-194-streaming-semantic-drift.mdThis branch should either become a production RuVector capability or a falsified research path with useful evidence.
Generated by Claude Code