Skip to content

Add ruvector-robotics: unified cognitive robotics platform#220

Merged
ruvnet merged 11 commits into
mainfrom
claude/agentic-robotics-integration-VOZu2
Feb 27, 2026
Merged

Add ruvector-robotics: unified cognitive robotics platform#220
ruvnet merged 11 commits into
mainfrom
claude/agentic-robotics-integration-VOZu2

Conversation

@ruvnet

@ruvnet ruvnet commented Feb 27, 2026

Copy link
Copy Markdown
Owner

Summary

This PR introduces ruvector-robotics, a comprehensive cognitive robotics platform that integrates with ruvector's vector database, graph neural networks, and self-learning infrastructure. The new crate provides a complete robotics stack spanning perception, planning, cognitive architecture, and multi-robot coordination.

Key Changes

Core Bridge Module (crates/ruvector-robotics/src/bridge/)

  • Core types: Point3D, PointCloud, RobotState, Pose, Trajectory, SceneGraph, OccupancyGrid
  • Spatial indexing: Flat-vector SpatialIndex with brute-force kNN/radius search supporting Euclidean, Manhattan, and Cosine distance metrics
  • Gaussian splatting: GaussianSplat representation for point cloud visualization with position, color, opacity, and scale
  • Perception pipeline: Lightweight sensor frame ingestion with obstacle detection and trajectory prediction
  • Type converters: Bidirectional conversions between domain types and flat vector representations

Perception Subsystem (crates/ruvector-robotics/src/perception/)

  • Obstacle detection: Spatial-hash clustering with classification (Static/Dynamic/Unknown)
  • Scene graph construction: Builds structured object relationships from point clouds using union-find clustering
  • Sensor fusion: Multi-sensor point cloud alignment and merging with confidence weighting
  • Clustering utilities: Shared spatial-hash clustering with union-find for obstacle and scene graph modules

Cognitive Architecture (crates/ruvector-robotics/src/cognitive/)

  • Behavior trees: Composable nodes (Sequence, Selector, Action, Condition) with decorators (Invert, Repeat, Timeout)
  • Memory system: Three-tier architecture (working, episodic, semantic) with bounded buffers and similarity search
  • Decision engine: Multi-criteria utility-based action selection using reward, risk, energy, and novelty
  • Skill learning: Learning from demonstration with trajectory generalization and confidence tracking
  • World model: Object tracking, occupancy grid maintenance, and linear state prediction
  • Cognitive core: Central perceive→think→act→learn loop with mode switching (Reactive/Deliberative/Learning)
  • Swarm coordination: Formation computation, capability-based task assignment, and majority consensus

MCP Integration (crates/ruvector-robotics/src/mcp/)

  • Tool registry: Schema-free MCP tool definitions with JSON schema generation
  • Tool executor: Stateful executor wiring perception pipeline, spatial index, and memory to tool requests
  • Categories: Perception, Planning, Manipulation, Navigation, Learning tool categories

Planning Module (crates/ruvector-robotics/src/planning.rs)

  • A grid search*: Discrete pathfinding on occupancy grids with heuristic-guided search
  • Potential field: Continuous-space repulsive/attractive field velocity commands

Domain Expansion (crates/ruvector-robotics/src/domain_expansion.rs)

  • Implements ruvector_domain_expansion::Domain trait for cross-domain transfer learning
  • Task categories: PointCloudClustering, ObstacleAvoidance, SceneGraphConstruction, SkillSequencing, SwarmFormation
  • Synergy mapping between robotics, planning, tool orchestration, and Rust synthesis domains

RVF Packaging (crates/ruvector-robotics/src/rvf.rs)

  • Bridges robotics types with RuVector Format for persistence and querying
  • Supports packing/unpacking point clouds, scene graphs, Gaussian splats, and occupancy grids

Testing & Benchmarking

  • Integration tests (tests/robotics_integration.rs, tests/integration.rs): Full pipeline validation across bridge, perception, cognitive, and MCP modules
  • Comprehensive benchmarks (benches/robotics_benchmarks.rs): 1247-line benchmark suite covering point cloud conversion, spatial search, obstacle detection, trajectory prediction, attention computation, behavior tree execution, scene graph construction, episodic memory recall, full perceive→think→act pipeline, and swarm task assignment

