ruvnet / ruvnet/RuVector

Spatial memory: benchmark and implement receipt preserving trajectory compression

Open
#971 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.5k
Forks
603
Avg merge
23h 32m
Merged PRs (30d)
59

Description

Problem

Long lived spatial systems currently retain rich observations and vector memories, but dynamic object trajectories can grow with observation duration. This creates avoidable storage, retrieval, and context costs, while aggressive forgetting can destroy the exact state transitions an agent later needs to answer spatial questions.

Fresh research: Linguistic Trajectory Encoding, arXiv:2609.04802, submitted 2026-09-04, reports a hybrid per object representation using linguistic motion phases plus sparse spatial and visual anchors. On its Spatial Memory Benchmark it reports 45.3% semantic trajectory retrieval and 48.7% long horizon object retrieval versus 31.9% and 34.4% for the strongest reported baseline, with 8.7x to 26.1x trajectory compression and sub second queries over 24 hour video.

Source: https://arxiv.org/abs/2609.04802

This should not be copied literally into RuVector. Authoritative geometry, provenance, and witnessed source state must remain symbolic and verifiable. Language or latent summaries should be residual indexes over exact evidence, never replacements for it.

Proposed architecture

Target: crates/ruvector-agent-memory plus a small spatial trajectory module or namespace if existing boundaries require it.

Add a receipt preserving SpatialTrajectory representation with:

  • object or track identifier
  • ordered exact anchor points with timestamp and covariance
  • source receipt or state root references per retained interval
  • optional semantic phase description and embedding
  • compression error bound in metres and time
  • observation gap semantics that distinguish last seen from interpolated motion
  • deterministic simplification policy, initially Douglas Peucker or equivalent geometric simplification
  • exact rollback path to the source evidence references

Keep exact source events and geometry outside the compact representation according to retention policy. Never allow semantic summaries to raise confidence or overwrite authoritative coordinates.

Baselines

  1. Dense per sample trajectory storage
  2. Existing RuVector temporal or agent memory compaction
  3. Deterministic geometric trajectory simplification only
  4. Hybrid semantic plus spatial trajectory compression

Benchmark plan

Use fixed seeds and identical source trajectories. Prefer RuView real captured tracks when available; add an external SMB compatible evaluation only if licensing and dataset access permit.

Measure:

  • bytes per trajectory and compression ratio
  • semantic trajectory retrieval success
  • last occurrence retrieval success
  • spatial query error in metres
  • temporal retrieval error
  • p50 and p95 query latency
  • index build latency
  • peak memory
  • receipt verification coverage
  • deterministic reproduction across repeated runs

Promotion gate:

  • at least 8x storage reduction on long horizon tracks
  • no more than 5 percentage points absolute loss versus dense authoritative retrieval on geometric and temporal queries
  • p95 query latency below 100 ms on a 24 hour equivalent workload
  • 100% retained interval coverage by source receipt or state root references
  • zero confidence amplification from summaries
  • deterministic byte identical compact output for identical inputs and configuration

Security and privacy

Threats to test:

  • prompt injection in generated trajectory descriptions
  • malicious or oversized semantic text
  • forged source receipt references
  • object identity leakage
  • location privacy leakage
  • adversarial trajectories designed to trigger pathological anchor counts
  • resource exhaustion from oscillatory motion

Semantic text must be treated as untrusted data. Cap lengths and counts. Do not execute or interpolate instructions from memory content. Validate all source receipt bindings before returning an authoritative answer.

Compatibility and migration

Additive feature behind a feature flag first. Existing dense trajectory and agent memory APIs remain the fallback. No RVF wire change until an explicit profile and golden fixtures exist.

MetaHarness plan

Use the latest stable ruvnet/metaharness with repository specific objective functions for storage ratio, retrieval quality, latency, and provenance coverage. Darwin mutations are permitted only for simplification thresholds or bounded policy parameters and must fail closed on any provenance, determinism, or retrieval regression.

Definition of done

  • ADR with context, alternatives, privacy, security, benchmark and rollback
  • production Rust implementation behind a feature flag
  • unit, property and adversarial tests
  • deterministic benchmark with at least three repeated runs
  • ARM64 and x86 validation
  • WASM evaluation if the representation is exposed to browser spatial queries
  • before and after benchmark report
  • focused PR with reproduction instructions

Production classification

Production candidate only after the benchmark gate passes. Until then: Experimental.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in crates/ruvector-agent-memory by reading the existing temporal or agent memory compaction APIs and identifying the appropriate spatial trajectory boundary. Review the proposed baselines, receipt requirements, and promotion gate before drafting the ADR. Done requires a feature-flagged implementation, unit/property/adversarial tests, deterministic repeated benchmarks, platform validation, and the specified benchmark report.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
ai, backend, data, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.