ruvector/crates/ruvector-graph-transformer-node
github-actions[bot] 8ed725cdb8
Some checks failed
Benchmarks / Rust Benchmarks (push) Waiting to run
Benchmarks / SQL Benchmarks (push) Waiting to run
Workspace CI / Tests (vector-index) (push) Waiting to run
Workspace CI / Security audit (push) Waiting to run
Clippy + fmt / Clippy (deny warnings) (push) Waiting to run
Clippy + fmt / Rustfmt (push) Waiting to run
hailo-backend audit / cross-build aarch64 (all bridges) (push) Waiting to run
hailo-backend audit / cargo-audit (cluster) (push) Waiting to run
hailo-backend audit / cargo-deny (license + bans + sources) (push) Waiting to run
hailo-backend audit / clippy --all-targets -D warnings (cluster) (push) Waiting to run
hailo-backend audit / test (cluster — lib + integration + cli + doctest) (push) Waiting to run
hailo-backend audit / missing-docs check (push) Waiting to run
Hooks CI / Rust CLI Tests (push) Waiting to run
Hooks CI / npm CLI Tests (push) Waiting to run
regression-guard / shell-injection-in-mcp-server (push) Waiting to run
Benchmarks / Compare with Baseline (push) Blocked by required conditions
Build Native Modules / Build darwin-arm64 (push) Waiting to run
Build Native Modules / Build linux-arm64-gnu (push) Waiting to run
Build Native Modules / Build darwin-x64 (push) Waiting to run
Build Native Modules / Build win32-x64-msvc (push) Waiting to run
Build Native Modules / Build linux-x64-gnu (push) Waiting to run
Build Native Modules / Commit Built Binaries (push) Blocked by required conditions
ruvector-verified CI / check (--features all-proofs) (push) Waiting to run
ruvector-verified CI / check (--features coherence-proofs) (push) Waiting to run
ruvector-verified CI / check (--features hnsw-proofs) (push) Waiting to run
ruvector-verified CI / check (--features rvf-proofs) (push) Waiting to run
ruvector-verified CI / check (--features serde) (push) Waiting to run
ruvector-verified CI / check (--features ultra) (push) Waiting to run
ruvector-verified CI / test (push) Blocked by required conditions
ruvector-verified CI / bench (push) Blocked by required conditions
ruvector-verified CI / clippy (push) Waiting to run
ruvector-verified CI / check () (push) Waiting to run
ruvector-verified CI / check (--all-features) (push) Waiting to run
Workspace CI / Rustfmt (push) Waiting to run
Workspace CI / Cargo check (push) Waiting to run
Workspace CI / Clippy (push) Waiting to run
Workspace CI / Tests (core-and-rest) (push) Waiting to run
Workspace CI / Tests (ruvix) (push) Waiting to run
Workspace CI / Tests (rvagent) (push) Waiting to run
Workspace CI / Tests (core-and-rest-heavy) (push) Waiting to run
Workspace CI / Tests (core-and-rest-wasm) (push) Waiting to run
Workspace CI / Tests (ml-research-heavy) (push) Waiting to run
Workspace CI / Tests (ml-research-rest) (push) Waiting to run
Workspace CI / Tests (research-nightly) (push) Waiting to run
Hooks CI / PostgreSQL Schema Validation (push) Waiting to run
Hooks CI / Feature Parity Check (push) Blocked by required conditions
regression-guard / hnsw-insert-beam-no-m2-clamp (push) Waiting to run
regression-guard / reentrant-rwlock-double-write (push) Waiting to run
regression-guard / case-insensitive-collisions (push) Waiting to run
regression-guard / ruvector-core-no-avx512-builds-on-stable (push) Waiting to run
regression-guard / hnsw-recall-at-1 (push) Waiting to run
regression-guard / hnsw-distance-based-neighbor-pruning (push) Waiting to run
regression-guard / vector-db-rebuilds-index-on-open (push) Waiting to run
regression-guard / npm-publish-pipeline (npm/packages/pi-brain) (push) Waiting to run
regression-guard / npm-publish-pipeline (npm/packages/ruvector) (push) Waiting to run
regression-guard / brain-hydration-counters-present (push) Waiting to run
regression-guard / npm-publish-pipeline (npm/packages/rvf-wasm) (push) Waiting to run
regression-guard / no-npx-execSync-in-route-enhanced (push) Waiting to run
regression-guard / no-systemtime-in-wasm-crates (push) Waiting to run
regression-guard / no-hardcoded-workspaces-paths (push) Waiting to run
regression-guard / optional-deps-resolvable-on-npm (push) Waiting to run
regression-guard / graph-condense-perception-tests (push) Waiting to run
regression-guard / mincut-pin-tracks-workspace-version (push) Waiting to run
SONA Drift Protection / Drift gate (parity + fingerprint) (push) Waiting to run
supply-chain / lockfile integrity (Cargo.lock) (push) Waiting to run
supply-chain / cargo deny (license + source + ban policy) (push) Waiting to run
supply-chain / dependency-review (PRs only) (push) Waiting to run
supply-chain / cargo audit (RustSec advisories) (push) Waiting to run
WASM Dedup Check / check-wasm-dedup (push) Waiting to run
SOTA Benchmark (Tier 1 Smoke) / SOTA Smoke (Tier 1) (push) Waiting to run
SOTA Benchmark (Tier 1 Smoke) / SOTA Full Run (Tier 2, on demand) (push) Waiting to run
supply-chain / npm audit (npm/ workspace) (push) Waiting to run
Build Attention Native Modules / Build linux-x64-gnu (push) Has been cancelled
Build Attention Native Modules / Build win32-x64-msvc (push) Has been cancelled
RuvLTRA-Small Tests / Unit Tests (ubuntu-latest) (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN linux-arm64-gnu (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN linux-x64-gnu (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN win32-x64-msvc (push) Has been cancelled
Build GNN Native Modules / Build GNN darwin-arm64 (push) Has been cancelled
Build GNN Native Modules / Build GNN darwin-x64 (push) Has been cancelled
Build GNN Native Modules / Build GNN linux-arm64-gnu (push) Has been cancelled
Build GNN Native Modules / Build GNN linux-x64-gnu (push) Has been cancelled
Build GNN Native Modules / Build GNN linux-x64-musl (push) Has been cancelled
Build GNN Native Modules / Build GNN win32-x64-msvc (push) Has been cancelled
Build Graph Transformer Native Modules / Build darwin-arm64 (push) Has been cancelled
Build Graph Node Native Modules / Build Graph darwin-arm64 (push) Has been cancelled
Build Graph Transformer Native Modules / Build darwin-x64 (push) Has been cancelled
Build Graph Transformer Native Modules / Build linux-arm64-gnu (push) Has been cancelled
Build Graph Transformer Native Modules / Build linux-arm64-musl (push) Has been cancelled
Build Graph Transformer Native Modules / Build linux-x64-gnu (push) Has been cancelled
Build Graph Transformer Native Modules / Build linux-x64-musl (push) Has been cancelled
Build Graph Transformer Native Modules / Build win32-x64-msvc (push) Has been cancelled
Agentic-Synth CI/CD / Code Quality & Linting (push) Has been cancelled
Agentic-Synth CI/CD / Documentation Validation (push) Has been cancelled
Build Attention Native Modules / Build darwin-arm64 (push) Has been cancelled
Build Attention Native Modules / Build darwin-x64 (push) Has been cancelled
Build Attention Native Modules / Build linux-arm64-gnu (push) Has been cancelled
Build Attention Native Modules / Build WASM (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN darwin-arm64 (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN darwin-x64 (push) Has been cancelled
Build Graph Node Native Modules / Build Graph darwin-x64 (push) Has been cancelled
Build Graph Node Native Modules / Build Graph linux-arm64-gnu (push) Has been cancelled
Build Graph Node Native Modules / Build Graph linux-x64-gnu (push) Has been cancelled
Build Graph Node Native Modules / Build Graph win32-x64-msvc (push) Has been cancelled
Build Graph Transformer Native Modules / Build WASM (push) Has been cancelled
Build Router Native Modules / Build Router darwin-arm64 (push) Has been cancelled
Build Router Native Modules / Build Router darwin-x64 (push) Has been cancelled
Build Router Native Modules / Build Router linux-arm64-gnu (push) Has been cancelled
Build Router Native Modules / Build Router linux-x64-gnu (push) Has been cancelled
Build Router Native Modules / Build Router win32-x64-msvc (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer darwin-arm64 (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer darwin-x64 (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer linux-arm64-gnu (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer linux-x64-gnu (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer win32-arm64-msvc (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer win32-x64-msvc (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer linux-arm64-musl (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer linux-x64-musl (push) Has been cancelled
metabiohacker-ci / rust-engine (push) Has been cancelled
metabiohacker-ci / metabiohacker-gates (push) Has been cancelled
Mirror ruvector-rulake → ruvnet/RuLake / Sync crate + ADRs to ruvnet/RuLake (push) Has been cancelled
PostgreSQL Extension CI / Test PostgreSQL 17 on macos-latest (push) Has been cancelled
emergent-time CI / test + lint + examples (push) Has been cancelled
PostgreSQL Extension CI / Test PostgreSQL 17 on ubuntu-latest (push) Has been cancelled
PostgreSQL Extension CI / Test All Features (PostgreSQL 17) (push) Has been cancelled
PostgreSQL Extension CI / Benchmark (push) Has been cancelled
PostgreSQL Extension CI / Security Audit (push) Has been cancelled
PostgreSQL Extension CI / Integration Test (Docker) (push) Has been cancelled
ruvector npm — functional, learning, optimized, effective / Build (push) Has been cancelled
RuVector-Postgres CI/CD / Lint & Format (push) Has been cancelled
thermorust CI / Test (macos-latest) (push) Has been cancelled
thermorust CI / Test (ubuntu-latest) (push) Has been cancelled
RuvLTRA-Small Tests / Unit Tests (windows-latest) (push) Has been cancelled
RuvLTRA-Small Tests / Unit Tests (macos-latest) (push) Has been cancelled
RuvLTRA-Small Tests / E2E Tests (macos-latest) (push) Has been cancelled
RuvLTRA-Small Tests / E2E Tests (ubuntu-latest) (push) Has been cancelled
RuvLTRA-Small Tests / Apple Silicon Tests (push) Has been cancelled
RuvLTRA-Small Tests / Quantization Accuracy (push) Has been cancelled
RuvLTRA-Small Tests / Thread Safety (push) Has been cancelled
RuvLTRA-Small Tests / Performance Benchmarks (push) Has been cancelled
RuvLTRA-Small Tests / Stress Tests (push) Has been cancelled
RuvLTRA-Small Tests / Code Quality (push) Has been cancelled
RuvLTRA-Small Tests / Test Coverage (push) Has been cancelled
thermorust CI / Test (windows-latest) (push) Has been cancelled
thermorust CI / Benchmarks compile (push) Has been cancelled
UI CI (RuVocal) / Build (push) Has been cancelled
UI CI (RuVocal) / Svelte check (push) Has been cancelled
UI CI (RuVocal) / Lint (push) Has been cancelled
UI CI (RuVocal) / Test (push) Has been cancelled
Validate Package Lock File / validate-lockfile (push) Has been cancelled
Agentic-Synth CI/CD / Build & Test (Node 18.x on macos-latest) (push) Has been cancelled
Agentic-Synth CI/CD / Build & Test (Node 18.x on ubuntu-latest) (push) Has been cancelled
Agentic-Synth CI/CD / Build & Test (Node 18.x on windows-latest) (push) Has been cancelled
Agentic-Synth CI/CD / Build & Test (Node 20.x on macos-latest) (push) Has been cancelled
Agentic-Synth CI/CD / Build & Test (Node 20.x on ubuntu-latest) (push) Has been cancelled
Agentic-Synth CI/CD / Build & Test (Node 20.x on windows-latest) (push) Has been cancelled
Agentic-Synth CI/CD / Build & Test (Node 22.x on macos-latest) (push) Has been cancelled
Build Graph Transformer Native Modules / Commit Built Binaries (push) Has been cancelled
Agentic-Synth CI/CD / Build & Test (Node 22.x on ubuntu-latest) (push) Has been cancelled
Agentic-Synth CI/CD / Build & Test (Node 22.x on windows-latest) (push) Has been cancelled
Agentic-Synth CI/CD / Test Coverage Report (push) Has been cancelled
Agentic-Synth CI/CD / Performance Benchmarks (push) Has been cancelled
Agentic-Synth CI/CD / Security Audit (push) Has been cancelled
Agentic-Synth CI/CD / NPM Package Validation (push) Has been cancelled
Agentic-Synth CI/CD / Generate Test Summary (push) Has been cancelled
Build Attention Native Modules / Commit Built Binaries (push) Has been cancelled
Build Attention Native Modules / Publish Attention Platform Packages (push) Has been cancelled
Build DiskANN Native Modules / Publish DiskANN Platform Packages (push) Has been cancelled
Build GNN Native Modules / Commit Built GNN Binaries (push) Has been cancelled
Build GNN Native Modules / Publish GNN Platform Packages (push) Has been cancelled
Build Graph Node Native Modules / Publish Graph Node Platform Packages (push) Has been cancelled
RuVector-Postgres CI/CD / Test PG17 (ubuntu-latest) (push) Has been cancelled
Build Graph Transformer Native Modules / Publish Platform Packages (push) Has been cancelled
Build Router Native Modules / Publish Router Platform Packages (push) Has been cancelled
Build Tiny Dancer Native Modules / Publish Tiny Dancer Platform Packages (push) Has been cancelled
PostgreSQL Extension CI / Package Extension (push) Has been cancelled
ruvector npm — functional, learning, optimized, effective / Recall quality (recall@10 ≥ 0.88 at N=10k) (push) Has been cancelled
ruvector npm — functional, learning, optimized, effective / Unit & CLI tests (push) Has been cancelled
ruvector npm — functional, learning, optimized, effective / Functional smoke (npx ruvector) (push) Has been cancelled
ruvector npm — functional, learning, optimized, effective / Learning check (HNSW activates) (push) Has been cancelled
ruvector npm — functional, learning, optimized, effective / Performance benchmark (≥2× speedup at N=5000) (push) Has been cancelled
ruvector npm — functional, learning, optimized, effective / Tarball integrity (push) Has been cancelled
ruvector npm — functional, learning, optimized, effective / CI pass (push) Has been cancelled
RuVector-Postgres CI/CD / Test PG17 (macos-latest) (push) Has been cancelled
RuVector-Postgres CI/CD / Test All Features (PG17) (push) Has been cancelled
RuVector-Postgres CI/CD / Docker Integration (PG17) (push) Has been cancelled
RuVector-Postgres CI/CD / Performance Benchmarks (push) Has been cancelled
RuVector-Postgres CI/CD / Security Audit (push) Has been cancelled
RuVector-Postgres CI/CD / Package PG17 (push) Has been cancelled
RuVector-Postgres CI/CD / CI Summary (push) Has been cancelled
RuvLTRA-Small Tests / Test Summary (push) Has been cancelled
chore: Update graph transformer NAPI-RS binaries for all platforms
Built from commit 3472db7783

Platforms updated:
- linux-x64-gnu
- linux-x64-musl
- linux-arm64-gnu
- linux-arm64-musl
- darwin-x64
- darwin-arm64
- win32-x64-msvc
- wasm

Generated by GitHub Actions
2026-08-02 19:45:44 +00:00
..
npm chore: Update graph transformer NAPI-RS binaries for all platforms 2026-08-02 19:45:44 +00:00
src chore(workspace): clippy-clean every crate under -D warnings + fmt + repair pre-existing broken benches 2026-04-25 17:00:20 -04:00
build.rs feat: proof-gated graph transformer with 8 verified modules 2026-02-25 14:24:53 +00:00
Cargo.toml fix(security): RUSTSEC advisories + clippy hardening in RuVector (#504) 2026-05-23 05:40:24 -04:00
index.d.ts feat: proof-gated graph transformer with 8 verified modules 2026-02-25 14:24:53 +00:00
index.js feat: proof-gated graph transformer with 8 verified modules 2026-02-25 14:24:53 +00:00
package.json feat: proof-gated graph transformer with 8 verified modules 2026-02-25 14:24:53 +00:00
README.md feat: proof-gated graph transformer with 8 verified modules 2026-02-25 14:24:53 +00:00

@ruvector/graph-transformer

npm License: MIT Tests

Node.js bindings for RuVector Graph Transformer — proof-gated graph attention, verified training, and 8 specialized graph layers via NAPI-RS.

Use graph transformers from JavaScript and TypeScript with native Rust performance. Every graph operation — adding nodes, computing attention, training weights — produces a formal proof receipt proving it was done correctly. The heavy computation runs in compiled Rust via NAPI-RS, so you get sub-millisecond proof verification without leaving the Node.js ecosystem.

Install

npm install @ruvector/graph-transformer

Prebuilt binaries are provided for:

Platform Architecture Package
Linux x64 (glibc) @ruvector/graph-transformer-linux-x64-gnu
Linux x64 (musl) @ruvector/graph-transformer-linux-x64-musl
Linux ARM64 (glibc) @ruvector/graph-transformer-linux-arm64-gnu
macOS x64 (Intel) @ruvector/graph-transformer-darwin-x64
macOS ARM64 (Apple Silicon) @ruvector/graph-transformer-darwin-arm64
Windows x64 @ruvector/graph-transformer-win32-x64-msvc

Quick Start

const { GraphTransformer } = require('@ruvector/graph-transformer');

const gt = new GraphTransformer();
console.log(gt.version()); // "2.0.4"

// Proof-gated mutation
const gate = gt.createProofGate(128);
console.log(gate.dimension); // 128

// Prove dimension equality
const proof = gt.proveDimension(128, 128);
console.log(proof.verified); // true

// Create attestation (82-byte proof receipt)
const attestation = gt.createAttestation(proof.proof_id);
console.log(attestation.length); // 82

API Reference

Proof-Gated Operations

// Create a proof gate for a dimension
const gate = gt.createProofGate(dim);

// Prove two dimensions are equal
const proof = gt.proveDimension(expected, actual);

// Create 82-byte attestation for embedding in RVF witness chains
const bytes = gt.createAttestation(proofId);

// Verify attestation from bytes
const valid = gt.verifyAttestation(bytes);

// Compose a pipeline of type-checked stages
const composed = gt.composeProofs([
  { name: 'embed', input_type_id: 1, output_type_id: 2 },
  { name: 'align', input_type_id: 2, output_type_id: 3 },
]);

Sublinear Attention

// O(n log n) graph attention via PPR sparsification
const result = gt.sublinearAttention(
  [1.0, 0.5, -0.3],     // query vector
  [[1, 2], [0, 2], [0, 1]], // adjacency list
  3,                      // dimension
  2                       // top-k
);
console.log(result.top_k_indices, result.sparsity_ratio);

// Raw PPR scores
const scores = gt.pprScores(0, [[1], [0, 2], [1]], 0.15);

Physics-Informed Layers

// Symplectic leapfrog step (energy-conserving)
const state = gt.hamiltonianStep([1.0, 0.0], [0.0, 1.0], 0.01);
console.log(state.energy);

// With graph interactions
const state2 = gt.hamiltonianStepGraph(
  [1.0, 0.0], [0.0, 1.0],
  [{ src: 0, tgt: 1 }], 0.01
);
console.log(state2.energy_conserved); // true

Biological Layers

// Spiking neural attention (event-driven)
const output = gt.spikingAttention(
  [0.5, 1.5, 0.3],          // membrane potentials
  [[1], [0, 2], [1]],       // adjacency
  1.0                        // firing threshold
);

// Hebbian weight update (Hebb's rule)
const weights = gt.hebbianUpdate(
  [1.0, 0.0],  // pre-synaptic
  [0.0, 1.0],  // post-synaptic
  [0, 0, 0, 0], // current weights (flattened)
  0.1            // learning rate
);

// Full spiking step over feature matrix
const result = gt.spikingStep(
  [[0.8, 0.6], [0.1, 0.2]],  // n x dim features
  [0, 0.5, 0.3, 0]            // flat adjacency (n x n)
);

Verified Training

// Single verified SGD step with proof receipt
const result = gt.verifiedStep(
  [1.0, 2.0],  // weights
  [0.1, 0.2],  // gradients
  0.01          // learning rate
);
console.log(result.proof_id, result.loss_before, result.loss_after);

// Full training step with features and targets
const step = gt.verifiedTrainingStep(
  [1.0, 2.0],   // features
  [0.5, 1.0],   // targets
  [0.5, 0.5]    // weights
);
console.log(step.certificate_id, step.loss);

Manifold Operations

// Product manifold distance (mixed curvatures)
const d = gt.productManifoldDistance(
  [1, 0, 0, 1],    // point a
  [0, 1, 1, 0],    // point b
  [0.0, -1.0]      // curvatures (Euclidean, Hyperbolic)
);

// Product manifold attention
const result = gt.productManifoldAttention(
  [1.0, 0.5, -0.3, 0.8],
  [{ src: 0, tgt: 1 }]
);

Temporal-Causal Attention

// Causal attention (no future information leakage)
const scores = gt.causalAttention(
  [1.0, 0.0],                        // query
  [[1.0, 0.0], [0.0, 1.0], [0.5, 0.5]], // keys
  [1.0, 2.0, 3.0]                    // timestamps
);

// Causal attention over graph
const output = gt.causalAttentionGraph(
  [1.0, 0.5, 0.8],    // node features
  [1.0, 2.0, 3.0],    // timestamps
  [{ src: 0, tgt: 1 }, { src: 1, tgt: 2 }]
);

// Granger causality extraction
const dag = gt.grangerExtract(flatHistory, 3, 20);
console.log(dag.edges); // [{ source, target, f_statistic, is_causal }]

Economic / Game-Theoretic

// Nash equilibrium attention
const result = gt.gameTheoreticAttention(
  [1.0, 0.5, 0.8],  // utility values
  [{ src: 0, tgt: 1 }, { src: 1, tgt: 2 }]
);
console.log(result.allocations, result.nash_gap, result.converged);

Stats & Control

// Aggregate statistics
const stats = gt.stats();
console.log(stats.proofs_verified, stats.attestations_created);

// Reset all internal state
gt.reset();

Building from Source

# Install NAPI-RS CLI
npm install -g @napi-rs/cli

# Build native module
cd crates/ruvector-graph-transformer-node
napi build --platform --release

# Run tests
cargo test -p ruvector-graph-transformer-node
Package Description
ruvector-graph-transformer Core Rust crate
ruvector-graph-transformer-wasm WASM bindings for browsers
@ruvector/gnn Base GNN operations
@ruvector/attention 46 attention mechanisms

License

MIT