Examples

  • 10 runnable

https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY

Copy 6 agentic-robotics crates (core, rt, mcp, embedded, node, benchmarks)
into ruvector/crates/ for deep integration review. These provide:
- ROS3 pub/sub messaging with Zenoh middleware and CDR serialization
- Dual-runtime real-time executor with priority scheduling
- MCP 2025-11 server for AI tool exposure
- NAPI-RS Node.js bindings
- Criterion benchmark suite

Create comprehensive research documentation in docs/research/agentic-robotics/:
- README.md: SOTA integration analysis (889 lines)
- crate-review.md: Crate-by-crate deep code review (967 lines)
- architecture-synergy.md: Architecture compatibility analysis (555 lines)
- integration-roadmap.md: 18-week phased implementation plan (769 lines)

Key findings: 14/16 shared dependencies are version-compatible, both use
rkyv 0.8 for zero-copy serialization, identical build profiles, and
complementary (not overlapping) functionality. The combination creates a
unique cognitive robotics platform with sub-millisecond sensor-to-decision
latency, native vector search, GNN inference, and MCP tool exposure.

https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
…gnitive, and MCP modules

Consolidates robotics functionality into a single crate with four modules:
- bridge: Core types (Point3D, PointCloud, RobotState, Pose), spatial indexing,
  distance metrics, sensor converters, and perception pipeline
- perception: Scene graph construction, obstacle detection/classification,
  anomaly detection, trajectory prediction, and attention focusing
- cognitive: Behavior trees, perceive-think-act-learn loop, multi-criteria
  decision engine, three-tier memory system, skill learning from demonstration,
  swarm coordination with formations/consensus, and world model tracking
- mcp: Tool registry with 15 registered tools across 6 categories

Includes 26 passing tests (10 unit + 15 integration + 1 doc), 5 crate examples,
10 standalone binary examples, benchmarks covering 10 groups, and user guide.

https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
The DRY refactor that extracted shared clustering code accidentally
removed the HashMap import still needed by merge_scenes.

https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
…ross-domain transfer

Performance optimizations (net -134 lines):
- BinaryHeap kNN: O(n log k) vs O(n log n) full sort in SpatialIndex
- Zero-clone behavior tree tick via pointer-based borrow splitting
- VecDeque percept buffer for O(1) front eviction
- HashSet assigned_robots for O(1) membership checks
- Shared clustering module eliminates 3 duplicate implementations

Correctness fixes:
- UntilFail decorator 10k iteration guard prevents infinite loops
- OccupancyGrid bounds-checked get() returns Option<f32>
- Pipeline position_history capped at 1000 entries
- Skill learning gracefully handles empty demonstrations
- Anomaly type gets Serialize/Deserialize derives

Dead code removal:
- Remove unused TrajectoryPoint struct
- Remove unused tracing and rand dependencies

Domain expansion integration (behind `domain-expansion` feature flag):
- RoboticsDomain implements domain::Domain trait with 5 task categories:
  PointCloudClustering, ObstacleAvoidance, SceneGraphConstruction,
  SkillSequencing, SwarmFormation
- 64-dim embedding space compatible with planning/orchestration/synthesis
- Reference solutions, difficulty scaling, cross-domain transfer tests
- Enables Meta Thompson Sampling transfer between robotics and
  existing domains (Rust synthesis, structured planning, tool orchestration)

All 257 tests pass (231 unit + 25 integration + 1 doc-test).

https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
- Remove unsafe pointer aliasing in BehaviorTree::tick(), use safe
  disjoint field borrowing instead (P0)
- Fix usize underflow in score_scene_graph when expected_objects < 2 (P0)
- Fix cluster ID overflow in reference_solution for PointCloudClustering (P0)
- Fix NaN handling in MaxDistEntry::cmp — NaN treated as maximally
  distant so it gets evicted from kNN heap first (P1)
- Clamp cosine_distance output to prevent negative values from
  floating-point rounding (P1)
- Change search_radius to return Ok(Vec::new()) for empty index instead
  of Err(EmptyIndex) for correct semantics (P1)
- Add debug_assert guards for empty slices in bounding_sphere and
  cluster_to_object (P1)
- Remove dead PipelineConfig.spatial_search_k field (P2)
- Use serde_json::from_value instead of to_string+from_str roundtrip
  in domain_expansion for better performance (P2)

All 257 tests pass.

https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
…usion, and benchmarks

New modules for ruvector-robotics:
- bridge/gaussian: GaussianSplat types, PointCloud→Gaussian conversion, vwm-viewer JSON export
- planning: A* pathfinding on OccupancyGrid with octile heuristic, potential field velocity commands
- mcp/executor: ToolExecutor dispatching ToolRequests to perception pipeline and spatial index
- perception/sensor_fusion: multi-sensor cloud fusion with timestamp alignment and voxel downsampling

Rewrites integration tests to use actual crate APIs instead of local reimplementations,
eliminating ~280 lines of false-positive test code. Adds 15 benchmark groups covering
all new modules (Gaussian conversion, A* planning, potential fields, sensor fusion, MCP execution).

All 270+ tests pass including domain-expansion feature.

https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
New `rvf` feature flag enables the `ruvf::RoboticsRvf` wrapper that
bridges point clouds, scene graphs, trajectories, Gaussian splats, and
obstacles into the RuVector Format (.rvf) for persistence and similarity
search.

RoboticsRvf supports:
- pack_point_cloud (dim 3)
- pack_scene_objects / pack_scene_graph (dim 9)
- pack_trajectory (dim 3)
- pack_gaussians (dim 7) — converts PointCloud→GaussianSplatCloud→RVF
- pack_obstacles (dim 6)
- query_nearest (kNN via HNSW index)
- open/open_readonly/close lifecycle

9 unit tests covering create, ingest, query, reopen, dimension mismatch,
and empty data rejection. Also fixes unused import warnings in integration
tests. All 290 tests pass across default, domain-expansion, and rvf features.

https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
…erception

SpatialIndex: replace Vec<Vec<f32>> with flat Vec<f32> buffer for cache
locality and zero per-point heap allocation; use squared Euclidean
distance in kNN/radius search (defer sqrt to final k results); fuse
cosine distance into single loop.

Clustering: add union-by-rank to union-find preventing tree
degeneration (O(α(n)) amortized); add #[inline] on hot helpers.

A* planning: add closed set (HashSet) to avoid re-expanding nodes;
reuse neighbor buffer to eliminate per-expansion Vec allocation;
pre-allocate HashMap capacity; add #[inline] on helpers.

Perception: defer sqrt in bounding_sphere (compare squared distances,
one sqrt at end); defer sqrt in scene graph edge construction (filter
on squared threshold); add #[inline] on dist_3d.

Sensor fusion: pre-allocate merged vectors from total eligible cloud
size. Anomaly detection: fuse distance + statistics into single pass
using Welford's online algorithm (eliminates one full data pass).

All 281 tests pass.

https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
Clippy fixes (8 warnings → 0):
- Replace 5 manual Default impls with #[derive(Default)]
- Use .clamp() instead of .min().max() chain
- Use .is_some_and() instead of .map_or(false, ...)
- Add type alias for complex return type in scene_graph_to_adjacency

P0 correctness fixes from code review:
- Fix NaN panic: use unwrap_or(Ordering::Equal) in cognitive_core think()
- Fix integer overflow: use checked_mul in OccupancyGrid::new
- Fix potential unwrap: use map_or in domain_expansion score_avoidance

Co-Authored-By: claude-flow <ruv@ruv.net>
Add repository, homepage, keywords, categories for crates.io listing.
Pin optional dependency versions (ruvector-domain-expansion 2.0.4,
rvf-runtime 0.2, rvf-types 0.2) required for cargo publish.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet merged commit 85df6b9 into main Feb 27, 2026
6 checks passed
@ruvnet ruvnet deleted the claude/agentic-robotics-integration-VOZu2 branch April 21, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants