RuVector

April 27, 2026 Β· View on GitHub

CES 2026 Innovation Award GitHub Trending

Crates.io npm Downloads Monthly Downloads ruv.io MIT License

The self-learning, self-optimizing vector database β€” with graph intelligence, local AI, and PostgreSQL built in.

Created by rUv and powering Cognitum, a πŸ… CES 2026 Innovation Awards Honoree β€” the world's first Agentic Chip designed to be always running for AI agents. Tens of thousands of agents, near-zero power, learns from every signal. Learn more β†’

npx ruvector

Most vector databases store your data and search it β€” the same way, every time.

RuVector is fundamentally different. It watches how you use it and gets smarter: search results improve automatically, the system tunes itself to your workload, and it runs AI models right on your hardware β€” no cloud APIs, no per-query bills, GPUs optional, CPUs preferred. It drops into PostgreSQL, runs in browsers, and ships as a single file.

Open source. ❀️ Free forever.

User Query β†’ [SONA Engine] β†’ Model Response β†’ User Feedback
                  ↑                                 β”‚
                  └─────── Learning Signal β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         (< 1ms adaptation)
πŸ” RuVector vs Typical Vector Databases (25 differences)
RuVectorTypical Vector DB
Self-Learning & Optimization
Search quality🧠 GNN learns from every query β€” results improve over timeStatic β€” same results every time
Self-optimizing⚑ SONA auto-tunes routing, ranking, and compression to your workloadManual tuning required
50+ attention mechanisms🎯 FlashAttention-3, MLA, Mamba SSM, linear, graph, hyperbolic, mincut-gatedBasic similarity only
Transfer learningπŸ”„ Knowledge transfers across domains β€” new tasks bootstrap from past learningStart from scratch each time
Search & Retrieval
Hybrid searchπŸ” Sparse vectors + dense vectors with RRF fusion β€” 20-49% better retrievalKeyword OR vector, not both
Graph RAGπŸ“Š Knowledge graph + community detection for multi-hop queries β€” 30-60% improvementNaive chunk-based RAG
DiskANNπŸ’Ύ Billion-scale SSD-backed ANN with <10ms latency via Vamana graphMemory-only indexes
TurboQuant⚑ 2-4 bit KV-cache quantization β€” 6-8x memory savings with <0.5% quality lossNo quantization or 8-bit only
ColBERT multi-vector🎯 Per-token late interaction retrieval (MaxSim) for fine-grained matchingSingle-vector only
Matryoshka embeddingsπŸͺ† Adaptive-dimension search β€” coarse-to-fine funnel for speed with minimal recall lossFixed dimensions only
Graph & Relationships
Graph queriesπŸ”— Full Cypher engine β€” MATCH (a)-[:KNOWS]->(b) like Neo4jFlat list of results
Graph transformersπŸ”¬ 8 verified modules: physics, bio, manifold, temporal, economicNo graph support
HyperedgesπŸ•ΈοΈ Connect 3+ nodes at once β€” model group relationships nativelyPairwise only
AI & Compute
Local LLMsπŸ€– Run models on your hardware β€” Metal, CUDA, WebGPU, no API costsCloud API required (pay per call)
Sublinear solversπŸ“ O(log n) PageRank, spectral methods, sparse linear systemsNot available
Graph sparsifierπŸ•ΈοΈ Keeps a small shadow graph that tracks the full graph's structure in real timeNot available
Genomics🧬 Variant calling, protein translation, HNSW k-mer search in 12 msNot available
Quantum coherenceβš›οΈ Error correction via dynamic min-cut optimizationNot available
Database & Platform
PostgreSQL🐘 230+ SQL functions β€” drop into your existing database, pgvector replacementSeparate service to manage
Deploy anywhere🌐 One file β€” servers, browsers, phones, IoT, bare metal, WASM (58 KB)Cloud server required
Cognitive containersπŸš€ Single .rvf file boots as a service in 125 ms β€” includes vectors, models, kernelConfigure a cluster
Live updates⚑ Update vectors and graph connections instantly, no downtimeRebuild index or wait
Operations
Tamper-proof auditπŸ” Cryptographic witness chain records every operation automaticallyManual logging
Branch your data🌿 Git-like COW branching β€” 1M vectors, 100 edits = ~2.5 MB branchCopy everything
Scale outπŸ“ˆ Raft consensus, multi-master replication, auto-shardingPaid tiers, per-vector pricing
Post-quantum cryptoπŸ›‘οΈ ML-DSA-65 and Ed25519 signatures on every segmentNot available
CostπŸ’° Free forever β€” open source (MIT)Per-query or per-vector pricing
πŸ“‹ See Full Capabilities (75 features across 10 categories)

Core Vector Database

#CapabilityWhat It Does
1Store vectorsEmbeddings from OpenAI, Cohere, local ONNX with HNSW indexing and SIMD acceleration
2Query with CypherGraph queries like Neo4j β€” MATCH (a)-[:SIMILAR]->(b) with hyperedges
3The index learnsGNN layers make search results improve over time β€” every query teaches the system
4Hyperbolic HNSWHierarchy-aware search in Poincare ball space β€” better for trees and taxonomies
5Compress automatically2-32x memory reduction with adaptive tiered compression and temporal tensor reuse
6Metadata filteringFilter search results by any field before scanning vectors β€” fast hybrid queries
7CollectionsMulti-tenant, schema-managed collections β€” isolate data per customer or project
8SnapshotsPoint-in-time backups β€” restore your database to any previous state

Advanced Search & Retrieval (new in v2.1.0)

#CapabilityWhat It Does
8aHybrid search (RRF)Sparse + dense vector fusion with Reciprocal Rank Fusion β€” 20-49% retrieval improvement
8bGraph RAGKnowledge graph + Leiden community detection + local/global/hybrid search β€” 30-60% better on complex queries
8cDiskANN / VamanaSSD-backed billion-scale ANN with alpha-RNG pruning and LRU page cache β€” <10ms latency
8dColBERT multi-vectorPer-token late interaction retrieval with MaxSim, AvgSim, SumMax scoring
8eMatryoshka embeddingsAdaptive-dimension search with funnel and cascade modes β€” speed with minimal recall loss
8fOPQOptimized Product Quantization with learned rotation β€” 10-30% error reduction vs standard PQ
8gLSM compactionLog-Structured Merge-tree for write-heavy vector workloads with bloom filters
8hGraphMAEGraph Masked Autoencoder β€” self-supervised node representation learning with GAT encoder
8iTurboQuant2-4 bit asymmetric KV-cache quantization β€” 6-8x memory reduction, <0.5% perplexity loss, H2O/PyramidKV eviction

Continuous Training & Optimization (ADR-129)

#CapabilityWhat It Does
8jNightly trainingAutomated nightly LoRA fine-tuning from brain learnings β€” models improve every day
8kRelease gates7 automated quality checks (code quality, routing accuracy, perplexity, speed, contamination) β€” prevents shipping regressions
8lTurboQuant profilingPer-layer KV-cache bit-width optimization with .turboquant.json sidecar configs
8mTraining corpus230+ records from brain memories (pi.ruv.io) + architecture decisions + Claude routing examples

Distributed Systems

#CapabilityWhat It Does
9Raft consensusLeader election and log replication β€” nodes agree on state even when some fail
10Multi-master replicationVector clocks, conflict resolution, geo-distributed sync across data centers
11Cluster managementHorizontal scaling with consistent hashing β€” add nodes without rebalancing everything
12Delta consensusTrack behavioral changes across distributed nodes with CRDTs and causal ordering
13Burst scaling10-50x capacity scaling for traffic spikes β€” absorb load then scale back down
14Auto-shardingAutomatic data partitioning across nodes based on access patterns

AI & Machine Learning

#CapabilityWhat It Does
15Run LLMs locallyLoad GGUF models and run inference on your hardware β€” Metal, CUDA, ANE, WebGPU
16RuvLTRA modelsPre-trained GGUF for routing and embeddings in under 10 ms
17SONA learningSelf-Optimizing Neural Architecture β€” LoRA fine-tuning + EWC++ memory preservation
1850+ attention mechanismsFlashAttention-3, MLA, Mamba SSM, KV-cache compression, speculative decoding, graph, hyperbolic, mincut-gated
19Semantic routingRoute AI requests to the right model or handler using FastGRNN neural inference
20Sparse inferencePowerInfer-style engine β€” only activate the neurons you need, 2-10x faster on edge
21Tiny DancerProduction-grade agent routing with FastGRNN β€” lightweight alternative to full LLM
22Domain expansionCross-domain transfer learning β€” new tasks bootstrap from past learning automatically
23Advanced mathOptimal transport, Sinkhorn distances, KL divergence, spectral clustering
24Coherence measurementMeasure signal quality and compare attention mechanisms objectively
25CNN image embeddingsMobileNet-V3 with SIMD/Winograd/INT8 β€” <5ms image embeddings, WASM-ready, zero deps

Graph Transformers (8 verified modules)

#CapabilityWhat It Does
25Proof-gated mutationEvery write to graph state requires a formal proof β€” bugs cannot corrupt data
26Sublinear attentionO(n log n) via LSH bucketing, PPR sampling, and spectral sparsification
27Physics-informed layersHamiltonian dynamics, gauge equivariant message passing β€” energy conserved by construction
28Biological layersSpiking attention, Hebbian/STDP learning, dendritic branching
29Self-organizing layersMorphogenetic fields, reaction-diffusion growth β€” graphs that restructure themselves
30Verified trainingTraining certificates, delta-apply rollback β€” bad gradient steps auto-reversed
31Manifold geometryProduct manifolds S^n x H^m x R^k β€” work in curved spaces, not just flat
32Temporal-causal layersCausal masking, Granger causality extraction, continuous-time ODE integration
33Economic layersNash equilibrium attention, Shapley attribution β€” fair value assignment in multi-agent graphs

Cognitive Containers (RVF format)

#CapabilityWhat It Does
34Self-boot as a microserviceA single .rvf file contains vectors, models, and a Linux kernel β€” boots in 125 ms
35eBPF accelerationHot vectors served in kernel data path via XDP, socket filter, and TC programs
365.5 KB WASM runtimeSame .rvf file runs queries in a browser tab with zero backend
37COW branchingGit-like copy-on-write β€” 1M vectors, 100 edits = ~2.5 MB branch
38Witness chainsTamper-evident hash-linked audit trail records every operation automatically
39Post-quantum signaturesML-DSA-65 and SLH-DSA-128s alongside Ed25519 β€” future-proof cryptography
40DNA-style lineageTrack parent/child derivation chains with cryptographic hashes
4125 segment typesVEC, INDEX, KERNEL, EBPF, WASM, COW_MAP, WITNESS, CRYPTO, and 17 more

PostgreSQL Extension (230+ SQL functions)

#CapabilityWhat It Does
42Drop-in pgvector replacementSame SQL interface but with self-learning search β€” no app changes needed
43Sublinear solvers in SQLPageRank, conjugate gradient, Laplacian solver β€” O(log n) to O(sqrt(n))
44Math distances in SQLWasserstein, Sinkhorn, KL divergence, spectral clustering β€” all from SQL
45Topological data analysisPersistent homology, Betti numbers, embedding drift detection
46SONA learning in SQLMicro-LoRA trajectory learning with EWC++ forgetting prevention
47Extended attention in SQLO(n) linear, MoE, hyperbolic, sliding window attention β€” all callable from SQL

Specialized Processing

#CapabilityWhat It Does
48SciPix OCRExtract LaTeX and MathML from scientific documents and PDFs
49DAG workflowsSelf-learning directed acyclic graph execution for multi-step pipelines
50Cognitum GateCognitive AI gateway with TileZero acceleration for fast routing
51FPGA transformerHardware-accelerated transformer inference on programmable chips
52Quantum coherenceError correction via dynamic min-cut optimization for quantum circuits
53Sublinear solvers8 algorithms (Neumann, CG, Forward Push, TRUE, BMSSP) β€” O(log n) to O(sqrt(n))
54Graph sparsifierCompressed shadow graph preserving spectral properties β€” O(n log n) edges instead of O(nΒ²)
55Mincut-gated transformerDynamic attention that prunes irrelevant connections using graph min-cut
56Nervous system5-layer bio-inspired adaptive system with spiking networks and BTSP learning
57Prime RadiantCoherence engine using sheaf Laplacian math for AI safety and hallucination detection

Genomics & Health (rvDNA)

#CapabilityWhat It Does
57rvDNA genomic analysisVariant calling, protein translation, HNSW k-mer search in 12 ms
58.rvdna file formatAI-native binary with pre-computed vectors, tensors, and embeddings
59Instant diagnosticsSickle cell, cancer mutations, drug dosing β€” runs on any device
60Privacy-first WASMBrowser-based genomics β€” your DNA data never leaves the device
61Biomarker engineComposite polygenic risk scoring (20 SNPs, 6 gene-gene interactions, 2 us)
62Streaming biomarkersReal-time anomaly detection, CUSUM changepoints, trend analysis (>100k readings/sec)

Platform & Integration

#CapabilityWhat It Does
63Run anywhereRust, Node.js, browser (WASM), edge (rvLite), HTTP server, bare metal
64MCP serverModel Context Protocol for AI assistants β€” Claude, GPT, and other agents can use RuVector as a tool
65Cloud deploymentOne-click deploy to Google Cloud Run, Kubernetes
66iOS App ClipScan a QR code to load an RVF cognitive seed on your phone β€” under 15 MB
67Prometheus metricsBuilt-in monitoring β€” export latency, throughput, and memory stats to Grafana
6890+ Rust crates + npm packagesPublished on crates.io and npm

Examples & Applications

#CapabilityWhat It Does
69Neural TraderAlgorithmic trading with Kelly Criterion position sizing and LSTM-Transformer prediction
70Spiking Neural NetworkHybrid AI combining spiking networks, SIMD vector ops, and 5 attention types
71ReFrag PipelineCompress-Sense-Expand architecture β€” ~30x RAG latency reduction
72Edge NetworkDistributed collective AI β€” share idle compute across devices
73Vibecast 7SenseTransform bird calls into navigable geometric space using vector search
74Ultra-Low Latency SimMeta-simulation achieving quadrillion simulations per second on CPU with SIMD
75Verified Applications10 exotic proof-carrying apps: weapons filters, legal forensics, medical diagnostics

Built by rUv, powered by Cognitum.one

Cognitum Hardware β€” The Agentic Appliance & Chip

Cognitum v0 β€” The Agentic Appliance: Run tens of thousands of always-on agents at no incremental cost beyond the box. Learns in proximity to any signal β€” sensors, networks, machines β€” at near-zero power (~5 uW/inference, <15W total). Sub-millisecond response, 500x cheaper than cloud AI. No cloud bills, no per-agent fees. Like a nervous system, not a brain.

Cognitum v1 β€” The Agentic Chip: Same architecture on a single 257-core custom chip. Runs on less than 2W β€” a AA battery. Idle-to-8 GHz burst on demand, 2 TB/s interconnect, built-in encryption per core.

A Complete Agentic AI Operating System

RuVector isn't a database you add to your stack β€” it's the entire stack. Self-learning, self-optimizing, and self-deploying. Everything an AI application needs to run, from bare metal hardware up to the application layer, in one package:

Intelligence

LayerReplacesWhat It Does
πŸ”„Self-LearningManual retraining, MLOpsSONA adapts in <1 ms β€” LoRA fine-tuning + EWC++ memory on every request
⚑Self-OptimizingManual tuning, config filesAuto-tunes routing, ranking, compression, and index parameters
🎯EmbeddingsOpenAI API, Cohere, static modelsContrastive training, triplet loss, real-time fine-tuning β€” embeddings improve as you use them
βœ…Verified TrainingManual validationFormal proofs + statistical tests on every training step β€” gradients only apply if invariants pass

Data & Search

LayerReplacesWhat It Does
πŸ”SearchPinecone, Weaviate, QdrantSelf-learning HNSW β€” GNN improves results from every query
πŸ—„οΈStorageSeparate database + cacheVector store, graph DB, key-value cache β€” unified engine
🐘PostgreSQLpgvector, pg_embeddingDrop-in replacement β€” 230+ SQL functions, same interface but search gets smarter over time
πŸ”—GraphNeo4j, Amazon NeptuneCypher, W3C SPARQL 1.1, hyperedges β€” all built in

AI & ML

LayerReplacesWhat It Does
πŸ€–AI Runtimellama.cpp, vLLM, Ollamaruvllm β€” GGUF models, MicroLoRA (<1 ms), speculative decoding, continuous batching, WASM
🧠ML FrameworkPyTorch, TensorFlow50+ attention types, FlashAttention-3, MLA, Mamba SSM, Graph RAG, DiskANN, 8 graph transformers, sublinear solvers
πŸ”¬CoherenceManual testing, guardrailsMin-cut finds the weakest links in any network β€” detects AI drift, prunes wasted compute (50% reduction), keeps agents in sync
🧬Domain ModelsCustom ML pipelinesGenomics (DNA variant calling), physics simulation, economic modeling, biological networks

Infrastructure

LayerReplacesWhat It Does
πŸ”§HardwareCUDA toolkit, driver configsSparse/spiking CPU (AVX-512, NEON) β€” GPU for bursts (Metal, CUDA, ANE, WebGPU, FPGA)
🐧KernelLinux + Docker + eBPF.rvf file boots its own kernel in 125 ms β€” eBPF accelerates hot paths
🌐Coordinationetcd, ZooKeeper, ConsulRaft consensus, multi-master replication, CRDT delta sync, auto-sharding
πŸ“¦PackagingDocker, KubernetesOne .rvf file = your entire service β€” servers, browsers, phones, IoT, bare metal

Routing & Observability

LayerReplacesWhat It Does
🚦RoutingAPI gateways, LLM routersSemantic routing (Tiny Dancer), MCP protocol gateway, agent-to-agent discovery
πŸ“ŠObservabilityDatadog, PrometheusLatency/power/memory profiling, coherence scoring, real-time metrics
πŸ›‘οΈSafetyManual review, guardrailsCognitum Gate β€” 256-tile WASM fabric, Permit/Defer/Deny in <1 ms, witness receipts

Security & Trust

LayerReplacesWhat It Does
πŸ”CryptoVault, manual audit logsPost-quantum (ML-DSA-65, Ed25519), SHAKE-256, witness chains, hardware attestation
πŸ“œLineageNo equivalentEvery operation recorded in a tamper-proof chain β€” full provenance from creation to deployment

The RVF cognitive container ties it all together: a single file that packages your vectors, models, data, and a bootable kernel. Drop it on any machine and it starts serving in 125 ms β€” no install, no dependencies. It branches like Git (only changes are copied), logs every operation in a tamper-proof chain, and runs anywhere from a browser to bare metal.


How the GNN Works

Traditional vector search:

Query β†’ HNSW Index β†’ Top K Results

RuVector with GNN:

Query β†’ HNSW Index β†’ GNN Layer β†’ Enhanced Results
                ↑                      β”‚
                └──── learns from β”€β”€β”€β”€β”€β”˜

The GNN layer:

  1. Takes your query and its nearest neighbors
  2. Applies multi-head attention to weigh which neighbors matter
  3. Updates representations based on graph structure
  4. Returns better-ranked results β€” all in under 1ms

This is temporal learning β€” the system learns from the sequence and timing of queries, not just their content. A query asked right after another carries context. Patterns that repeat get reinforced. Paths that lead to good results get stronger over time. The result: search gets faster and more accurate the more you use it, adapting in real time without retraining.

Deep Dive: How Self-Learning Search Actually Works

Every vector database does the same thing: you give it a query, it finds the closest matches by distance, and returns them. The results never change. Search the same thing a thousand times and you get the same answer a thousand times β€” even if the first result was wrong and you always clicked the third one instead.

RuVector is different. It watches what happens after the search and uses that to make the next search better.

What the GNN Actually Does

Think of your data as a city map. Each vector is a building, and the HNSW index creates roads between similar buildings. A normal search just walks the shortest road to find nearby buildings.

The GNN is like a local who knows the shortcuts. It looks at the neighborhood around your destination and says: "Yes, that building is close, but this one over here is what you actually want." It learns these shortcuts by watching which results people actually use.

Technically, it works in three steps:

StepWhat HappensPlain English
1. Message PassingEach node collects information from its HNSW neighbors"Ask the neighborhood what they know"
2. Attention WeightingMulti-head attention scores which neighbors matter most for this specific query"Some neighbors are more helpful than others β€” figure out which ones"
3. Representation UpdateNode representations shift based on what the neighborhood says"Update your understanding based on what you learned"

This entire process takes under 1ms thanks to SIMD acceleration (processing 4-8 numbers at once instead of one at a time).

Temporal Learning: Time Matters

Most AI systems treat every input as independent β€” they don't know or care what happened 5 seconds ago. RuVector tracks the sequence and timing of queries, which reveals patterns that individual queries can't:

PatternWhat It RevealsHow RuVector Adapts
Same user searches A then B within secondsA and B are related, even if they're far apart in vector spaceStrengthens the path between A and B
Many users skip result #1 and click result #3Result #3 is actually more relevantGNN learns to rank #3 higher next time
Query bursts around a topic at certain timesTemporal relevance β€” some things matter more at certain timesBoosts recently-active paths
A query that follows a specific sequenceContext from previous queries changes what "good results" meansAttention weights shift based on session context

Three Types of Learning

RuVector learns at three different speeds simultaneously:

SpeedMechanismWhat It DoesLatency
InstantMicroLoRA adaptationAdjusts weights for this specific request based on immediate feedback<1ms
SessionGNN attention updatesReinforces paths that led to good results during this session~10ms (background)
Long-termEWC++ consolidationPermanently strengthens important patterns without forgetting old ones~100ms (background)

The key innovation is EWC++ (Elastic Weight Consolidation) β€” it solves the "catastrophic forgetting" problem. Without it, learning new patterns would erase old ones. EWC++ identifies which weights are important for existing knowledge and protects them while still allowing new learning.

Why It's Fast: The HNSW Shortcut

The GNN doesn't run on your entire dataset. It only runs on the small subgraph of HNSW neighbors that are relevant to the current query β€” typically 10-50 nodes out of millions. This is why it adds under 1ms of latency instead of seconds:

1M vectors in your database
    β†’ HNSW finds ~50 candidate neighbors        (0.3ms)
    β†’ GNN re-ranks those 50 with attention       (0.4ms)
    β†’ Return top K results                       (0.1ms)
    ──────────────────────────────────────────
    Total: <1ms, and results improve over time

What Improves Over Time

MetricDay 1After 1K QueriesAfter 100K Queries
Recall@10Baseline (HNSW only)+5-8%+12.4%
Query latency~0.8ms~0.7ms (hot paths cached)~0.5ms (optimized routing)
RelevanceDistance-based onlyLearns user preferencesPersonalized per query pattern

Three GNN Architectures (Pick One or Stack Them)

ArchitectureBest ForHow It Works
GCN (Graph Convolutional Network)General-purpose re-rankingAverages neighbor information β€” simple, fast, effective
GAT (Graph Attention Network)Queries where some neighbors matter more than othersLearns which neighbors to pay attention to per query
GraphSAGEDatasets that change frequently (new vectors added often)Can score new vectors it's never seen before, without retraining

Runs Everywhere

The same GNN code runs natively in Rust, in Node.js via NAPI-RS bindings, and in the browser via WebAssembly. Models trained on the server can be exported and run client-side β€” a user's browser can do personalized re-ranking without sending queries to a server.

Quick Start

One-Line Install

# Interactive installer - lists all packages
npx ruvector install

# Or install directly
npm install ruvector
npx ruvector

# Self-learning hooks for Claude Code
npx @ruvector/cli hooks init
npx @ruvector/cli hooks install

# LLM runtime (SONA learning, HNSW memory)
npm install @ruvector/ruvllm

Node.js / Browser

# Install
npm install ruvector

# Or try instantly
npx ruvector

Ecosystem: AI Agent Orchestration

RuVector powers two major AI orchestration platforms:

PlatformPurposeInstallDownloads
ruFloEnterprise multi-agent orchestration for Claude Codenpx ruvflo@latestnpm downloads
Agentic-FlowRun AI agents on any cloud with any model β€” Claude, GPT, Gemini, or localnpx agentic-flow@latestnpm downloads
AgentDBGive AI agents long-term memory that gets smarter over timenpm install agentdb@alphanpm downloads
Claude-Flow v3 β€” Turn Claude Code into a collaborative AI team

54+ specialized agents working together on complex software engineering tasks:

# Install
npx ruvflo@latest init --wizard

# Spawn a swarm
npx ruvflo@latest swarm init --topology hierarchical --max-agents 8

Key Features:

  • SONA Learning: Sub-50ms adaptive routing, learns optimal patterns over time
  • Queen-led Swarms: Byzantine fault-tolerant consensus with 5 protocols (Raft, Gossip, CRDT)
  • HNSW Memory: 150x-12,500x faster pattern retrieval via RuVector
  • 175+ MCP Tools: Native Model Context Protocol integration
  • Cost Optimization: 3-tier routing extends Claude Code quota by 2.5x
  • Security: AIDefence threat detection (<10ms), prompt injection blocking
Agentic-Flow v2 β€” Production AI agents for any cloud

66 self-learning agents with Claude Agent SDK, deployable to any cloud:

# Install
npx agentic-flow@latest

# Or with npm
npm install agentic-flow

Key Features:

  • SONA Architecture: <1ms adaptive learning, +55% quality improvement
  • Flash Attention: 2.49x JS speedup, 7.47x with NAPI bindings
  • 213 MCP Tools: Swarm management, memory, GitHub integration
  • Agent Booster: 352x faster code editing for simple transforms
  • Multi-Provider: Claude, GPT, Gemini, Cohere, local models with failover
  • Graph Reasoning: GNN query refinement with +12.4% recall improvement
rvDNA β€” AI-native genomic diagnostics, instant and available to everyone

Using AI to make the world a healthier place. rvDNA puts genomic diagnostics on any device β€” a phone, a laptop, a browser tab β€” in 12 milliseconds. No cloud, no GPU, no subscription. Private by default.

cargo add rvdna              # Rust
npm install @ruvector/rvdna  # JavaScript / TypeScript
What It DoesHow
Find mutations (sickle cell, cancer)Bayesian variant calling, 155 ns/SNP
Translate DNA to proteinFull codon table + GNN contact graphs
Predict biological ageHorvath clock, 353 CpG sites
Recommend drug dosesCYP2D6 star alleles + CPIC guidelines
Score health risks20 SNPs, 6 gene-gene interactions, composite risk scoring in 2 us
Stream biomarker dataReal-time anomaly detection, CUSUM changepoints, >100k readings/sec
Search genomes by similarityHNSW k-mer vectors, O(log N)
Store pre-computed AI features.rvdna binary format β€” open and instant
RVF Cognitive Containers β€” One file that stores, boots, and proves everything

RVF (RuVector Format) is a universal binary substrate that merges database, model, graph engine, kernel, and attestation into a single deployable file. A .rvf file can store vector embeddings, carry LoRA adapter deltas, embed GNN graph state, include a bootable Linux microkernel, run queries in a 5.5 KB WASM runtime, and prove every operation through a cryptographic witness chain β€” all in one file that runs anywhere from a browser to bare metal.

This is not a database format. It is an executable knowledge unit.

cargo install rvf-cli                          # CLI tool
cargo add rvf-runtime                          # Rust library
npm install @ruvector/rvf                      # TypeScript SDK
npx @ruvector/rvf-mcp-server --transport stdio # MCP server for AI agents
What It DoesHow
Self-boot as a microserviceReal Linux kernel in the file, boots in 125 ms on QEMU/KVM
Hardware-speed lookupseBPF programs (XDP, TC, socket filter) bypass userspace entirely
Run in any browser5.5 KB WASM runtime, zero backend
Git-like branchingCOW at cluster granularity β€” 1M vectors, 100 edits = ~2.5 MB child
Tamper-evident auditHash-linked witness chain for every insert, query, and deletion
Post-quantum signaturesML-DSA-65 and Ed25519 signing on every segment
DNA-style lineageParent/child derivation chains with cryptographic verification
28 segment typesVEC, INDEX, KERNEL, EBPF, WASM, COW_MAP, WITNESS, CRYPTO, FEDERATED_MANIFEST, and 19 more

Rust crates (23): rvf-types rvf-wire rvf-manifest rvf-quant rvf-index rvf-crypto rvf-runtime rvf-kernel rvf-ebpf rvf-federation rvf-launch rvf-server rvf-import rvf-cli rvf-wasm rvf-solver-wasm rvf-node + 6 adapters (claude-flow, agentdb, ospipe, agentic-flow, rvlite, sona)

npm packages (6): @ruvector/rvf @ruvector/rvf-node @ruvector/rvf-wasm @ruvector/rvf-mcp-server @ruvector/ruvllm-wasm @ruvector/neural-trader-wasm

RuVix Cognition Kernel β€” an operating system for AI agents

RuVix is a cognition kernel designed for agentic workloads. Where Linux thinks in files, processes, and POSIX syscalls, RuVix thinks in vectors, graphs, proofs, and capabilities. Every mutation is proof-gated β€” no cryptographic proof, no state change. Every resource access goes through unforgeable capability tokens. The result: a kernel that understands AI workloads natively.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    AGENT CONTROL PLANE                          β”‚
β”‚  Claude Code β”‚ AgentDB β”‚ Custom Agents β”‚ RuVLLM Inference       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    RVF COMPONENT SPACE                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚ RuView   β”‚ β”‚ AgentDB  β”‚ β”‚ RuVLLM   β”‚ β”‚ Network  β”‚ ...       β”‚
β”‚  β”‚ Percept. β”‚ β”‚ Intelli. β”‚ β”‚ Infer.   β”‚ β”‚ Stack    β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜           β”‚
β”‚       β”‚queue       β”‚queue       β”‚queue       β”‚queue             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    RUVIX COGNITION KERNEL                       β”‚
β”‚  Capability Manager β”‚ Queue IPC β”‚ Coherence-Aware Scheduler     β”‚
β”‚  Region Memory β”‚ Proof Engine β”‚ Vector/Graph Kernel Objects     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
PrimitivePurposeStatus
TaskConcurrent execution with capability setβœ… Implemented
CapabilityUnforgeable access token (seL4-inspired)βœ… Implemented
RegionMemory with policy (immutable/append/slab)βœ… Implemented
Queueio_uring-style lock-free IPCβœ… Implemented
TimerDeadline-driven schedulingβœ… Implemented
ProofCryptographic attestation for mutationsβœ… Implemented

Phases A-F complete: 20+ crates, 1,200+ tests, 12 syscalls, full deterministic replay.

PhaseComponentsDescription
ACore Kernel9 crates: types, cap, region, queue, proof, sched, boot, vecgraph, nucleus
BBare MetalAArch64 boot, MMU, exception vectors, HAL, physical memory allocator
CMulti-CoreSMP support (256 cores), ticket spinlocks, IPIs, DMA, Device Tree
DRaspberry PiBCM2711/2712 drivers, GPIO, VideoCore mailbox, config.txt parsing
ENetwork/FSEthernet/IPv4/UDP stack, VFS layer, FAT32, RamFS
FToolingCLI, kernel shell, QEMU swarm simulation with PBFT consensus

Developer Tools:

ToolPurpose
ruvix buildCross-compile kernel for AArch64 targets
ruvix flashFlash kernel to SD card or network boot
ruvix keysEd25519 key management for secure boot
ruvix dtbDevice tree validation, comparison, decompilation
ruvix monitorReal-time kernel metrics dashboard
ruvix securitySecurity audit and CVE scanning
rvsh (kernel)In-kernel debug shell with 13 commands

Distributed Testing (QEMU Swarm):

FeatureDescription
Multi-node clustersSpawn N QEMU instances as cluster nodes
PBFT consensusByzantine fault-tolerant consensus (f < n/3)
Virtual networkingMesh, ring, star topologies
Fault injectionNetwork partitions, node crashes, latency
Console multiplexingAggregate output from all nodes
Sublinear-Time Solver β€” math that gets faster as your data gets bigger

ruvector-solver solves large math problems (like ranking pages, finding connections in graphs, or computing AI attention) in a fraction of the time traditional solvers need. Where standard approaches slow down dramatically with scale (doubling data = 8x slower), RuVector's 8 specialized algorithms barely notice the increase (doubling data = barely any slower). This is what powers the self-learning engine β€” fast graph math is what lets search improve in real time instead of waiting minutes to retrain.

cargo add ruvector-solver --features all-algorithms
AlgorithmComplexityBest For
Neumann SeriesO(k Β· nnz)Diagonally dominant, fast convergence
Conjugate GradientO(√κ · log(1/Ρ) · nnz)Gold-standard SPD solver
Forward PushO(1/Ξ΅)Single-source PageRank
Backward PushO(1/Ξ΅)Reverse relevance computation
Hybrid Random WalkO(√n/Ρ)Pairwise relevance, Monte Carlo
TRUEO(log n) amortizedLarge-scale Laplacian systems
BMSSPO(nnz Β· log n)Multigrid hierarchical solve
Auto RouterAutomaticSelects optimal algorithm

Key optimizations: AVX2 SIMD SpMV, fused residual kernels, bounds-check elimination, arena allocator

Supporting crates:

Graph Sparsifier β€” a small graph that behaves like the big one

ruvector-sparsifier maintains a compressed "shadow graph" that preserves the structural properties of a much larger graph. Think of it as a lossy summary: instead of storing every connection between millions of nodes, the sparsifier keeps only the most important edges β€” enough to answer questions about cuts, connectivity, and flow almost as accurately as the full graph, but with far less memory and compute.

It updates incrementally as edges are added or removed, so the compressed version stays current without rebuilding from scratch. A built-in auditor periodically checks that the approximation is still good; if quality drifts, it triggers an automatic rebuild.

cargo add ruvector-sparsifier
ComponentWhat it does
BackboneSpanning forest (union-find) that guarantees connectivity is never lost
Importance scorerRandom walks estimate which edges matter most for the graph's structure
Spectral samplerKeeps edges proportional to their importance, reweights to stay unbiased
AuditorRandom probes verify the compressed graph still matches the original

How RuVector Compares

See how RuVector stacks up against popular vector databases across 40+ features β€” from latency and graph queries to self-learning, cognitive containers, and PostgreSQL integration.

πŸ“Š Comparison with Other Vector Databases

Grouped comparison across 10 categories. RuVector is the only vector database that learns from usage, runs AI locally, and ships as a single self-booting file.

Performance & Storage

FeatureRuVectorPineconeQdrantMilvusChromaDBWeaviate
Latency (p50)61 us~2 ms~1 ms~5 ms~50 ms~5 ms
Memory (1M vectors)200 MB*2 GB1.5 GB1 GB3 GB1.5 GB
SIMD accelerationAVX-512, NEONPartialβœ…βœ…βŒPartial
Auto-compression2-32x adaptiveβŒβŒβœ…βŒPQ only
Temporal tensor compression4-10x reuse❌❌❌❌❌
Sparse vectors (BM25/TF-IDF)βœ…βœ…βœ…βœ…βŒβœ…

Search & Query

FeatureRuVectorPineconeQdrantMilvusChromaDBWeaviate
Vector similarity searchβœ… HNSWβœ…βœ… HNSWβœ… HNSWβœ…βœ… HNSW
Metadata filteringβœ…βœ…βœ…βœ…βœ…βœ…
Graph queries (Cypher)βœ… full engine❌❌❌❌❌
SPARQL/RDF (W3C 1.1)βœ…βŒβŒβŒβŒβŒ
Hyperedges (3+ node)βœ…βŒβŒβŒβŒβŒ
Hyperbolic embeddingsPoincare + Lorentz❌❌❌❌❌
Multi-tenancyβœ… collectionsβœ… namespacesβœ…βœ…βœ…βœ…

Self-Learning & AI β€” features unique to RuVector

FeatureRuVectorAll Others
GNN on HNSW β€” search improves from usageβœ… every query teaches the index❌ static index
SONA runtime adaptationβœ… LoRA + EWC++ auto-tuning❌ manual tuning
46 attention mechanismsFlash, linear, graph, hyperbolic, mincut-gated❌
Semantic routing (Tiny Dancer)FastGRNN neural agent routing❌
Sparse inference (PowerInfer-style)2-10x faster on edge devices❌
Domain expansionCross-domain transfer learning with bandits❌
Self-learning hooksQ-learning, neural patterns, HNSW memory❌
ReasoningBankTrajectory learning with verdict judgment❌

Local AI β€” no cloud APIs needed

FeatureRuVectorPineconeQdrantMilvusChromaDBWeaviate
Built-in LLM runtimeβœ… ruvllm (GGUF)❌❌❌❌❌
Hardware accelerationMetal, CUDA, ANE, WebGPUN/AN/AGPU indexingN/AN/A
Pre-trained modelsRuvLTRA (<10 ms)❌❌❌❌❌
Local ONNX embeddings8+ models, no API calls❌❌❌❌text2vec modules
MCP server for AI agentsβœ… mcp-gate❌❌❌❌❌

Graph Transformers β€” verified graph neural network modules

FeatureRuVectorAll Others
Proof-gated mutationEvery write requires a formal proof β€” bugs cannot corrupt❌
Sublinear attentionO(n log n) via LSH, PPR, spectral sparsification❌
Physics-informed layersHamiltonian dynamics, energy conserved by construction❌
Biological layersSpiking, Hebbian/STDP, dendritic branching❌
Manifold geometryProduct manifolds S^n x H^m x R^k❌
Temporal-causal layersGranger causality, continuous-time ODE❌
Economic layersNash equilibrium, Shapley attribution❌
Verified trainingCertificates, delta-apply rollback, fail-closed❌

Math & Solvers

FeatureRuVectorPineconeQdrantMilvusChromaDBWeaviate
Sublinear solvers (8 algorithms)O(log n) to O(sqrt(n))❌❌❌❌❌
Dynamic min-cutn^0.12 complexity❌❌❌❌❌
Optimal transport distancesWasserstein, Sinkhorn, KL❌❌❌❌❌
Topological data analysisPersistent homology, Betti numbers❌❌❌❌❌
Coherence measurementPrime Radiant sheaf Laplacian❌❌❌❌❌
Quantum error correctionruQu dynamic min-cut❌❌❌❌❌

Distributed Systems

FeatureRuVectorPineconeQdrantMilvusChromaDBWeaviate
Raft consensusβœ…βŒ managedβœ…βŒβŒβœ…
Multi-master replicationβœ… vector clocksβŒβŒβœ…βŒβœ…
Auto-shardingβœ… consistent hashingβœ… managedβœ…βœ…βŒβœ…
Delta consensus (CRDT)βœ… causal ordering❌❌❌❌❌
Burst scaling (10-50x)βœ…βœ… managedβŒβœ…βŒβŒ
Snapshots / backupsβœ…βœ…βœ…βœ…βŒβœ…
Streaming APIβœ…βœ…βœ…βœ…βŒβœ…

Cognitive Containers (RVF) β€” single-file deployment unique to RuVector

FeatureRuVectorAll Others
Self-booting microservice.rvf file boots in 125 ms with Linux kernel❌ requires server setup
eBPF accelerationXDP, socket filter, TC kernel data path❌
COW branchingGit-like β€” 1M vectors, 100 edits = ~2.5 MB branch❌ copy everything
Witness chainsTamper-evident hash-linked audit trail❌ manual logging
Post-quantum signaturesML-DSA-65, SLH-DSA-128s, Ed25519❌
25 segment typesVEC, INDEX, KERNEL, EBPF, WASM, COW_MAP, and 19 more❌

Platform & Deployment

FeatureRuVectorPineconeQdrantMilvusChromaDBWeaviate
Browser / WASMβœ… WebGPU, 58 KB❌❌❌❌❌
Edge standaloneβœ… rvLite❌❌❌❌❌
Node.js nativeβœ… NAPI-RS❌Client onlyClient onlyβœ…Client only
PostgreSQL extensionβœ… 230+ SQL functions❌❌❌❌❌
iOS App Clipβœ… QR β†’ RVF in <15 MB❌❌❌❌❌
Cloud deploymentCloud Run, KubernetesManaged onlyDocker, K8sDocker, K8sDockerDocker, K8s
FPGA accelerationβœ…βŒβŒβŒβŒβŒ
Prometheus metricsβœ… built-inDashboardβœ…βœ…βŒβœ…

Specialized Applications

FeatureRuVectorAll Others
Genomics (rvDNA)Variant calling, k-mer search in 12 ms, browser WASM❌
Neural tradingKelly Criterion + LSTM-Transformer prediction❌
Scientific OCR (SciPix)LaTeX/MathML extraction from papers❌
Spiking neural networksNeuromorphic computing, BTSP learning❌
Bio-inspired nervous system5-layer adaptive system with EWC plasticity❌
DAG workflowsSelf-learning directed graph execution❌
Cognitum GateCognitive AI gateway with TileZero acceleration❌

Licensing & Cost

RuVectorPineconeQdrantMilvusChromaDBWeaviate
LicenseMIT (free forever)ProprietaryApache 2.0Apache 2.0Apache 2.0BSD-3
Self-hostedβœ…βŒ managed onlyβœ…βœ…βœ…βœ…
Pricing modelFreePer-vector/queryFree + CloudFree + managedFree + CloudFree + Cloud

* Memory with PQ8 compression. Benchmarks on Apple M2 / Intel i7.

Features

Everything RuVector can do β€” organized by category. Vector search, graph queries, LLM inference, distributed systems, deployment targets, and the self-learning stack that ties it all together.

⚑ Core Features & Capabilities

Core Capabilities

FeatureWhat It DoesWhy It Matters
Vector SearchHNSW index, <0.5ms latency, SIMD accelerationFast enough for real-time apps
Cypher QueriesMATCH, WHERE, CREATE, RETURNFamiliar Neo4j syntax
GNN LayersNeural network on index topologySearch improves with usage
HyperedgesConnect 3+ nodes at onceModel complex relationships
Metadata FilteringFilter vectors by propertiesCombine semantic + structured search
CollectionsNamespace isolation, multi-tenancyOrganize vectors by project/user
Hyperbolic HNSWPoincarΓ© ball indexing for hierarchiesBetter tree/taxonomy embeddings
Sparse VectorsBM25/TF-IDF hybrid searchCombine keyword + semantic

LLM Runtime

FeatureWhat It DoesWhy It Matters
ruvllmLocal LLM inference with GGUF modelsRun AI without cloud APIs
Metal/CUDA/ANEHardware acceleration on Mac/NVIDIA/Apple10-50x faster inference
ruvllm-wasmBrowser WASM runtime: KV cache, HNSW router, MicroLoRA, SONA, chat templates (435 KB)npm
RuvLTRA ModelsPre-trained GGUF for routing & embeddings<10ms inference β†’ HuggingFace
Streaming TokensReal-time token generationResponsive chat UX
QuantizationQ4, Q5, Q8 model supportRun 7B models in 4GB RAM
Ο€-Quantization (ADR-090)2-bit weights via Ο€-transform + Hadamard rotation + QAT-STE10 GB/s dequantization, 16x memory reduction
MoE Memory-Aware Routing (ADR-092)Cache-aware expert selection with EMA affinity tracking70%+ cache hit rate, <10Β΅s routing latency
npm install @ruvector/ruvllm        # Node.js
npm install @ruvector/ruvllm-wasm   # Browser (WASM)
cargo add ruvllm                    # Rust

Platform & Edge

FeatureWhat It DoesWhy It Matters
RVF Cognitive ContainerSingle .rvf file: store, boot, branch, proveReplaces Docker + DB + audit system
rvLiteStandalone 2MB edge databaseIoT, mobile, embedded
PostgreSQL Extension77+ SQL functions, pgvector replacementDrop-in upgrade for existing DBs
MCP ServerModel Context Protocol integrationAI assistant tool calling
WASM/BrowserFull client-side vector searchOffline-first apps
Node.js BindingsNative napi-rs, zero-copyNo serialization overhead
HTTP/gRPC ServerREST API with streamingEasy microservice integration
cargo install rvf-cli                    # RVF CLI (17 commands)
cargo add rvf-runtime                    # RVF Rust library
npm install @ruvector/rvf                # RVF TypeScript SDK
docker pull ruvnet/ruvector-postgres     # PostgreSQL
npm install rvlite                       # Edge DB
npx ruvector mcp start                   # MCP Server

Distributed Systems

FeatureWhat It DoesWhy It Matters
Raft ConsensusLeader election, log replicationStrong consistency for metadata
Auto-ShardingConsistent hashing, shard migrationScale to billions of vectors
Multi-Master ReplicationWrite to any node, conflict resolutionHigh availability, no SPOF
SnapshotsPoint-in-time backups, incrementalDisaster recovery
Cluster MetricsPrometheus-compatible monitoringObservability at scale
Burst Scaling10-50x capacity for traffic spikesHandle viral moments
cargo add ruvector-raft ruvector-cluster ruvector-replication

AI & ML

FeatureWhat It DoesWhy It Matters
Tensor Compressionf32β†’f16β†’PQ8β†’PQ4β†’Binary2-32x memory reduction
INT8 CNN Quantization (ADR-091)Quantized Conv2D/Linear/Pooling with SIMD kernels4x memory reduction, 2x faster CNN inference
Differentiable SearchSoft attention k-NNEnd-to-end trainable
Semantic RouterRoute queries to optimal endpointsMulti-model AI orchestration
Hybrid RoutingKeyword-first + embedding fallback90% accuracy for agent routing
Tiny DancerFastGRNN neural inferenceOptimize LLM inference costs
Adaptive RoutingLearn optimal routing strategiesMinimize latency, maximize accuracy
SONATwo-tier LoRA + EWC++ + ReasoningBankRuntime learning without retraining
Local Embeddings8+ ONNX models built-inNo external API needed
Verified Proofs82-byte proof attestations per vector opStructural trust, not just assertions
Graph Transformers8 proof-gated modules: physics, bio, manifold, temporal, economicEvery graph mutation is mathematically verified

Specialized Processing

FeatureWhat It DoesWhy It Matters
SciPix OCRLaTeX/MathML from scientific docsIndex research papers
DAG WorkflowsSelf-learning directed acyclic graphsComplex pipeline orchestration
Cognitum GateCognitive AI gateway + TileZeroUnified AI model routing
FPGA TransformerHardware-accelerated inferenceUltra-low latency serving
ruQu QuantumQuantum error correction via min-cutFuture-proof algorithms
Mincut-Gated TransformerDynamic attention via graph optimization50% compute reduction
Sparse InferenceEfficient sparse matrix operations10x faster for sparse data
Sublinear Solver8 sparse algorithms, O(log n)Powers coherence, GNN, spectral

Self-Learning & Adaptation

FeatureWhat It DoesWhy It Matters
Self-Learning HooksQ-learning + neural patterns + HNSWSystem improves automatically
ReasoningBankTrajectory learning with verdict judgmentLearn from successes/failures
Economy SystemTokenomics, CRDT-based distributed stateIncentivize agent behavior
Nervous SystemEvent-driven reactive architectureReal-time adaptation
Agentic SynthesisMulti-agent workflow compositionEmergent problem solving
EWC++Elastic weight consolidationPrevent catastrophic forgetting
npx @ruvector/cli hooks init      # Install self-learning hooks
npx @ruvector/cli hooks install   # Configure for Claude Code

Attention Mechanisms (@ruvector/attention)

FeatureWhat It DoesWhy It Matters
46 MechanismsDot-product, multi-head, flash, linear, sparse, cross-attention, CGT sheafCover all transformer and GNN use cases
Graph AttentionRoPE, edge-featured, local-global, neighborhoodPurpose-built for graph neural networks
Hyperbolic AttentionPoincarΓ© ball operations, curved-space mathBetter embeddings for hierarchical data
SIMD OptimizedNative Rust with AVX2/NEON acceleration2-10x faster than pure JS
Streaming & CachingChunk-based processing, KV-cacheConstant memory, 10x faster inference

Documentation: Attention Module Docs

Core Attention Mechanisms

Standard attention layers for sequence modeling and transformers.

MechanismComplexityMemoryBest For
DotProductAttentionO(nΒ²)O(nΒ²)Basic attention for small-medium sequences
MultiHeadAttentionO(nΒ²Β·h)O(nΒ²Β·h)BERT, GPT-style transformers
FlashAttentionO(nΒ²)O(n)Long sequences with limited GPU memory
LinearAttentionO(nΒ·d)O(nΒ·d)8K+ token sequences, real-time streaming
HyperbolicAttentionO(nΒ²)O(nΒ²)Tree-like data: taxonomies, org charts
MoEAttentionO(nΒ·k)O(nΒ·k)Large models with sparse expert routing

Graph Attention Mechanisms

Attention layers designed for graph-structured data and GNNs.

MechanismComplexityBest For
GraphRoPeAttentionO(nΒ²)Position-aware graph transformers
EdgeFeaturedAttentionO(nΒ²Β·e)Molecules, knowledge graphs with edge data
DualSpaceAttentionO(nΒ²)Hybrid flat + hierarchical embeddings
LocalGlobalAttentionO(nΒ·k + n)100K+ node graphs, scalable GNNs

Specialized Mechanisms

Task-specific attention variants for efficiency and multi-modal learning.

MechanismTypeBest For
SparseAttentionEfficiencyLong docs, low-memory inference
CrossAttentionMulti-modalImage-text, encoder-decoder models
NeighborhoodAttentionGraphLocal message passing in GNNs
HierarchicalAttentionStructureMulti-level docs (section β†’ paragraph)
CGTSheafAttentionCoherenceConsistency-gated graph transformers

Hyperbolic Math Functions

Operations for PoincarΓ© ball embeddingsβ€”curved space that naturally represents hierarchies.

FunctionDescriptionUse Case
expMap(v, c)Map to hyperbolic spaceInitialize embeddings
logMap(p, c)Map to flat spaceCompute gradients
mobiusAddition(x, y, c)Add vectors in curved spaceAggregate features
poincareDistance(x, y, c)Measure hyperbolic distanceCompute similarity
projectToPoincareBall(p, c)Ensure valid coordinatesPrevent numerical errors

Async & Batch Operations

Utilities for high-throughput inference and training optimization.

OperationDescriptionPerformance
asyncBatchCompute()Process batches in parallel3-5x faster
streamingAttention()Process in chunksFixed memory usage
HardNegativeMinerFind hard training examplesBetter contrastive learning
AttentionCacheCache key-value pairs10x faster inference
# Install attention module
npm install @ruvector/attention

# CLI commands
npx ruvector attention list                    # List all 39 mechanisms
npx ruvector attention info flash              # Details on FlashAttention
npx ruvector attention benchmark               # Performance comparison
npx ruvector attention compute -t dot -d 128   # Run attention computation
npx ruvector attention hyperbolic -a distance -v "[0.1,0.2]" -b "[0.3,0.4]"

Coherence Gate (prime-radiant)

FeatureWhat It DoesWhy It Matters
Sheaf LaplacianMeasures consistency via E(S) = Ξ£ wβ‚‘ Β· ‖ρᡀ(xα΅€) - ρα΅₯(xα΅₯)β€–Β²Mathematical proof of coherence
Compute LadderReflex (<1ms) β†’ Retrieval (~10ms) β†’ Heavy (~100ms) β†’ HumanRoute by confidence level
LLM Hallucination GateBlock incoherent responses with witnessesRefuse generation when math says contradiction
GPU/SIMD Accelerationwgpu + AVX-512/NEON + vec4 WGSL kernels4-16x speedup on coherence checks
Governance AuditBlake3 hash chain, cryptographic witnessesEvery decision is provable

Coherence vs Confidence

Traditional AIPrime-Radiant
"I'm 85% confident""Zero contradictions found"
Can be confidently wrongKnows when it doesn't know
Guesses about the futureProves consistency right now
Trust the modelTrust the math

Compute Ladder Routing

EnergyLaneLatencyAction
< 0.1Reflex< 1msImmediate approval
0.1-0.4Retrieval~10msFetch more evidence
0.4-0.7Heavy~100msDeep analysis
> 0.7HumanasyncEscalate to review
# Install coherence engine
cargo add prime-radiant

# With GPU acceleration
cargo add prime-radiant --features gpu,simd

Deployment

Run RuVector wherever your application lives β€” as a server, a PostgreSQL extension, a browser library, an edge database, or a self-booting container.

πŸš€ Deployment Options
FeatureWhat It DoesWhy It Matters
HTTP/gRPC ServerREST API, streaming supportEasy integration
WASM/BrowserFull client-side supportRun AI search offline
Node.js BindingsNative napi-rs bindingsNo serialization overhead
FFI BindingsC-compatible interfaceUse from Python, Go, etc.
CLI ToolsBenchmarking, testing, managementDevOps-friendly

Performance

Real numbers from real benchmarks β€” measured on Apple M4 Pro (48GB RAM) with Criterion.rs statistical sampling.

πŸ“ˆ Performance Benchmarks

Vector Search (HNSW)

ConfigurationQPSp50 Latencyp99 LatencyRecallDataset
Single-threaded3941.80ms1.84ms100%50K vectors, 384D
Multi-threaded (16)3,5972.86ms8.47ms100%50K vectors, 384D
Optimized (SIMD)1,2160.78ms0.78ms100%10K vectors, 384D
Python baseline7711.88ms11.88ms100%10K vectors, 384D
Brute force1277.76ms77.76ms100%10K vectors, 384D

15.7x faster than Python β€” 100% recall at every configuration.

Search kp50 LatencyThroughput
k=118.9Β΅s53K QPS
k=1025.2Β΅s40K QPS
k=10077.9Β΅s13K QPS

SIMD Distance Calculations (NEON)

Metric128D384D768D1536D
Euclidean14.9ns (67M/s)55.3ns (18M/s)115.3ns (8.7M/s)279.6ns (3.6M/s)
Cosine16.4ns (61M/s)60.4ns (17M/s)128.8ns (7.8M/s)302.9ns (3.3M/s)
Dot Product12.0ns (83M/s)52.7ns (19M/s)112.2ns (8.9M/s)292.3ns (3.4M/s)

SIMD speedup: 2.9x (Euclidean/Dot Product), 5.95x (Cosine).

Quantization

ModeCompressionEncode (384D)Distance (384D)Memory per 1M vectors
None (f32)1xβ€”55.3ns1.46 GB
Scalar (INT8)4x213ns31ns366 MB
INT48xβ€”β€”183 MB
Binary32x208ns0.9ns46 MB

Binary quantization: sub-nanosecond distance calculations.

Insert Throughput

OperationLatencyThroughput
Single insert (384D)4.63ms216/s
Batch 10034.1ms2,928/s
Batch 50072.8ms6,865/s
Batch 1000152.0ms6,580/s

Batch inserts: 30x faster than single inserts.

LLM Inference (ruvllm)

OperationConfigurationLatencyvs Target
Flash Attention256 seq840Β΅s2.4x better than 2ms target
RMSNorm4096 dim620ns16x better than 10Β΅s target
GEMV4096x40961.36ms3.7x better than 5ms target
MicroLoRA forwardrank=2, 4096 dim8.56Β΅s (scalar) / 2.61Β΅s (SIMD)117x–383x better than 1ms target
RoPE128 dim, 32 tokens1.33Β΅s9.6x better than 50Β΅s target
GEMV Scaling (M4 Pro)ThreadsSpeedup
11.0x
43.4x
86.1x
1012.7x

ef_search Tuning

ef_searchQPSp50 LatencyRecall
506741.35ms100%
1005961.37ms100%
2005721.40ms100%
4004341.97ms100%
8004341.77ms100%

100% recall across all ef_search values β€” choose speed vs safety margin.

Cloud Scale (Production)

MetricValue
Concurrent Streams500M baseline, burst to 25B (50x)
Global Latencyp50 <10ms, p99 <50ms
Availability99.99% SLA across 15 regions
Throughput per Region100K+ QPS
Memory Efficiency2-32x adaptive compression
Index Build1M vectors/min (parallel HNSW)
Replication Lag<100ms (multi-master async)

Full results: bench_results/ | docs/benchmarks/ | Run: cargo bench -p ruvector-core

Compression

RuVector automatically manages memory like a CPU cache β€” hot data stays at full precision, cold data compresses in the background. No manual tuning required.

πŸ—œοΈ Adaptive Compression Tiers

The architecture adapts to your data. Hot paths get full precision and maximum compute. Cold paths compress automatically and throttle resources. Recent data stays crystal clear; historical data optimizes itself in the background.

Think of it like your computer's memory hierarchyβ€”frequently accessed data lives in fast cache, while older files move to slower, denser storage. RuVector does this automatically for your vectors:

Access FrequencyFormatCompressionWhat Happens
Hot (>80%)f321xFull precision, instant retrieval
Warm (40-80%)f162xSlight compression, imperceptible latency
Cool (10-40%)PQ88xSmart quantization, ~1ms overhead
Cold (1-10%)PQ416xHeavy compression, still fast search
Archive (<1%)Binary32xMaximum density, batch retrieval

No configuration needed. RuVector tracks access patterns and automatically promotes/demotes vectors between tiers. Your hot data stays fast; your cold data shrinks.

Use Cases

From AI-powered search to genomics, from real-time recommendations to knowledge graphs β€” see what people are building with RuVector.

AI & LLM Applications

Use CaseWhat RuVector DoesExample
RAG PipelinesLocal vector search + local LLM β€” zero cloud costs, search improves from every queryexamples/ruvLLM
AI Agent MemoryGNN-backed HNSW memory that agents share and learn from across sessionsAgentic-Flow
Agent RoutingSemantic router with SONA self-learning picks the right agent in <1msClaude-Flow
Self-Learning ChatbotsReasoningBank + EWC++ β€” learns from conversations without forgetting previous onesexamples/meta-cognition
// RAG with local LLM β€” zero cloud costs, search gets smarter over time
const db = new RuVector({ dimensions: 384 });
const llm = new RuvLLM({ model: 'ruvltra-small-0.5b-q4_k_m.gguf' });

const context = await db.search(questionEmbedding, { k: 5 }); // GNN-enhanced
const response = await llm.generate(`Context: ${context}\n\nQ: ${question}`);

Search & Discovery

Use CaseWhat RuVector DoesExample
Semantic SearchSub-millisecond HNSW with SIMD acceleration β€” 80K QPS on 8 coresCore feature
Hybrid SearchBM25 keywords + vector embeddings in one query, GNN rerankingdocs/api
Image / Audio / VideoAny embedding model works β€” CLIP, Whisper, CLAP β€” with metadata filteringexamples/wasm-react
Code SearchLocal ONNX embeddings + graph queries find semantically similar codeexamples/nodejs
E-commerceProduct search with price/category filters applied during search, not afterCore feature
// Hybrid search: keyword + semantic with filtering
const results = await db.search(query, {
  k: 10,
  filter: { category: 'electronics', price: { $lt: 500 } },
  hybridAlpha: 0.7,  // 70% semantic, 30% keyword
  rerank: true       // GNN-enhanced reranking
});

Recommendations & Knowledge Graphs

Use CaseWhat RuVector DoesExample
Product RecommendationsNeo4j-compatible Cypher queries with GNN scoring β€” no separate graph DBexamples/graph
Knowledge GraphsHypergraph with Cypher + W3C SPARQL 1.1, hyperedge relationshipsdocs/api/CYPHER_REFERENCE.md
Document Q&AChunking, embeddings, RAG pipeline β€” all local, all self-improvingexamples/refrag-pipeline
Research DiscoveryCitation graph traversal, concept linking, multi-hop reasoningexamples/scipix
Content PersonalizationUser embeddings + collaborative filtering adapt in real timeReal-time adaptation
-- Neo4j-style graph query β€” runs inside RuVector, no separate database
MATCH (user:User {id: $userId})-[:VIEWED]->(item:Product)
MATCH (item)-[:SIMILAR_TO]->(rec:Product)
WHERE NOT (user)-[:PURCHASED]->(rec)
RETURN rec ORDER BY rec.gnn_score DESC LIMIT 10

Edge, Browser & IoT

Use CaseWhat RuVector DoesExample
Browser AIFull LLM + vector search in WASM β€” no server, runs in any browserexamples/wasm-vanilla
IoT / Sensors2MB footprint, no_std support, offline-first with sync on reconnectexamples/edge
Mobile AppsEmbed as a library β€” offline search, on-device learningexamples/edge-net
Streaming DataReal-time indexing with dynamic min-cut for live data feedsexamples/neural-trader
// Full AI in the browser β€” no server required
import init, { ChatTemplateWasm, ChatMessageWasm, HnswRouterWasm, healthCheck } from '@ruvector/ruvllm-wasm';
await init();
console.log(healthCheck()); // true

// Format prompts for any model
const template = ChatTemplateWasm.detectFromModelId("meta-llama/Llama-3-8B");
const prompt = template.format([
  ChatMessageWasm.system("You are a helpful assistant."),
  ChatMessageWasm.user("Explain quantum computing"),
]);

// Route queries to the best agent in <1ms
const router = new HnswRouterWasm(384, 1000);
router.addPattern(embedding, "quantum-expert", "physics queries");
const result = router.route(queryEmbedding);
console.log(result.name, result.score); // "quantum-expert" 0.95

Self-Learning & Fine-Tuning

Use CaseWhat RuVector DoesExample
Per-Request AdaptationMicroLoRA adapts model weights in <1ms based on user feedbackdocs/ruvllm/FINE_TUNING.md
Contrastive TrainingTriplet loss with hard negative mining β€” learns what's similar and what isn'tnpm/packages/ruvllm
Memory PreservationEWC++ prevents catastrophic forgetting β€” learns new things without losing old onescrates/sona
Task-Specific Adapters5 built-in adapters (Coder, Researcher, Security, Architect, Reviewer)docs/training
Browser Fine-TuningMicroLoRA in WASM β€” <50KB adapters persist to localStoragecrates/ruvllm-wasm
TierHow It WorksSpeed
InstantMicroLoRA (rank 1-2) per request<1ms
BackgroundAdapter merge + EWC++ consolidation~100ms
DeepFull training pipelineMinutes

AI Safety & Coherence

Use CaseWhat RuVector DoesExample
Agent Safety Gates256-tile WASM fabric β€” Permit / Defer / Deny decisions in <1mscrates/cognitum-gate
Cryptographic AuditHash-chained witness receipts β€” tamper-proof record of every AI actioncrates/rvf-crypto
Coherence CheckingMin-cut aggregation detects when AI agents drift from intended behaviorexamples/mincut
Post-Quantum SecurityML-DSA-65, SLH-DSA-128s, Ed25519 signatures on every operationcrates/rvf-crypto

Neuromorphic & Scientific Computing

Use CaseWhat RuVector DoesExample
Spiking Neural NetworksLIF neurons with STDP learning β€” 10-50x more energy efficient than ANNsexamples/meta-cognition
Neuromorphic Searchmicro-hnsw: brain-inspired vector search in 11.8KB WASMcrates/micro-hnsw
Algorithmic TradingNeural Trader with time-series analysis and real-time decision makingexamples/neural-trader
Quantum ComputingruQu quantum circuit simulation with min-cut coherencecrates/ruQu
GenomicsDNA sequence similarity, variant calling, population analysisexamples/dna
Graph Transformers8 verified modules β€” physics, bio, manifold, temporal, economic, and morecrates/ruvector-graph-transformer

Shared Brain at Ο€.ruv.io

FeatureWhat It DoesAccess
Semantic SearchHybrid ranking β€” keyword + cosine + graph + AGI scoring layersnpx ruvector brain search "query"
SONA Learning3-tier hierarchical pattern learning across sessionsnpx ruvector brain agi sona
GWT AttentionGlobal Workspace Theory competition for search rankingnpx ruvector brain agi status
Temporal DeltaKnowledge evolution velocity and trend trackingnpx ruvector brain agi temporal
Meta-LearningThompson Sampling with curiosity/regret explorationnpx ruvector brain agi explore
Midstream PlatformNanosecond scheduler, Lyapunov attractors, strange-loop meta-cognitionnpx ruvector midstream status
103 MCP ToolsFull brain + AGI + midstream diagnostics for Claude Code agentsnpx ruvector mcp start

Distributed & Enterprise

Use CaseWhat RuVector DoesExample
PostgreSQL Drop-In230+ SQL functions β€” replace pgvector with self-learning searchcrates/ruvector-postgres
Multi-Region HARaft consensus, multi-master replication, automatic failoverdocs/cloud-architecture
Burst Scaling10-50x auto-scaling with quorum writes and load balancingexamples/google-cloud
Cognitive ContainersSingle .rvf file boots as a microservice in 125ms β€” data + code + lineagecrates/rvf
-- Drop-in PostgreSQL replacement with self-improving search
CREATE EXTENSION ruvector;
CREATE TABLE documents (id SERIAL PRIMARY KEY, content TEXT, embedding VECTOR(384));
CREATE INDEX ON documents USING hnsw_gnn (embedding);

SELECT * FROM documents ORDER BY embedding <-> query_vector LIMIT 10;

Agentic Workflows

Use CaseWhat RuVector DoesExample
Version Control for AIAgentic Jujutsu β€” branch, merge, and diff AI model statesexamples/agentic-jujutsu
Self-Learning PipelinesDAG workflows that learn optimal execution paths over timecrates/ruvector-dag
Web Scraping β†’ EmbeddingsApify integration β€” scrape, embed, and index in one pipelineexamples/apify
Synthetic DataAgentic synthesis and generation for training dataAgentic-Flow

Installation

RuVector runs on Node.js, Rust, browsers, PostgreSQL, and Docker. Pick the package that fits your stack.

PlatformCommand
npmnpm install ruvector
npm (SONA)npm install @ruvector/sona
npm (Genomics)npm install @ruvector/rvdna
npm (RVF)npm install @ruvector/rvf
Browser/WASMnpm install ruvector-wasm
Rustcargo add ruvector-core ruvector-graph ruvector-gnn
Rust (RVF)cargo add rvf-runtime
Rust (Genomics)cargo add rvdna
Rust (SONA)cargo add ruvector-sona
Rust (LLM)cargo add ruvllm
RVF CLIcargo install rvf-cli
RVF MCPnpx @ruvector/rvf-mcp-server --transport stdio

Package Reference

πŸ“– Documentation

Getting Started

TopicLink
Getting Starteddocs/guides/GETTING_STARTED.md
API Referencedocs/api/
Cypher Referencedocs/api/CYPHER_REFERENCE.md
Performance Tuningdocs/optimization/PERFORMANCE_TUNING_GUIDE.md

Core Components

TopicLink
GNN Architecturedocs/gnn/
HNSW Indexingdocs/hnsw/
DAG Systemdocs/dag/
Nervous Systemdocs/nervous-system/
Sparse Inferencedocs/sparse-inference/

Bindings & Integration

TopicLink
Node.js APIcrates/ruvector-gnn-node/README.md
WASM APIcrates/ruvector-gnn-wasm/README.md
PostgreSQLdocs/postgres/
Self-Learning Hooksdocs/hooks/
Integration Guidesdocs/integration/

LLM & AI

TopicLink
RuvLLMdocs/ruvllm/
Training Guidesdocs/training/

Operations

TopicLink
Architecturedocs/architecture/
Cloud Deploymentdocs/cloud-architecture/
Securitydocs/security/
Benchmarksdocs/benchmarks/
Testingdocs/testing/

Research

TopicLink
Research Papersdocs/research/
GNN V2 Featuresdocs/research/gnn-v2/
Min-Cut Algorithmsdocs/research/mincut/
SPARQL Supportdocs/research/sparql/
Latent Spacedocs/research/latent-space/

Architecture Decision Records (ADRs)

ADRStatusDescription
ADR-001AcceptedCore architecture design
ADR-002AcceptedRuvLLM integration
ADR-003AcceptedSIMD optimization strategy
ADR-004AcceptedKV cache management
ADR-005AcceptedWASM runtime integration
ADR-006AcceptedMemory management
ADR-007AcceptedSecurity review
ADR-008NewMistral-rs backend integration
ADR-009NewStructured output (SOTA)
ADR-010NewFunction calling (SOTA)
ADR-011NewPrefix caching (SOTA)
ADR-012NewSecurity remediation
ADR-013NewHuggingFace publishing
ADR-030AcceptedRVF cognitive container architecture
ADR-031AcceptedRVCOW branching & real containers
ADR-045AcceptedLean-agentic formal verification integration
πŸ“¦ npm Packages (49+ Packages)

Core Packages

PackageDescriptionVersionDownloads
ruvectorAll-in-one CLI & packagenpmdownloads
@ruvector/coreCore vector database with HNSWnpmdownloads
@ruvector/nodeUnified Node.js bindingsnpmdownloads
ruvector-extensionsAdvanced features: embeddings, UInpmdownloads
@ruvector/rabitq-wasm1-bit quantized vector index in WASMnpmdownloads
@ruvector/acorn-wasmFiltered HNSW (ACORN) in WASMnpmdownloads

Graph & GNN

PackageDescriptionVersionDownloads
@ruvector/gnnGraph Neural Network layersnpmdownloads
@ruvector/graph-nodeHypergraph with Cypher queriesnpmdownloads
@ruvector/graph-wasmBrowser graph queriesnpmdownloads
@ruvector/graph-data-generatorAI-powered synthetic graph datanpmdownloads

AI Routing & Attention

PackageDescriptionVersionDownloads
@ruvector/tiny-dancerFastGRNN neural routingnpmdownloads
@ruvector/routerSemantic router + HNSWnpmdownloads
@ruvector/attention46 attention mechanismsnpmdownloads

Learning & Neural

PackageDescriptionVersionDownloads
@ruvector/sonaSelf-Optimizing Neural Architecturenpmdownloads
@ruvector/spiking-neuralSpiking neural networks (SNN)npmdownloads

LLM Runtime

PackageDescriptionVersionDownloads
@ruvector/ruvllmLLM orchestration + SONAnpmdownloads
@ruvector/ruvllm-cliLLM CLI: inference, benchmarksnpmdownloads
@ruvector/ruvllm-wasmBrowser LLM inferencenpmdownloads

Distributed Systems

PackageDescriptionVersionDownloads
@ruvector/clusterDistributed clusteringnpmdownloads
@ruvector/serverHTTP/gRPC servernpmdownloads
@ruvector/raftRaft consensusnpmdownloads
@ruvector/replicationMulti-master replicationnpmdownloads
@ruvector/burst-scaling10-50x burst scalingnpmdownloads

Edge & Standalone

PackageDescriptionVersionDownloads
rvliteSQLite-style edge DBnpmdownloads
@ruvector/rudagSelf-learning DAGnpmdownloads

Genomics & Health

PackageDescriptionVersionDownloads
@ruvector/rvdnaAI-native genomic analysis + .rvdna formatnpmdownloads

RVF Cognitive Containers

PackageDescriptionVersionDownloads
@ruvector/rvfUnified TypeScript SDKnpmdownloads
@ruvector/rvf-nodeNode.js N-API native bindingsnpmdownloads
@ruvector/rvf-wasmWASM browser packagenpmdownloads
@ruvector/rvf-mcp-serverMCP server for AI agentsnpmdownloads

Agentic & Synthetic Data

PackageDescriptionVersionDownloads
@ruvector/agentic-synthAI synthetic data generatornpmdownloads
@ruvector/agentic-integrationDistributed agent coordinationnpmdownloads
@cognitum/gateAI coherence gatenpmdownloads

CLI Tools

PackageDescriptionVersionDownloads
@ruvector/cliCLI + self-learning hooksnpmdownloads
@ruvector/postgres-cliPostgreSQL extension CLInpmdownloads
@ruvector/scipixScientific OCR clientnpmdownloads

WASM Packages

PackageDescriptionVersionDownloads
@ruvector/wasmUnified WASM meta-packagenpmdownloads
@ruvector/wasm-unifiedUnified TypeScript APInpmdownloads
@ruvector/gnn-wasmGNN WASM bindingsnpmdownloads
@ruvector/attention-wasmAttention WASM bindingsnpmdownloads
@ruvector/attention-unified-wasmAll 46 attention mechanismsnpmdownloads
@ruvector/tiny-dancer-wasmAI routing WASMnpmdownloads
@ruvector/router-wasmSemantic router WASMnpmdownloads
@ruvector/learning-wasmLearning module WASMnpmdownloads
@ruvector/economy-wasmTokenomics WASMnpmdownloads
@ruvector/exotic-wasmExotic features WASMnpmdownloads
@ruvector/nervous-system-wasmNervous system WASMnpmdownloads
ruvector-attention-wasmWASM attention (Flash, MoE, Hyperbolic, CGT Sheaf)npmdownloads
πŸ¦€ Rust Crates (87 Packages)

All crates are published to crates.io under the ruvector-* and rvf-* namespaces.

Core Crates

CrateDescriptioncrates.io
ruvector-coreVector database engine with HNSW indexingcrates.io
ruvector-collectionsCollection and namespace managementcrates.io
ruvector-filterVector filtering and metadata queriescrates.io
ruvector-metricsPerformance metrics and monitoringcrates.io
ruvector-snapshotSnapshot and persistence managementcrates.io
ruvector-nodeNode.js bindings via NAPI-RScrates.io
ruvector-wasmWASM bindings for browser/edgecrates.io
ruvector-cliCLI and MCP servercrates.io
ruvector-benchBenchmarking suitecrates.io

Graph & GNN

CrateDescriptioncrates.io
ruvector-graphHypergraph database with Neo4j-style Cyphercrates.io
ruvector-graph-nodeNode.js bindings for graph operationscrates.io
ruvector-graph-wasmWASM bindings for browser graph queriescrates.io
ruvector-gnnGraph Neural Network layers and trainingcrates.io
ruvector-gnn-nodeNode.js bindings for GNN inferencecrates.io
ruvector-gnn-wasmWASM bindings for browser GNNcrates.io

Attention Mechanisms

CrateDescriptioncrates.io
ruvector-attention50+ attention mechanisms (FlashAttention-3, MLA, Mamba SSM, KV-cache, speculative decoding, MoE, Graph)crates.io
ruvector-attention-nodeNode.js bindings for attention mechanismscrates.io
ruvector-attention-wasmWASM bindings for browser attentioncrates.io
ruvector-attention-cliCLI for attention testing and benchmarkingcrates.io

LLM Runtime (ruvllm)

CrateDescriptioncrates.io
ruvllmLLM serving runtime with SONA, paged attention, KV cache, BitNetcrates.io
ruvllm-cliCLI for model inference and benchmarkingcrates.io
ruvllm-wasmWASM bindings for browser LLM inferencecrates.io

Features: Candle backend, Metal/CUDA acceleration, Apple Neural Engine, GGUF support, SONA learning, BitNet 1.58-bit quantization (TL1 kernels, AVX2/WASM).

cargo add ruvllm --features inference-metal  # Mac with Metal
cargo add ruvllm --features inference-cuda   # NVIDIA GPU

RuvLTRA Models β€” Pre-trained GGUF models optimized for Claude Code workflows:

ModelSizeUse CaseLink
ruvltra-claude-code-0.5b-q4_k_m398 MBAgent routingHuggingFace
ruvltra-small-0.5b-q4_k_m398 MBEmbeddingsHuggingFace
ruvltra-medium-1.1b-q4_k_m800 MBClassificationHuggingFace
# Download and use
wget https://huggingface.co/ruv/ruvltra/resolve/main/ruvltra-small-0.5b-q4_k_m.gguf

Distributed Systems

CrateDescriptioncrates.io
ruvector-clusterCluster management and coordinationcrates.io
ruvector-raftRaft consensus implementationcrates.io
ruvector-replicationData replication and synchronizationcrates.io
ruvector-serverREST/gRPC API servercrates.io

AI Agent Routing (Tiny Dancer)

CrateDescriptioncrates.io
ruvector-tiny-dancer-coreFastGRNN neural inference for AI routingcrates.io
ruvector-tiny-dancer-nodeNode.js bindings for AI routingcrates.io
ruvector-tiny-dancer-wasmWASM bindings for browser AI routingcrates.io

Router (Semantic Routing)

CrateDescriptioncrates.io
ruvector-router-coreCore semantic routing enginecrates.io
ruvector-router-cliCLI for router testing and benchmarkingcrates.io
ruvector-router-ffiFFI bindings for other languagescrates.io
ruvector-router-wasmWASM bindings for browser routingcrates.io

Hybrid Routing achieves 90% accuracy for agent routing using keyword-first strategy with embedding fallback. See Issue #122 for benchmarks and the training tutorials for fine-tuning guides.

Neural Trader

CrateDescriptioncrates.io
neural-trader-coreMarket event types, ingest pipeline, graph schemapublish = false
neural-trader-coherenceMinCut coherence gate with CUSUM drift detectionpublish = false
neural-trader-replayReservoir replay store with proof-gated writespublish = false
neural-trader-wasmWASM bindings for browser coherence gates & replaypublish = false

Six-layer pipeline treating the limit order book as a dynamic heterogeneous typed graph. See ADR-085 for architecture, ADR-086 for WASM bindings.

Dynamic Min-Cut (December 2025 Breakthrough)

CrateDescriptioncrates.io
ruvector-mincutSubpolynomial fully-dynamic min-cut (arXiv:2512.13105)crates.io
ruvector-mincut-nodeNode.js bindings for min-cutcrates.io
ruvector-mincut-wasmWASM bindings for browser min-cutcrates.io

First deterministic exact fully-dynamic min-cut with verified n^0.12 subpolynomial update scaling:

  • Brain connectivity β€” Detect Alzheimer's markers by tracking neural pathway changes in milliseconds
  • Network resilience β€” Predict outages before they happen, route around failures instantly
  • AI agent coordination β€” Find communication bottlenecks in multi-agent systems
  • Neural network pruning β€” Identify which connections can be removed without losing accuracy
  • 448+ tests, 256-core parallel optimization, 8KB per core (compile-time verified)
use ruvector_mincut::{DynamicMinCut, Graph};

let mut graph = Graph::new();
graph.add_edge(0, 1, 10.0);
graph.add_edge(1, 2, 5.0);

let mincut = DynamicMinCut::new(&graph);
let (value, cut_edges) = mincut.compute();
// Updates in subpolynomial time as edges change

Quantum Coherence (ruQu)

CrateDescriptioncrates.io
ruquClassical nervous system for quantum machines - coherence via min-cutcrates.io
cognitum-gate-kernelAnytime-valid coherence gate kernelcrates.io
cognitum-gate-tilezeroTileZero arbiter for coherence decisionscrates.io
mcp-gateMCP server for coherence gate integrationcrates.io
prime-radiantUniversal coherence engine - sheaf Laplacian AI safety & hallucination detectioncrates.io

ruQu Features: Real-time quantum coherence assessment, MWPM decoder integration, mincut-gated attention (50% FLOPs reduction).

use ruqu::{CoherenceGate, SyndromeFilter};

let gate = CoherenceGate::new();
let syndrome = gate.assess_coherence(&quantum_state)?;

Advanced Math & Inference

CrateDescriptioncrates.io
ruvector-mathCore math utilities, SIMD operationscrates.io
ruvector-math-wasmWASM bindings for math operationscrates.io
ruvector-sparse-inferenceSparse tensor inference enginecrates.io
ruvector-sparse-inference-wasmWASM bindings for sparse inferencecrates.io
ruvector-hyperbolic-hnswHNSW in hyperbolic space (PoincarΓ©/Lorentz)crates.io
ruvector-hyperbolic-hnsw-wasmWASM bindings for hyperbolic HNSWcrates.io
ruvector-ditherDeterministic golden-ratio and pi-digit dithering for quantization (no_std)crates.io

FPGA & Hardware Acceleration

CrateDescriptioncrates.io
ruvector-fpga-transformerFPGA-optimized transformer inferencecrates.io
ruvector-fpga-transformer-wasmWASM simulation of FPGA transformercrates.io
ruvector-mincut-gated-transformerMinCut-gated attention for 50% compute reductioncrates.io
ruvector-mincut-gated-transformer-wasmWASM bindings for mincut-gated transformercrates.io

Neuromorphic & Bio-Inspired Learning

CrateDescriptioncrates.io
ruvector-nervous-systemSpiking neural networks with BTSP learning & EWC plasticitycrates.io
ruvector-nervous-system-wasmWASM bindings for neuromorphic learningcrates.io
ruvector-learning-wasmMicroLoRA adaptation (<100Β΅s latency)crates.io
ruvector-economy-wasmCRDT-based autonomous credit economycrates.io
ruvector-exotic-wasmExotic AI primitives (strange loops, time crystals)crates.io
ruvector-attention-unified-wasmUnified 18+ attention mechanisms (Neural, DAG, Mamba SSM)crates.io
micro-hnsw-wasmNeuromorphic HNSW with spiking neurons (11.8KB WASM)crates.io
thermorustThermodynamic neural motif engine β€” Ising/soft-spin Hamiltonians, Langevin dynamics, Landauer dissipationcrates.io

Bio-inspired features:

  • Spiking Neural Networks (SNNs) β€” 10-50x energy efficiency vs traditional ANNs
  • BTSP Learning β€” Behavioral Time-Scale Synaptic Plasticity for rapid adaptation
  • MicroLoRA β€” Sub-microsecond fine-tuning for per-operator learning
  • Mamba SSM β€” State Space Model attention for linear-time sequences

Cognitive Robotics

Perception, planning, behavior trees, and swarm coordination for autonomous robots
CrateDescriptioncrates.io
ruvector-roboticsCognitive robotics platform β€” perception, A* planning, behavior trees, swarm coordinationcrates.io

Modules:

ModuleWhat It Does
bridgeOccupancyGrid, PointCloud, SensorFrame, SceneGraph data types with spatial kNN
perceptionScene-graph construction from point clouds, obstacle detection pipeline
planningA* grid search (octile heuristic) and potential-field velocity commands
cognitivePerceive-think-act-learn loop with utility-based reasoning
domain_expansionCross-domain transfer learning via Meta Thompson Sampling and Beta priors

Key features: 290 tests, clippy-clean, no_std-friendly types, optional domain-expansion feature flag for cross-domain transfer, pluggable PotentialFieldConfig for obstacle avoidance, Byzantine-tolerant swarm coordination via ruvector-domain-expansion.

use ruvector_robotics::planning::{astar, potential_field, PotentialFieldConfig};
use ruvector_robotics::bridge::OccupancyGrid;

let grid = OccupancyGrid::new(100, 100, 0.1);
let path = astar(&grid, (5, 5), (90, 90))?;
let cmd = potential_field(&[0.0, 0.0, 0.0], &[5.0, 3.0, 0.0], &[], &PotentialFieldConfig::default());

Self-Learning (SONA)

CrateDescriptioncrates.io
sonaSelf-Optimizing Neural Architecture - LoRA, EWC++, ReasoningBankcrates.io

SONA Features: Two-tier LoRA adaptation, Elastic Weight Consolidation (EWC++), ReasoningBank for trajectory learning, runtime-adaptive learning for LLM routers.

Genomics & Health (rvDNA)

CrateDescriptioncrates.io
rvdnaAI-native genomic analysis β€” variant calling, protein translation, HNSW k-mer search, .rvdna formatcrates.io

rvDNA Features: 12 ms full pipeline on 5 real human genes, Bayesian variant calling (155 ns/SNP), Horvath epigenetic clock, CYP2D6 pharmacogenomics, .rvdna binary format with pre-computed AI features, WASM support for browser-based diagnostics. Full README

RVF Cognitive Containers

CrateDescriptioncrates.io
rvf-types20 segment headers, COW/membership/delta types (no_std)crates.io
rvf-wireWire format read/write (no_std)crates.io
rvf-manifestTwo-level manifest, FileIdentity, COW pointerscrates.io
rvf-quantScalar, product, binary quantizationcrates.io
rvf-indexHNSW progressive indexing (Layer A/B/C)crates.io
rvf-cryptoSHAKE-256, Ed25519, witness chains, attestationcrates.io
rvf-runtimeFull store API, COW engine, compactioncrates.io
rvf-kernelLinux kernel builder, initramfs, Docker pipelinecrates.io
rvf-ebpfReal BPF programs (XDP, socket filter, TC)crates.io
rvf-federationFederated transfer learning β€” PII stripping, differential privacy, FedAvg/FedProxcrates.io
rvf-launchQEMU microvm launcher, KVM/TCGcrates.io
rvf-serverHTTP REST + TCP streaming servercrates.io
rvf-importJSON, CSV, NumPy importerscrates.io
rvf-cliUnified CLI with 17 subcommandscrates.io

RVF Features: Single-file cognitive containers that boot as Linux microservices, COW branching at cluster granularity, eBPF acceleration, witness chains, post-quantum signatures, federated transfer learning with differential privacy, 28 segment types. Full README

Formal Verification

CrateDescriptioncrates.io
ruvector-verifiedProof-carrying vector operations with lean-agentic dependent types (~500ns proofs)crates.io
ruvector-verified-wasmWASM bindings for browser/edge formal verificationcrates.io

Verification Features: 82-byte proof attestations, 3-tier gated proof routing (Reflex <10ns / Standard <1us / Deep <100us), FastTermArena with O(1) dedup, batch dimension verification (~11ns/vector), type-safe pipeline composition. Full README

Formal Verification Details

How it works: Every vector operation produces a machine-checked proof term using lean-agentic dependent types. Proofs are constructed at compile-time semantics but execute at runtime with sub-microsecond overhead, then serialized into 82-byte attestations that can be embedded in RVF witness chains.

OperationLatencyDescription
ProofEnvironment::new()~470nsInitialize proof context with type declarations
prove_dim_eq(a, b)~496nsDimension equality proof with FxHash caching
verify_batch_dimensions()~11ns/vecBatch verification for N vectors
compose_chain()~1.2usType-safe pipeline composition
create_attestation()~180ns82-byte formal proof witness
FastTermArena::intern()~1.6ns hitO(1) dedup with 4-wide linear probe
gated::route_proof()<10ns3-tier routing: Reflex / Standard / Deep

10 Exotic Application Domains (examples/verified-applications):

  1. Autonomous Weapons Filter β€” certified targeting pipeline blocks tampered sensors
  2. Medical Diagnostics β€” proof-carrying ECG analysis with patient-keyed attestations
  3. Financial Order Routing β€” verified trade execution with proof-hash audit trail
  4. Multi-Agent Contracts β€” dimension + metric + depth contracts enforced by proof
  5. Distributed Sensor Swarm β€” coherence verification across heterogeneous nodes
  6. Quantization Proof β€” certify quantization error within formal tolerance bounds
  7. Verifiable Synthetic Memory β€” AGI memory with per-embedding proof attestations
  8. Cryptographic Vector Signatures β€” model-keyed signatures with contract matching
  9. Simulation Integrity β€” proof receipt per step for reproducible physics
  10. Legal Forensics β€” court-admissible replay bundles with structural invariants
use ruvector_verified::{ProofEnvironment, vector_types, proof_store};

let mut env = ProofEnvironment::new();
let proof = vector_types::prove_dim_eq(&mut env, 384, 384).unwrap();
let att = proof_store::create_attestation(&env, proof);
assert_eq!(att.to_bytes().len(), 82); // 82-byte formal witness

Self-booting example β€” the claude_code_appliance builds a complete AI dev environment as one file:

cd examples/rvf && cargo run --example claude_code_appliance

Final file: 5.1 MB single .rvf β€” boots Linux, serves queries, runs Claude Code. One file. Boots on QEMU/Firecracker. Runs SSH. Serves vectors. Installs Claude Code. Proves every step with a cryptographic witness chain.

Graph Transformer

Crates.io

CrateDescriptionRegistry
ruvector-graph-transformerUnified graph transformer with proof-gated mutation substrate (8 modules, 186 tests)crates.io
ruvector-graph-transformer-wasmWASM bindings for browser-side graph transformerscrates.io
ruvector-graph-transformer-nodeNode.js NAPI-RS bindings (22+ methods, 20 tests)npm

What it does: Every time you modify a graph β€” adding a node, changing an edge weight, updating a vector β€” the graph transformer requires a formal proof that the operation is valid before it executes. Think of it like a type system for graph mutations: you can't accidentally corrupt your data because the system mathematically verifies every change.

On top of that proof layer, 8 specialized modules handle different aspects of graph intelligence:

ModuleWhat It Does (Plain English)Feature Flag
Proof-Gated MutationLocks graph data behind mathematical proofs β€” no proof, no accessalways on
Sublinear AttentionFinds the most important nodes without checking every single one β€” scales to millionssublinear
Physics-InformedApplies physics equations (conservation of energy, symmetry) to message passingphysics
BiologicalModels neurons that only fire when excited enough β€” naturally sparse, energy-efficientbiological
Self-OrganizingGraphs that grow and reorganize themselves like biological developmentself-organizing
Verified TrainingTraining with a receipt β€” if a gradient step would break an invariant, it's automatically rolled backverified-training
ManifoldOperates in curved spaces (like the surface of a sphere) instead of just flat Euclidean spacemanifold
Temporal-CausalEnforces that information flows forward in time β€” no peeking at the futuretemporal
EconomicUses game theory to allocate attention fairly β€” Nash equilibrium for node importanceeconomic
# Rust
cargo add ruvector-graph-transformer --features full

# Node.js
npm install @ruvector/graph-transformer
use ruvector_graph_transformer::sublinear_attention::SublinearGraphAttention;
use ruvector_graph_transformer::config::SublinearConfig;

let attn = SublinearGraphAttention::new(128, SublinearConfig::default());
let outputs = attn.lsh_attention(&features).unwrap(); // O(n log n)
const { GraphTransformer } = require('@ruvector/graph-transformer');
const gt = new GraphTransformer();

// Every operation produces a proof receipt
const proof = gt.proveDimension(128, 128);
const attestation = gt.createAttestation(proof.proof_id); // 82 bytes
Graph Transformer Architecture Details

Proof-gated mutation means state_n -> proof(invariant) -> mutation -> state_n+1. The ProofGate<T> type wraps any value so you literally cannot access the inner data without first producing a valid proof. This is enforced at the type level in Rust and at runtime in WASM/Node.js.

Sublinear attention uses three strategies: (1) locality-sensitive hashing groups similar nodes into buckets, (2) personalized PageRank samples the most relevant neighbors via random walks, (3) spectral sparsification prunes edges that don't contribute to graph connectivity. All three reduce O(n^2) full attention to O(n log n).

Verified training uses a delta-apply architecture: gradients go to a scratch buffer first, invariants are checked against the proposed weights (loss stability, weight norms, Lipschitz bounds, energy gates), and only if all checks pass are the weights committed. If any check fails and fail_closed = true, the step is rejected and the old weights are preserved. Every successful step produces a TrainingCertificate with BLAKE3 hashes of weights, config, and dataset manifest.

10 ADRs document every design decision: ADR-046 through ADR-055.

Personal AI Memory (OSpipe)

npm npm

PackageDescriptionRegistry
ospipeRuVector-enhanced personal AI memory for Screenpipecrates.io
@ruvector/ospipeTypeScript SDK with retry, timeout, and AbortSignalnpm
@ruvector/ospipe-wasmWASM bindings for browser deployment (145 KB)npm
npm install @ruvector/ospipe         # TypeScript SDK
npm install @ruvector/ospipe-wasm    # Browser WASM
cargo add ospipe                     # Rust crate

Replaces Screenpipe's SQLite/FTS5 backend with semantic vector search. Ask your computer what you saw, heard, and did -- with semantic understanding.

OSpipe Features & Capabilities
FeatureDescription
HNSW Vector Search61us p50 query latency via ruvector-core
Knowledge GraphEntity extraction (persons, URLs, emails, mentions) via ruvector-graph
Attention RerankingContent prioritization via ruvector-attention
Quantum DiversityMMR + quantum-inspired result selection via ruqu-algorithms
GNN LearningSearch quality improves over time via ruvector-gnn
PII Safety GateAuto-redacts credit cards, SSNs, emails before storage
Frame DeduplicationCosine similarity sliding window eliminates near-duplicates
Query RouterAuto-routes to Semantic, Keyword, Graph, Temporal, or Hybrid backend
4-Tier Quantizationf32 -> int8 -> product -> binary (97% memory savings over time)
REST APIAxum server with /v2/search, /v2/route, /v2/stats, /v2/health
WASM SupportRuns in browser (145 KB), bundles from 11.8 KB (micro) to 350 KB (full)
Cross-PlatformNative: Linux, macOS, Windows; WASM: any browser

Comparison: Screenpipe vs OSpipe

Screenpipe (FTS5)OSpipe (RuVector)
SearchKeyword (FTS5)Semantic + Keyword + Graph + Temporal
Latency~1ms (FTS5)61us (HNSW p50)
RelationsNoneKnowledge Graph (Cypher)
PIIBasicCredit card, SSN, email redaction
DedupNoneCosine similarity sliding window
BrowserNoneWASM (11.8 KB - 350 KB)
QuantizationNone4-tier age-based (f32 -> binary)

Integrates 10 RuVector crates: ruvector-core, ruvector-filter, ruvector-cluster, ruvector-delta-core, ruvector-router-core, cognitum-gate-kernel, ruvector-graph, ruvector-attention, ruvector-gnn, ruqu-algorithms.

use ospipe::config::OsPipeConfig;
use ospipe::pipeline::ingestion::IngestionPipeline;
use ospipe::capture::CapturedFrame;

let config = OsPipeConfig::default();
let mut pipeline = IngestionPipeline::new(config)?;

// Ingest a screen capture
let frame = CapturedFrame::new_screen("Firefox", "Meeting Notes", "auth discussion: JWT with refresh tokens", 0);
pipeline.ingest(frame)?;

// Semantic search
let results = pipeline.search("what was the authentication discussion?", 5)?;

See OSpipe README for full documentation, TypeScript/WASM quickstart, and configuration reference.

Standalone Edge Database (rvLite)

CrateDescriptioncrates.io
rvliteStandalone 2MB edge database with SQL, SPARQL, Cyphercrates.io

rvLite Features: Powered by RuVector WASM, supports SQL/SPARQL/Cypher queries, ideal for IoT, mobile, and embedded systems.

PostgreSQL Extension

CrateDescriptioncrates.io
ruvector-postgrespgvector replacement with 230+ SQL functions, SIMD, Flash Attentioncrates.io

PostgreSQL Features: Drop-in pgvector replacement, GNN layers, hybrid search, multi-tenancy, self-healing, self-learning capabilities.

docker pull ruvnet/ruvector-postgres    # Docker image
cargo add ruvector-postgres             # Rust crate

Self-Learning Query DAG (ruvector-dag)

CrateDescriptioncrates.io
ruvector-dagNeural self-learning DAG for automatic query optimizationcrates.io
ruvector-dag-wasmWASM bindings for browser DAG optimization (58KB gzipped)crates.io

Make your queries faster automatically. RuVector DAG learns from every query execution and continuously optimizes performanceβ€”no manual tuning required.

  • 7 Attention Mechanisms: Automatically selects the best strategy (Topological, Causal Cone, Critical Path, MinCut Gated, etc.)
  • SONA Learning: Self-Optimizing Neural Architecture adapts in <100ΞΌs per query
  • MinCut Control: Rising "tension" triggers automatic strategy switching and predictive healing
  • 50-80% Latency Reduction: Queries improve over time without code changes
use ruvector_dag::{QueryDag, OperatorNode};
use ruvector_dag::attention::{AttentionSelector, SelectionPolicy};

let mut dag = QueryDag::new();
let scan = dag.add_node(OperatorNode::hnsw_scan(0, "vectors_idx", 64));
let filter = dag.add_node(OperatorNode::filter(1, "score > 0.5"));
dag.add_edge(scan, filter).unwrap();

// System learns which attention mechanism works best
let selector = AttentionSelector::new();
let scores = selector.select_and_apply(SelectionPolicy::Adaptive, &dag)?;

See ruvector-dag README for full documentation.

Temporal Tensor Store

CrateDescriptioncrates.io
ruvector-temporal-tensorTime-series tensor storage with tiered quantizationcrates.io
ruvector-temporal-tensor-wasmWASM bindings for browser temporal tensorscrates.io

High-performance temporal embedding storage optimized for AI agent memory systems:

FeatureDescription
Block-Based Storage4KB aligned blocks with SIMD-optimized I/O (ADR-018)
Tiered QuantizationF32 β†’ F16 β†’ INT8 β†’ INT4 with <1% accuracy loss (ADR-019)
Temporal ScoringAccess frequency + recency decay for automatic tier migration (ADR-020)
Delta Compression60-80% storage reduction via temporal differencing (ADR-021)
Cross-Platform WASMUnified API for browser, Node.js, and edge (ADR-022)
AgentDB IntegrationNative coherence scoring and memory persistence

Performance Targets: >100K writes/sec, <1ms p99 read latency, 4-32x compression (ADR-023)

See Domain-Driven Design for architecture details.

Delta Behavior (Behavioral Change Tracking)

CrateDescriptioncrates.io
ruvector-delta-coreCore delta types and traits for behavioral vector change trackingcrates.io
ruvector-delta-graphDelta operations for graph structures β€” edge and node changescrates.io
ruvector-delta-indexDelta-aware HNSW index with incremental updates and repaircrates.io
ruvector-delta-consensusDistributed delta consensus using CRDTs and causal orderingcrates.io
ruvector-delta-wasmWASM bindings for delta operations on vectorscrates.io

Delta Behavior tracks how vectors change over time β€” the mathematics of systems that refuse to collapse. Incremental HNSW updates without full rebuilds, CRDT-based distributed consensus, and causal ordering for conflict-free replication.

Profiling & Diagnostics

CrateDescriptioncrates.io
profilingReal-time coherence assessment via dynamic min-cutcrates.io

CRV Signal Line Protocol

CrateDescriptioncrates.io
ruvector-crv6-stage CRV signal line methodology for vector searchcrates.io

Maps CRV stages to ruvector subsystems:

  • Stage I (Ideograms) β†’ PoincarΓ© ball hyperbolic embeddings
  • Stage II (Sensory) β†’ Multi-head attention vectors
  • Stage III (Dimensional) β†’ GNN graph topology
  • Stage IV (Emotional) β†’ SNN temporal encoding
  • Stage V (Interrogation) β†’ Differentiable search
  • Stage VI (3D Model) β†’ MinCut partitioning

Quantum Simulation Engine (ruQu)

npm

CrateDescriptioncrates.io
ruqu-coreState-vector simulator with SIMD, noise modelscrates.io
ruqu-algorithmsVQE, Grover's search, QAOA MaxCut, Surface Code QECcrates.io
ruqu-exoticQuantum-classical hybrids: decay, interference, syndromecrates.io
ruqu-wasmWebAssembly bindings (npm: @ruvector/ruqu-wasm)crates.io
npm install @ruvector/ruqu-wasm    # Browser/Node.js
cargo add ruqu-core                # Rust

Pure Rust quantum simulation with 25-qubit WASM support:

FeatureDescription
State-Vector SimulatorComplex128 amplitudes, SIMD acceleration (QE-001)
VQE AlgorithmVariational Quantum Eigensolver for chemistry (QE-005)
Grover's SearchQuadratic speedup for unstructured search (QE-006)
QAOA MaxCutQuantum approximate optimization (QE-007)
Surface Code QECTopological error correction (QE-008)
MinCut CoherenceQuantum-classical integration via dynamic min-cut (QE-012)
use ruqu_core::{QuantumState, Gate, Circuit};

let mut circuit = Circuit::new(3);
circuit.add_gate(Gate::H, 0);           // Hadamard
circuit.add_gate(Gate::CNOT, 0, 1);     // Entangle
circuit.add_gate(Gate::CNOT, 1, 2);     // GHZ state

let state = circuit.execute()?;
let result = state.measure_all();        // Collapse to |000⟩ or |111⟩

See Quantum Engine ADRs for full documentation.

Distributed Systems (Raft & Replication)

CrateDescriptioncrates.io
ruvector-raftRaft consensus with leader election & log replicationcrates.io
ruvector-replicationMulti-master replication with vector clockscrates.io
ruvector-clusterCluster coordination and shardingcrates.io

Build distributed vector databases with strong consistency guarantees:

  • Raft Consensus β€” Leader election, log replication, automatic failover
  • Vector Clocks β€” Causal ordering for conflict detection
  • Conflict Resolution β€” Last-Write-Wins, custom merge functions, CRDT support
  • Change Data Capture β€” Stream changes to replicas in real-time
  • Automatic Failover β€” Promote replicas on primary failure
import { RaftNode, ReplicaSet, VectorClock } from '@ruvector/raft';
import { ReplicationManager, ConflictStrategy } from '@ruvector/replication';

// Raft consensus cluster
const node = new RaftNode({
  nodeId: 'node-1',
  peers: ['node-2', 'node-3'],
  electionTimeout: [150, 300],
});

await node.start();
const entry = await node.propose({ op: 'insert', vector: embedding });

// Multi-master replication
const replicaSet = new ReplicaSet();
replicaSet.addReplica('primary', 'localhost:5001', 'primary');
replicaSet.addReplica('replica-1', 'localhost:5002', 'replica');

const manager = new ReplicationManager(replicaSet, {
  conflictStrategy: ConflictStrategy.LastWriteWins,
  syncMode: 'async',
});

await manager.write('vectors', { id: 'v1', data: embedding });

See npm/packages/raft/README.md and npm/packages/replication/README.md for full documentation.

Standalone Vector Database (rvLite)

CrateDescriptioncrates.io
rvliteSQLite-style vector database for browsers & edgecrates.io

Runs anywhere JavaScript runs β€” browsers, Node.js, Deno, Bun, Cloudflare Workers, Vercel Edge:

  • SQL + SPARQL + Cypher unified query interface
  • Zero dependencies β€” thin orchestration over existing WASM crates
  • Self-learning via SONA ReasoningBank integration
import { RvLite } from '@rvlite/wasm';

const db = await RvLite.create();
await db.sql(`CREATE TABLE docs (id SERIAL, embedding VECTOR(384))`);
await db.sparql(`SELECT ?s WHERE { ?s rdf:type ex:Document }`);
await db.cypher(`MATCH (d:Doc)-[:SIMILAR]->(r) RETURN r`);

Self-Optimizing Neural Architecture (SONA)

CrateDescriptioncrates.ionpm
ruvector-sonaRuntime-adaptive learning with LoRA, EWC++, and ReasoningBankcrates.ionpm

SONA enables AI systems to continuously improve from user feedback without expensive retraining:

  • Two-tier LoRA: MicroLoRA (rank 1-2) for instant adaptation, BaseLoRA (rank 4-16) for long-term learning
  • EWC++: Elastic Weight Consolidation prevents catastrophic forgetting
  • ReasoningBank: K-means++ clustering stores and retrieves successful reasoning patterns
  • Lock-free Trajectories: ~50ns overhead per step with crossbeam ArrayQueue
  • Sub-millisecond Learning: <0.8ms per trajectory processing
# Rust
cargo add ruvector-sona

# Node.js
npm install @ruvector/sona
use ruvector_sona::{SonaEngine, SonaConfig};

let engine = SonaEngine::new(SonaConfig::default());
let traj_id = engine.start_trajectory(query_embedding);
engine.record_step(traj_id, node_id, 0.85, 150);
engine.end_trajectory(traj_id, 0.90);
engine.learn_from_feedback(LearningSignal::positive(50.0, 0.95));
// Node.js
const { SonaEngine } = require('@ruvector/sona');

const engine = new SonaEngine(256); // 256 hidden dimensions
const trajId = engine.beginTrajectory([0.1, 0.2, ...]);
engine.addTrajectoryStep(trajId, activations, attention, 0.9);
engine.endTrajectory(trajId, 0.95);

Platform Features

πŸ”€ Self-Learning DAG (Query Optimization)

crates.io npm

Make your queries faster automatically. RuVector DAG learns from every query execution and continuously optimizes performanceβ€”no manual tuning required.

What is RuVector DAG?

A self-learning query optimization systemβ€”like a "nervous system" for your database queries that:

  1. Watches how queries execute and identifies bottlenecks
  2. Learns which optimization strategies work best for different query patterns
  3. Adapts in real-time, switching strategies when conditions change
  4. Heals itself by detecting anomalies and fixing problems before they impact users

Unlike traditional query optimizers that use static rules, RuVector DAG learns from actual execution patterns and gets smarter over time.

Key Benefits

BenefitWhat It DoesResult
Automatic ImprovementQueries get faster without code changes50-80% latency reduction after learning
Zero-Downtime AdaptationAdapts to pattern changes automaticallyNo manual index rebuilds
Predictive PreventionDetects rising "tension" earlyIntervenes before slowdowns
Works EverywherePostgreSQL, Browser (58KB WASM), EmbeddedUniversal deployment

Use Cases

Use CaseWhy RuVector DAG Helps
Vector Search ApplicationsOptimize similarity searches that traditional databases struggle with
High-Traffic APIsAutomatically adapt to changing query patterns throughout the day
Real-Time AnalyticsLearn which aggregation paths are fastest for your specific data
Edge/Embedded Systems58KB WASM build runs in browsers and IoT devices
Multi-Tenant PlatformsLearn per-tenant query patterns without manual tuning

How It Works

Query comes in β†’ DAG analyzes execution plan β†’ Best attention mechanism selected
                                                          ↓
Query executes β†’ Results returned β†’ Learning system records what worked
                                                          ↓
                    Next similar query benefits from learned optimizations

The system maintains a MinCut tension score that acts as a health indicator. When tension rises, the system automatically switches to more aggressive optimization strategies and triggers predictive healing.

7 DAG Attention Mechanisms

MechanismWhen to UseTrigger
TopologicalDefault baselineLow variance
Causal ConeDownstream impact analysisWrite-heavy patterns
Critical PathLatency-bound queriesp99 > 2x p50
MinCut GatedBottleneck-aware weightingCut tension rising
Hierarchical LorentzDeep hierarchical queriesDepth > 10
Parallel BranchWide parallel executionBranch count > 3
Temporal BTSPTime-series workloadsTemporal patterns

Quick Start

Rust:

use ruvector_dag::{QueryDag, OperatorNode, OperatorType};
use ruvector_dag::attention::{TopologicalAttention, DagAttention};

// Build a query DAG
let mut dag = QueryDag::new();
let scan = dag.add_node(OperatorNode::hnsw_scan(0, "vectors_idx", 64));
let filter = dag.add_node(OperatorNode::filter(1, "score > 0.5"));
let result = dag.add_node(OperatorNode::new(2, OperatorType::Result));

dag.add_edge(scan, filter).unwrap();
dag.add_edge(filter, result).unwrap();

// Compute attention scores
let attention = TopologicalAttention::new(Default::default());
let scores = attention.forward(&dag).unwrap();

Node.js:

import { QueryDag, TopologicalAttention } from '@ruvector/rudag';

// Build DAG
const dag = new QueryDag();
const scan = dag.addNode({ type: 'hnsw_scan', table: 'vectors', k: 64 });
const filter = dag.addNode({ type: 'filter', condition: 'score > 0.5' });
dag.addEdge(scan, filter);

// Apply attention
const attention = new TopologicalAttention();
const scores = attention.forward(dag);
console.log('Attention scores:', scores);

Browser (WASM - 58KB):

<script type="module">
import init, { QueryDag, TopologicalAttention } from '@ruvector/rudag-wasm';

await init();
const dag = new QueryDag();
// ... same API as Node.js
</script>

SONA Learning Integration

SONA (Self-Optimizing Neural Architecture) runs post-query in background, never blocking execution:

use ruvector_dag::sona::{DagSonaEngine, SonaConfig};

let config = SonaConfig {
    embedding_dim: 256,
    lora_rank: 2,           // Rank-2 for <100ΞΌs updates
    ewc_lambda: 5000.0,     // Catastrophic forgetting prevention
    trajectory_capacity: 10_000,
};
let mut sona = DagSonaEngine::new(config);

// Pre-query: Get enhanced embedding (fast path)
let enhanced = sona.pre_query(&dag);

// Execute query...
let execution_time = execute_query(&dag);

// Post-query: Record trajectory (async, background)
sona.post_query(&dag, execution_time, baseline_time, "topological");

Self-Healing

Reactive (Z-score anomaly detection) + Predictive (rising MinCut tension triggers early intervention):

use ruvector_dag::healing::{HealingOrchestrator, AnomalyConfig, PredictiveConfig};

let mut orchestrator = HealingOrchestrator::new();

// Reactive: Z-score anomaly detection
orchestrator.add_detector("query_latency", AnomalyConfig {
    z_threshold: 3.0,
    window_size: 100,
    min_samples: 10,
});

// Predictive: Rising cut tension triggers early intervention
orchestrator.enable_predictive(PredictiveConfig {
    tension_threshold: 0.6,    // Intervene before 0.7 crisis
    variance_threshold: 1.5,   // Rising variance = trouble coming
    lookahead_window: 50,      // Predict 50 queries ahead
});

Query Convergence Example

A slow query converges over several runs:

[run 1] query: SELECT * FROM vectors WHERE embedding <-> \$1 < 0.5
        attention: topological (default)
        mincut_tension: 0.23
        latency: 847ms (improvement: 0.4%)

[run 4] mincut_tension: 0.71 > 0.7 (THRESHOLD)
        --> switching attention: topological -> mincut_gated
        latency: 412ms (improvement: 51.5%)

[run 10] attention: mincut_gated
         mincut_tension: 0.22 (stable)
         latency: 156ms (improvement: 81.6%)

Performance Targets

ComponentTargetNotes
Attention (100 nodes)<100ΞΌsAll 7 mechanisms
MicroLoRA adaptation<100ΞΌsRank-2, per-operator
Pattern search (10K)<2msK-means++ indexing
MinCut updateO(n^0.12)Subpolynomial amortized
Anomaly detection<50ΞΌsZ-score, streaming
WASM size58KBGzipped, browser-ready

Installation

# Rust
cargo add ruvector-dag

# Node.js
npm install @ruvector/rudag

# WASM (browser)
npm install @ruvector/rudag-wasm

Full Documentation: ruvector-dag README

πŸ“¦ rvLite - Standalone Edge Database

crates.io npm downloads

A complete vector database that runs anywhere JavaScript runs β€” browsers, Node.js, Deno, Bun, Cloudflare Workers, Vercel Edge Functions.

What is rvLite?

rvLite is a lightweight, standalone vector database that runs entirely in WebAssembly. It provides SQL, SPARQL, and Cypher query interfaces, along with graph neural networks and self-learning capabilitiesβ€”all in under 3MB.

Key Features

FeatureWhat It DoesWhy It Matters
SQL InterfaceFamiliar SELECT, INSERT, WHERENo learning curve
SPARQL SupportW3C-compliant RDF queriesKnowledge graphs in browser
Cypher QueriesNeo4j-style graph queriesGraph traversals anywhere
GNN EmbeddingsGraph neural network layersSelf-learning search
ReasoningBankTrajectory learningGets smarter over time
SIMD OptimizedVector operations acceleratedNative-like performance

Runs Everywhere

PlatformStatusUse Case
Browsersβœ…Offline-first apps
Node.jsβœ…Server-side
Denoβœ…Edge functions
Bunβœ…Fast runtime
Cloudflare Workersβœ…Edge computing
Vercel Edgeβœ…Serverless

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  RvLite (Orchestration)                 β”‚
β”‚  β”œβ”€ SQL executor                        β”‚
β”‚  β”œβ”€ SPARQL executor                     β”‚
β”‚  β”œβ”€ Cypher executor                     β”‚
β”‚  └─ Unified WASM API                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚ depends on (100% reuse)
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Existing WASM Crates                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β€’ ruvector-core (vectors, SIMD)         β”‚
β”‚  β€’ ruvector-graph-wasm (Cypher)          β”‚
β”‚  β€’ ruvector-gnn-wasm (GNN layers)        β”‚
β”‚  β€’ sona (ReasoningBank learning)         β”‚
β”‚  β€’ micro-hnsw-wasm (ultra-fast HNSW)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

import { RvLite } from '@ruvector/rvlite';

// Create database
const db = await RvLite.create();

// SQL with vector search
await db.sql(`
  CREATE TABLE docs (
    id SERIAL PRIMARY KEY,
    content TEXT,
    embedding VECTOR(384)
  )
`);

await db.sql(`
  SELECT id, content, embedding <=> \$1 AS distance
  FROM docs
  ORDER BY distance
  LIMIT 10
`, [queryVector]);

// Cypher graph queries
await db.cypher(`
  CREATE (a:Person {name: 'Alice'})-[:KNOWS]->(b:Person {name: 'Bob'})
`);

// SPARQL RDF queries
await db.sparql(`
  SELECT ?name WHERE {
    ?person foaf:name ?name .
  }
`);

// GNN embeddings
const embeddings = await db.gnn.computeEmbeddings('social_network', [
  db.gnn.createLayer('gcn', { inputDim: 128, outputDim: 64 })
]);

// Self-learning with ReasoningBank
await db.learning.recordTrajectory({ state: [0.1], action: 2, reward: 1.0 });
await db.learning.train({ algorithm: 'q-learning', iterations: 1000 });

Size Budget

ComponentSizePurpose
ruvector-core~500KBVectors, SIMD
SQL parser~200KBQuery parsing
SPARQL executor~300KBRDF queries
Cypher (graph-wasm)~600KBGraph queries
GNN layers~300KBNeural networks
ReasoningBank (sona)~300KBSelf-learning
Total~2.3MBGzipped

Installation

# npm
npm install @ruvector/rvlite

# Rust
cargo add rvlite

# Build WASM
wasm-pack build --target web --release

Full Documentation: rvlite README

🌐 Edge-Net - Collective AI Computing Network

npm

Share, Contribute, Compute Together β€” A distributed computing platform that enables collective resource sharing for AI workloads.

What is Edge-Net?

Edge-Net creates a collective computing network where participants share idle browser resources to power distributed AI workloads:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              EDGE-NET: COLLECTIVE AI COMPUTING NETWORK                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚   β”‚  Your       β”‚       β”‚  Collective β”‚       β”‚  AI Tasks   β”‚              β”‚
β”‚   β”‚  Browser    │◄─────►│  Network    │◄─────►│  Completed  β”‚              β”‚
β”‚   β”‚  (Idle CPU) β”‚  P2P  β”‚  (1000s)    β”‚       β”‚  for You    β”‚              β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚         β”‚                     β”‚                     β”‚                       β”‚
β”‚   Contribute ──────► Earn rUv Units ──────► Use for AI Workloads           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

How It Works

StepWhat HappensResult
1. ContributeShare unused CPU cycles when browsingHelp the network
2. EarnAccumulate rUv (Resource Utility Vouchers)Build credits
3. UseSpend rUv to run AI tasksAccess collective power
4. Network GrowsMore participants = more powerEveryone benefits

Why Collective AI Computing?

Traditional AICollective Edge-Net
Expensive GPU serversFree idle browser CPUs
Centralized data centersDistributed global network
Pay-per-use pricingContribution-based access
Single point of failureResilient P2P mesh
Limited by your hardwareScale with the collective

AI Intelligence Stack

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        AI INTELLIGENCE STACK                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    MicroLoRA Adapter Pool (from ruvLLM)              β”‚   β”‚
β”‚  β”‚  β€’ LRU-managed pool (16 slots) β€’ <50Β΅s rank-1 forward               β”‚   β”‚
β”‚  β”‚  β€’ 4-bit/8-bit quantization    β€’ 2,236+ ops/sec                     β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    SONA - Self-Optimizing Neural Architecture         β”‚   β”‚
β”‚  β”‚  β€’ Instant Loop: Per-request MicroLoRA adaptation                    β”‚   β”‚
β”‚  β”‚  β€’ Background Loop: Hourly K-means consolidation                     β”‚   β”‚
β”‚  β”‚  β€’ Deep Loop: Weekly EWC++ (prevents catastrophic forgetting)        β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   HNSW Vector Index  β”‚  β”‚  Federated Learning  β”‚  β”‚ ReasoningBank   β”‚  β”‚
β”‚  β”‚   β€’ 150x faster      β”‚  β”‚  β€’ Byzantine tolerantβ”‚  β”‚ β€’ Pattern learn β”‚  β”‚
β”‚  β”‚   β€’ O(log N) search  β”‚  β”‚  β€’ Diff privacy      β”‚  β”‚ β€’ 87x energy    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core AI Tasks

Task TypeUse CasePerformance
Vector SearchFind similar items150x speedup via HNSW
EmbeddingsText understandingSemantic vectors
Semantic MatchIntent detectionClassify meaning
LoRA InferenceTask adaptation<100Β΅s forward
Pattern LearningSelf-optimizationReasoningBank trajectories

Pi-Key Identity System

Ultra-compact cryptographic identity using mathematical constants:

Key TypeSizePurpose
Ο€ (Pi-Key)40 bytesPermanent identity
e (Session)34 bytesEncrypted sessions
Ο† (Genesis)21 bytesNetwork origin markers

Self-Optimizing Features

FeatureMechanismBenefit
Task RoutingMulti-head attentionWork goes to best nodes
Topology OptimizationSelf-organizing meshNetwork adapts to load
Q-Learning SecurityReinforcement learningLearns to defend threats
Economic BalancerUv token systemSelf-sustaining economy

Quick Start

Add to Your Website:

<script type="module">
  import init, { EdgeNetNode, EdgeNetConfig } from '@ruvector/edge-net';

  async function joinCollective() {
    await init();

    // Join the collective
    const node = new EdgeNetConfig('my-website')
      .cpuLimit(0.3)          // Contribute 30% CPU when idle
      .memoryLimit(256 * 1024 * 1024)  // 256MB max
      .respectBattery(true)   // Reduce on battery
      .build();

    node.start();

    // Monitor participation
    setInterval(() => {
      console.log(`Contributed: ${node.ruvBalance()} rUv`);
    }, 10000);
  }

  joinCollective();
</script>

Use the Collective's AI Power:

// Submit an AI task to the collective
const result = await node.submitTask('vector_search', {
  query: embeddings,
  k: 10,
  index: 'shared-knowledge-base'
}, 5);  // Spend up to 5 rUv

console.log('Similar items:', result);

Monitor Your Contribution:

const stats = node.getStats();
console.log(`
  rUv Earned: ${stats.ruv_earned}
  rUv Spent: ${stats.ruv_spent}
  Tasks Completed: ${stats.tasks_completed}
  Reputation: ${(stats.reputation * 100).toFixed(1)}%
`);

Key Features

FeatureBenefit
Idle CPU UtilizationUse resources that would otherwise be wasted
Browser-BasedNo installation, runs in any modern browser
Adjustable ContributionControl how much you share (10-50% CPU)
Battery AwareAutomatically reduces on battery power
Fair DistributionWork routed based on capability matching
Privacy-FirstPi-Key cryptographic identity
Federated LearningLearn collectively without sharing data
Byzantine ToleranceResilient to malicious nodes

Installation

# npm
npm install @ruvector/edge-net

# Or include directly
<script src="https://unpkg.com/@ruvector/edge-net"></script>

Full Documentation: edge-net README


AI & Machine Learning

🎲 Agentic-Synth - AI Synthetic Data Generation

npm downloads

AI-Powered Synthetic Data Generation at Scale β€” Generate unlimited, high-quality synthetic data for training AI models, testing systems, and building robust agentic applications.

Why Agentic-Synth?

ProblemSolution
Real data is expensive to collectGenerate unlimited synthetic data
Privacy-sensitive with compliance risksFully synthetic, no PII concerns
Slow to generate at scale10-100x faster than manual creation
Insufficient for edge casesCustomizable schemas for any scenario
Hard to reproduce across environmentsReproducible with seed values

Key Features

FeatureDescription
Multi-Model SupportGemini, OpenRouter, GPT, Claude, and 50+ models via DSPy.ts
Context Caching95%+ performance improvement with intelligent LRU cache
Smart Model RoutingAutomatic load balancing, failover, and cost optimization
DSPy.ts IntegrationSelf-learning optimization with 20-25% quality improvement
StreamingAsyncGenerator for real-time data flow
Memory Efficient<50MB for datasets up to 10K records

Data Generation Types

TypeUse Cases
Time-SeriesFinancial data, IoT sensors, metrics
EventsLogs, user actions, system events
StructuredJSON, CSV, databases, APIs
EmbeddingsVector data for RAG systems

Quick Start

# Install
npm install @ruvector/agentic-synth

# Or run instantly with npx
npx @ruvector/agentic-synth generate --count 100

# Interactive mode
npx @ruvector/agentic-synth interactive

Basic Usage

import { AgenticSynth } from '@ruvector/agentic-synth';

// Initialize with your preferred model
const synth = new AgenticSynth({
  model: 'gemini-pro',
  apiKey: process.env.GEMINI_API_KEY
});

// Generate structured data
const users = await synth.generate({
  schema: {
    name: 'string',
    email: 'email',
    age: 'number:18-65',
    role: ['admin', 'user', 'guest']
  },
  count: 1000
});

// Generate time-series data
const stockData = await synth.timeSeries({
  fields: ['open', 'high', 'low', 'close', 'volume'],
  interval: '1h',
  count: 500,
  volatility: 0.02
});

// Stream large datasets
for await (const batch of synth.stream({ count: 100000, batchSize: 1000 })) {
  await processData(batch);
}

Self-Learning with DSPy

import { AgenticSynth, DSPyOptimizer } from '@ruvector/agentic-synth';

// Enable self-learning optimization
const synth = new AgenticSynth({
  model: 'gemini-pro',
  optimizer: new DSPyOptimizer({
    learningRate: 0.1,
    qualityThreshold: 0.85
  })
});

// Quality improves automatically over time
const data = await synth.generate({
  schema: { ... },
  count: 1000,
  optimize: true  // Enable learning
});

console.log(`Quality score: ${data.metrics.quality}`);
// First run: 0.72
// After 100 runs: 0.94 (+25% improvement)

Performance

MetricValue
With caching98.2% faster
P99 latency2500ms β†’ 45ms
Memory<50MB for 10K records
Throughput1000+ records/sec

Ecosystem Integration

PackagePurpose
RuVectorNative vector database for RAG
DSPy.tsPrompt optimization
Agentic-JujutsuVersion-controlled generation

Installation

# npm
npm install @ruvector/agentic-synth

# Examples package (50+ production examples)
npm install @ruvector/agentic-synth-examples

Full Documentation: agentic-synth README

πŸ“ˆ Neural Trader - AI Trading System

npm downloads

Production-ready neural trading system combining state-of-the-art ML for automated trading, sports betting, and portfolio management. Zero external ML dependencies, sub-millisecond latency.

Core AI/ML Engines

EngineDescriptionPerformance
Fractional KellyOptimal position sizing with risk-adjusted bet scaling588,885 ops/s
LSTM-TransformerDeep learning price prediction (temporal + attention)1,468 seq/s
DRL PortfolioReinforcement learning ensemble (PPO/SAC/A2C)17,043 steps/s
Sentiment AlphaReal-time sentiment analysis for alpha generation3,764 pipeline/s

Why Neural Trader?

Traditional MLNeural Trader
TensorFlow/PyTorch requiredZero dependencies
1.2MB+ bundle size45KB bundle
2.1ms LSTM inference0.68ms inference
Complex deploymentWorks in browser & Node.js

Research-Backed Algorithms

AlgorithmResearch Finding
Kelly Criterion1/5th fractional achieves 98% ROI with 85% less risk of ruin
LSTM-TransformerTemporal + attention fusion outperforms single architectures
DRL EnsemblePPO/SAC/A2C voting reduces variance vs single agent
Sentiment Alpha3% annual excess returns documented in academia

Quick Start

import { KellyCriterion, HybridLSTMTransformer, DRLPortfolioManager } from 'neural-trader';

// Kelly position sizing
const kelly = new KellyCriterion();
const stake = kelly.calculateStake(9000, 0.55, 2.0, 0.2);  // 1/5th Kelly
// β†’ \$180 recommended stake (2% of bankroll)

// LSTM-Transformer prediction
const model = new HybridLSTMTransformer({
  lstm: { hiddenSize: 64, layers: 2 },
  transformer: { heads: 4, layers: 2 }
});
const prediction = model.predict(candles);
// β†’ { signal: 'BUY', confidence: 0.73, direction: 'bullish' }

// DRL portfolio allocation
const manager = new DRLPortfolioManager({ numAssets: 10 });
await manager.train(marketData, { episodes: 100 });
const allocation = manager.getAction(currentState);
// β†’ [0.15, 0.12, 0.08, ...] optimal weights

Use Cases

Use CaseExample
Stock TradingDAG-based pipeline with parallel execution
Sports BettingKelly sizing with ML calibration
Crypto TradingDRL portfolio for 20+ assets
News TradingReal-time sentiment stream processing
Portfolio RebalancingReinforcement learning allocation

Package Ecosystem (20+)

PackageDescription
neural-traderCore engine with native HNSW, SIMD
@neural-trader/coreUltra-low latency Rust + Node.js bindings
@neural-trader/strategiesStrategy management and backtesting
@neural-trader/executionTrade execution and order management
@neural-trader/mcpMCP server with 87+ trading tools
@neural-trader/riskVaR, stress testing, risk metrics
@neural-trader/portfolioMarkowitz, Risk Parity optimization
@neural-trader/neuralNeural network training
@neural-trader/brokersAlpaca, Interactive Brokers
@neural-trader/sports-bettingArbitrage, Kelly, odds analysis

CLI Interface

# Real-time trading
node cli.js run --strategy=hybrid --symbol=AAPL --capital=100000

# Backtest historical performance
node cli.js backtest --days=252 --capital=50000 --strategy=drl

# Paper trading simulation
node cli.js paper --capital=100000 --strategy=sentiment

# Performance benchmarks
node cli.js benchmark --iterations=100

Exotic Examples

ExampleDescription
Multi-Agent SwarmDistributed trading intelligence with consensus
GNN Correlation NetworkGraph neural network correlation analysis
Attention Regime DetectionTransformer-based market regime classification
Quantum PortfolioQAOA & quantum annealing optimization
Hyperbolic EmbeddingsPoincarΓ© disk market embeddings
Atomic ArbitrageCross-exchange with MEV protection

Performance

ModuleLatencyThroughputStatus
Kelly Engine0.014ms71,295/sβœ“ Ready
LSTM-Transformer0.681ms1,468/sβœ“ Ready
DRL Portfolio0.059ms17,043/sβœ“ Ready
Sentiment Alpha0.266ms3,764/sβœ“ Ready
Full Pipeline4.68ms214/sβœ“ Ready

Installation

# npm
npm install neural-trader

# Full ecosystem
npm install @neural-trader/core @neural-trader/strategies @neural-trader/mcp

Full Documentation: neural-trader README

πŸ₯‹ Agentic-Jujutsu - Quantum-Resistant Version Control

npm License

What is Agentic-Jujutsu?

Agentic-Jujutsu is a quantum-resistant, self-learning version control system designed for AI agents. It combines lock-free concurrent operations with ReasoningBank trajectory learning for continuous improvement.

Traditional GitAgentic-Jujutsu
Lock-based commitsLock-free (23x faster)
Manual conflict resolution87% automatic resolution
Static operationsSelf-learning from patterns
No quantum protectionSHA3-512 + HQC-128
Sequential agentsConcurrent multi-agent

Key Features

FeaturePerformanceDescription
Concurrent Commits350 ops/s23x faster than Git (15 ops/s)
Context Switching<100ms10x faster than Git (500-1000ms)
Conflict Resolution87% autoAI-powered pattern matching
Quantum Security<1ms verifySHA3-512 fingerprints, HQC-128 encryption
ReasoningBankContinuousTrajectory learning with verdicts

Quick Start

# Install
npm install agentic-jujutsu

# Basic usage
npx agentic-jujutsu
import { JjWrapper } from 'agentic-jujutsu';

const jj = new JjWrapper();

// Start learning trajectory
jj.startTrajectory('Implement feature X');

// Make changes and commit
await jj.newCommit('Add authentication module');
jj.addToTrajectory();

// Finalize with success score
jj.finalizeTrajectory(0.9, 'Feature implemented successfully');

// Get AI-powered suggestions
const suggestions = await jj.getSuggestions();

Multi-Agent Coordination

// Concurrent commits without locks
const agents = ['agent-1', 'agent-2', 'agent-3'];
await Promise.all(agents.map(agent =>
  jj.newCommit(`Changes from ${agent}`)
));
// All commits succeed - no lock waiting!

Full Documentation: agentic-jujutsu README

πŸ”¬ SciPix - Scientific Document OCR

crates.io docs.rs License

What is SciPix?

SciPix is a blazing-fast, memory-safe OCR engine written in pure Rust, purpose-built for scientific documents, mathematical equations, and technical diagrams.

FeatureSciPixTesseractMathpix
Simple Text OCR50ms120ms200ms*
Math Equation80msN/A150ms*
Batch (100 images)2.1s8.5sN/A
Memory Usage45MB180MBCloud
LaTeX OutputYesNoYes

*API latency, not processing time

Key Features

FeatureDescription
ONNX RuntimeGPU-accelerated with CUDA, TensorRT, CoreML
LaTeX OutputMathematical equation recognition with LaTeX, MathML, AsciiMath
SIMD Optimized4x faster image preprocessing with AVX2, SSE4, NEON
REST APIProduction-ready HTTP server with rate limiting
MCP ServerIntegrate with Claude, ChatGPT via Model Context Protocol
WebAssemblyRun OCR directly in browsers

Quick Start

# Add to Cargo.toml
cargo add ruvector-scipix

# With features
ruvector-scipix = { version = "0.1.16", features = ["ocr", "math", "optimize"] }
use ruvector_scipix::{SciPixOcr, OcrConfig};

// Initialize OCR engine
let ocr = SciPixOcr::new(OcrConfig::default())?;

// Process scientific image
let result = ocr.process_image("equation.png")?;
println!("LaTeX: {}", result.latex);
println!("Confidence: {:.2}%", result.confidence * 100.0);

Use Cases

  • Academic Paper Digitization - Extract text and equations from scanned research papers
  • Math Homework Assistance - Convert handwritten equations to LaTeX for AI tutoring
  • Technical Documentation - Process engineering diagrams and scientific charts
  • AI/LLM Integration - Feed scientific content to language models via MCP

Full Documentation: scipix README

🧠 Meta-Cognition SNN - Spiking Neural Networks

What is Meta-Cognition SNN?

A hybrid AI architecture combining Spiking Neural Networks (SNN), SIMD-optimized vector operations, and 5 attention mechanisms with meta-cognitive self-discovery capabilities.

CapabilityPerformanceDescription
Spiking Neural Networks10-50x fasterLIF neurons + STDP learning with N-API SIMD
SIMD Vector Operations5-54x fasterLoop-unrolled distance/dot product calculations
5 Attention MechanismsSub-millisecondMulti-Head, Flash, Linear, Hyperbolic, MoE
Vector Search150x fasterRuVector-powered semantic search
Meta-CognitionAutonomousSelf-discovering emergent capabilities

SIMD Performance

OperationSpeedupNotes
LIF Updates16.7xLeaky integrate-and-fire neurons
Synaptic Forward14.9xForward propagation
STDP Learning26.3xSpike-timing dependent plasticity
Distance (128d)54xEuclidean distance calculation
Full Simulation18.4xEnd-to-end SNN simulation

5 Attention Mechanisms

MechanismBest ForLatency
FlashLong sequences0.023ms
MoESpecialized domains0.021ms
Multi-HeadComplex patterns0.047ms
LinearReal-time processing0.075ms
HyperbolicHierarchical data0.222ms

Quick Start

# Install and run demos
cd examples/meta-cognition-spiking-neural-network
npm install
node demos/run-all.js
const { createFeedforwardSNN, rateEncoding } = require('./demos/snn/lib/SpikingNeuralNetwork');

// Create SNN with SIMD optimization
const snn = createFeedforwardSNN([100, 50, 10], {
  dt: 1.0,
  tau: 20.0,
  a_plus: 0.005,
  lateral_inhibition: true
});

// Train with STDP
const input = rateEncoding(pattern, snn.dt, 100);
snn.step(input);

6 Emergent Discoveries

  1. Multi-Scale Attention Hierarchy (Novelty: 5/5)
  2. Spike Synchronization Patterns
  3. Attention-Gated Spike Propagation
  4. Temporal Coherence Emergence
  5. Emergent Sparsity (80% fewer active neurons)
  6. Meta-Plasticity (faster learning on later tasks)

Full Documentation: meta-cognition-snn README

πŸ€– RuvLLM - Self-Learning LLM Orchestration

Rust License HuggingFace

What is RuvLLM?

RuvLLM is a self-learning language model orchestration system that combines frozen foundation models with adaptive memory and intelligent routing. Unlike traditional LLMs that rely solely on static parameters, RuvLLM continuously improves from every interaction.

"The intelligence is not in one model anymore. It is in the loop."

SONA: 3-Tier Temporal Learning

LoopFrequencyLatencyDescription
A: InstantPer-request<100ΞΌsMicroLoRA adaptation (rank 1-2)
B: BackgroundHourly~1.3msK-means++ clustering, base LoRA (rank 4-16)
C: DeepWeeklyN/AEWC++ consolidation, concept hierarchies

Core Components

ComponentDescription
LFM2 CortexFrozen reasoning engine (135M-2.6B params)
Ruvector MemoryAdaptive synaptic mesh with HNSW indexing
FastGRNN RouterIntelligent model selection circuit
Graph Attention8-head attention with edge features
SONA EngineLoRA + EWC++ + ReasoningBank

Performance (CPU-Only)

MetricValue
Initialization3.71ms
Average Query0.09ms
Session Query0.04ms
Throughput~38,000 q/s
Memory~50MB

Quick Start

use ruvllm::{RuvLLMOrchestrator, OrchestratorConfig};

// Initialize orchestrator
let config = OrchestratorConfig::default();
let orchestrator = RuvLLMOrchestrator::new(config)?;

// Query with automatic learning
let response = orchestrator.query("Explain quantum entanglement").await?;
println!("{}", response.text);

// Response improves over time as SONA learns patterns

Federated Learning

use rvf_federation::{ExportBuilder, DiffPrivacyEngine, FederationPolicy};

// Build a privacy-preserving federated export
let mut dp = DiffPrivacyEngine::gaussian(1.0, 1e-5, 1.0, 10.0)?;
let export = ExportBuilder::new("contributor_pseudo".into(), "code_review".into())
    .add_priors(local_engine.extract_priors())
    .add_weights(sona_weights)
    .with_policy(FederationPolicy::default())  // quality gate + min observations
    .build(&mut dp)?;                          // PII strip β†’ DP noise β†’ manifest

// Import and merge federated learning from another contributor
let merger = ImportMerger::new();
merger.validate(&remote_export)?;              // signature + witness chain check
merger.merge_priors(&mut local, &remote_export.priors, 1);  // version-aware merge

See rvf-federation for FedAvg/FedProx aggregation, Byzantine tolerance, RDP privacy accounting, and PII stripping pipeline.

Dynamic Embedding Fine-Tuning

RuvLLM's adaptive learning system enables real-time model improvement without retraining.

FeatureDescriptionLatency
MicroLoRAPer-request adaptation (rank 1-2), <50KB adapters<1ms
Contrastive TrainingTriplet loss with hard negatives for embedding optimizationBatch
Task-Specific AdaptersPre-tuned for Coder, Researcher, Security, Architect, ReviewerHot-swap
EWC++ ConsolidationPrevents catastrophic forgetting during continuous learningBackground
Adapter MergingAverage, Weighted, SLERP, TIES, DARE strategiesOn-demand
// Contrastive fine-tuning for agent routing
import { ContrastiveTrainer } from '@ruvector/ruvllm';

const trainer = new ContrastiveTrainer({
  margin: 0.5,
  hardNegativeRatio: 0.7
});

// Learn: task β†’ correct agent, not wrong agent
trainer.addTriplet(taskEmb, correctAgentEmb, wrongAgentEmb, true);
const model = trainer.train();
// Task-specific adapter hot-swapping
use ruvllm::lora::RuvLtraAdapters;

let adapters = RuvLtraAdapters::new();
let coder = adapters.create_lora("coder", 768)?;      // Rank 16, code patterns
let security = adapters.create_lora("security", 768)?; // Rank 16, vulnerability detection

// Hot-swap at runtime without model reload
orchestrator.set_adapter(coder);
let code_response = orchestrator.query("Implement binary search").await?;

orchestrator.set_adapter(security);
let audit_response = orchestrator.query("Audit this code for vulnerabilities").await?;

Advanced Features

  • SIMD Inference: AVX2/AVX512/SSE4.1 optimization
  • Q4 Quantization: 4-bit weights for memory efficiency
  • HuggingFace Export: Export LoRA weights and preference pairs
  • Multi-Model Routing: SmolLM, Qwen2, TinyLlama selection
  • WASM Support: Run SONA in browsers and edge devices
  • Browser Fine-Tuning: MicroLoRA WASM with localStorage persistence

Full Documentation: ruvLLM README | Fine-Tuning Guide | Task Adapters

πŸ—œοΈ REFRAG - Compress-Sense-Expand RAG

What is REFRAG?

REFRAG implements the Compress-Sense-Expand architecture from arXiv:2509.01092, achieving ~30x RAG latency reduction by storing pre-computed representation tensors instead of raw text.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   COMPRESS     │───▢│     SENSE      │───▢│    EXPAND      β”‚
β”‚    Layer       β”‚    β”‚     Layer      β”‚    β”‚    Layer       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Binary tensor         Policy network        Dimension projection
storage with          decides COMPRESS      (768 β†’ 4096 dims)
zero-copy access      vs EXPAND

Compression Strategies

StrategyCompressionUse Case
None1xMaximum precision
Float162xGood balance
Int84xMemory constrained
Binary32xExtreme compression

Policy Networks

PolicyLatencyDescription
ThresholdPolicy~2ΞΌsCosine similarity threshold
LinearPolicy~5ΞΌsSingle layer classifier
MLPPolicy~15ΞΌsTwo-layer neural network

Quick Start

# Run demo
cargo run --bin refrag-demo

# Run benchmarks
cargo run --bin refrag-benchmark --release
use refrag_pipeline_example::{RefragStore, RefragEntry};

// Create REFRAG-enabled store
let store = RefragStore::new(384, 768)?;

// Insert with representation tensor
let entry = RefragEntry::new("doc_1", search_vector, "The quick brown fox...")
    .with_tensor(tensor_bytes, "llama3-8b");
store.insert(entry)?;

// Hybrid search (policy-based COMPRESS/EXPAND)
let results = store.search_hybrid(&query, 10, Some(0.85))?;

for result in results {
    match result.response_type {
        RefragResponseType::Compress => {
            // Tensor directly injectable into LLM context
            println!("Tensor: {} dims", result.tensor_dims.unwrap());
        }
        RefragResponseType::Expand => {
            // Original text when full context needed
            println!("Text: {}", result.content.unwrap());
        }
    }
}

Target LLM Dimensions

SourceTargetLLM
7684096LLaMA-3 8B
7688192LLaMA-3 70B
15368192GPT-4

Full Documentation: refrag-pipeline README

🐦 7sense - Bioacoustic Intelligence Platform

Rust Tests Coverage

What is 7sense?

7sense transforms bird calls into navigable geometric space using cutting-edge AI and vector search. It converts audio recordings of bird songs into rich, searchable embeddings using Perch 2.0 neural networks and ultra-fast HNSW indexing.

Traditional Monitoring7sense
Expert human listenersInstant AI species ID
Basic spectrogram analysisNeural embeddings (1536-dim)
Limited scaleMillions of recordings
Manual pattern findingAutomated discovery

Performance Targets

MetricTargetStatus
HNSW Search Speedup150x vs brute forceAchieved
Query Latency (p99)< 50msAchieved
Recall@10>= 0.95Achieved
Embedding Throughput> 100 segments/secAchieved
Memory per 1M vectors< 6 GBAchieved

9 Rust Crates

CrateDescription
sevensense-coreSpecies taxonomy, temporal types
sevensense-audioWAV/MP3/FLAC, Mel spectrograms
sevensense-embeddingPerch 2.0 ONNX, 1536-dim vectors
sevensense-vectorHNSW with 150x speedup
sevensense-learningGNN training, EWC regularization
sevensense-analysisHDBSCAN clustering, Markov models
sevensense-interpretationEvidence packs, species narratives
sevensense-apiGraphQL, REST, WebSocket streaming
sevensense-benchesCriterion.rs performance suites

Quick Start

# Build and run
cd examples/vibecast-7sense
cargo build --release
cargo run -p sevensense-api --release
use sevensense_audio::AudioProcessor;
use sevensense_embedding::EmbeddingPipeline;
use sevensense_vector::HnswIndex;

// Load and process audio
let processor = AudioProcessor::new(Default::default());
let segments = processor.process_file("recording.wav").await?;

// Generate Perch 2.0 embeddings
let pipeline = EmbeddingPipeline::new(Default::default()).await?;
let embeddings = pipeline.embed_segments(&segments).await?;

// Search for similar calls (150x faster)
let index = HnswIndex::new(Default::default());
index.add_batch(&embeddings)?;
let neighbors = index.search(&embeddings[0], 10)?;

println!("Found {} similar bird calls", neighbors.len());

Use Cases

  • Species Identification - Instant predictions with confidence scores
  • Pattern Discovery - Find similar calls across millions of recordings
  • Behavioral Insights - Detect singing patterns, dialects, anomalies
  • Conservation Monitoring - Track biodiversity at scale

Full Documentation: 7sense README

🧬 EXO-AI - Advanced Cognitive Substrate

crates.io docs.rs License

What is EXO-AI?

EXO-AI 2025 is a comprehensive cognitive substrate implementing cutting-edge theories from neuroscience, physics, and consciousness research. It provides 9 interconnected Rust crates totaling ~15,800+ lines of research-grade code.

Traditional AI systems process information. EXO-AI aims to understand it.

SIMD-Accelerated Performance

OperationSpeedupNotes
Distance (128d)54xAVX2/NEON optimized
Cosine Similarity2.73xBatch operations
Pattern Matching8-54xLoop-unrolled
Meta-Simulation13+ quadrillion/sFrom ultra-low-latency-sim

9 Rust Crates

CrateDescription
exo-coreIIT consciousness (Ξ¦) measurement & Landauer thermodynamics
exo-temporalTemporal memory with causal tracking & consolidation
exo-hypergraphTopological analysis with persistent homology
exo-manifoldSIREN networks + SIMD-accelerated retrieval
exo-exotic10 cutting-edge cognitive experiments
exo-federationPost-quantum federated cognitive mesh
exo-backend-classicalSIMD-accelerated compute backend
exo-wasmBrowser & edge WASM deployment
exo-nodeNode.js bindings via NAPI-RS

Key Theories Implemented

TheoryImplementation
IIT (Integrated Information Theory)Consciousness level (Ξ¦) measurement
Landauer's PrincipleComputational thermodynamics
Free Energy PrincipleFriston's predictive processing
Strange LoopsHofstadter's self-referential patterns
MorphogenesisPattern formation emergence

Quick Start

[dependencies]
exo-core = "0.1"
exo-temporal = "0.1"
exo-exotic = "0.1"
exo-manifold = "0.1"  # SIMD acceleration!
use exo_core::consciousness::{ConsciousnessSubstrate, IITConfig};
use exo_core::thermodynamics::CognitiveThermometer;

// Measure integrated information (Ξ¦)
let substrate = ConsciousnessSubstrate::new(IITConfig::default());
substrate.add_pattern(pattern);
let phi = substrate.compute_phi();
println!("Consciousness level (Ξ¦): {:.4}", phi);

// Track computational thermodynamics
let thermo = CognitiveThermometer::new(300.0); // Kelvin
let cost = thermo.landauer_cost_bits(1024);
println!("Landauer cost: {:.2e} J", cost);

SIMD Pattern Retrieval

use exo_manifold::{ManifoldEngine, cosine_similarity_simd, batch_distances};

// 54x faster similarity search
let query = vec![0.5; 768];
let results = engine.retrieve(&query, 10)?;

// Batch distance computation
let distances = batch_distances(&query, &database);  // 8-54x speedup

Full Documentation: exo-ai README


Database Extensions

🐘 PostgreSQL Extension

crates.io npm Docker Hub Docker

The most advanced PostgreSQL vector extension β€” a drop-in pgvector replacement with 143 SQL functions, hardware-accelerated SIMD operations, and built-in AI capabilities. Transform your existing PostgreSQL database into a full-featured vector search engine with GNN layers, attention mechanisms, and self-learning capabilities.

# Quick Install from Docker Hub
docker run -d --name ruvector \
  -e POSTGRES_PASSWORD=secret \
  -p 5432:5432 \
  ruvnet/ruvector-postgres:latest

# Connect and use
psql -h localhost -U ruvector -d ruvector_test

# Create extension
CREATE EXTENSION ruvector;

Why RuVector Postgres?

  • Zero Migration β€” Works with existing pgvector code, just swap the extension
  • 10x More Functions β€” 143 SQL functions vs pgvector's ~20
  • 2x Faster β€” AVX-512/AVX2/NEON SIMD acceleration
  • AI-Native β€” GNN layers, 46 attention mechanisms, local embeddings
  • Self-Learning β€” Improves search quality over time with ReasoningBank
FeaturepgvectorRuVector Postgres
SQL Functions~20143
SIMD AccelerationBasicAVX-512/AVX2/NEON (~2x faster)
Index TypesHNSW, IVFFlatHNSW, IVFFlat + Hyperbolic
Attention Mechanisms❌46 types (Flash, Linear, Graph)
GNN Layers❌GCN, GraphSAGE, GAT, GIN
Sparse Vectors❌BM25, TF-IDF, SPLADE
Self-Learning❌ReasoningBank, trajectory learning
Local Embeddings❌6 fastembed models built-in
Multi-Tenancy❌Built-in namespace isolation
Quantization❌Scalar, Product, Binary (4-32x compression)
🐳 Docker Hub (Recommended)

Pull from Docker Hub: hub.docker.com/r/ruvnet/ruvector-postgres

# Quick start
docker run -d --name ruvector \
  -e POSTGRES_PASSWORD=secret \
  -p 5432:5432 \
  ruvnet/ruvector-postgres:latest

# Connect
psql -h localhost -U ruvector -d ruvector_test

# Create extension
CREATE EXTENSION ruvector;

Environment Variables:

VariableDefaultDescription
POSTGRES_USERruvectorDatabase user
POSTGRES_PASSWORDruvectorDatabase password
POSTGRES_DBruvector_testDefault database

Docker Compose:

version: '3.8'
services:
  ruvector-postgres:
    image: ruvnet/ruvector-postgres:latest
    environment:
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: ruvector_test
    ports:
      - "5432:5432"
    volumes:
      - pgdata:/var/lib/postgresql/data

volumes:
  pgdata:

Available Tags:

  • ruvnet/ruvector-postgres:latest - PostgreSQL + RuVector 0.3.0
  • ruvnet/ruvector-postgres:0.3.0 - Current release (143 SQL functions)
  • ruvnet/ruvector-postgres:2.0.0 - Previous release
πŸ“¦ npm CLI
# Install globally
npm install -g @ruvector/postgres-cli

# Or use npx
npx @ruvector/postgres-cli --help

# Commands available as 'ruvector-pg' or 'rvpg'
ruvector-pg --version
rvpg --help

CLI Commands:

# Install extension to existing PostgreSQL
ruvector-pg install

# Create vector table with HNSW index
ruvector-pg vector create table embeddings --dim 1536 --index hnsw

# Import vectors from file
ruvector-pg vector import embeddings data.json

# Search vectors
ruvector-pg vector search embeddings --query "0.1,0.2,..." --limit 10

# Benchmark performance
ruvector-pg bench --iterations 1000

# Check extension status
ruvector-pg status

Programmatic Usage:

import { RuvectorPG } from '@ruvector/postgres-cli';

const client = new RuvectorPG({
  host: 'localhost',
  port: 5432,
  database: 'vectors',
  user: 'postgres',
  password: 'secret'
});

// Create table with HNSW index
await client.createTable('embeddings', {
  dimensions: 1536,
  indexType: 'hnsw',
  distanceMetric: 'cosine'
});

// Insert vectors
await client.insert('embeddings', {
  id: '1',
  vector: [0.1, 0.2, ...],
  metadata: { source: 'openai' }
});

// Search
const results = await client.search('embeddings', queryVector, { limit: 10 });
πŸ¦€ Rust Crate
# Install pgrx (PostgreSQL extension framework)
cargo install cargo-pgrx --version "0.12.9" --locked
cargo pgrx init

# Build and install extension
cd crates/ruvector-postgres
cargo pgrx install --release

# Or install specific PostgreSQL version
cargo pgrx install --release --pg-config /usr/lib/postgresql/17/bin/pg_config

Cargo.toml:

[dependencies]
ruvector-postgres = "2.0"

# Optional features
[features]
default = ["pg17"]
pg16 = ["ruvector-postgres/pg16"]
pg15 = ["ruvector-postgres/pg15"]

# AI features (opt-in)
ai-complete = ["ruvector-postgres/ai-complete"]  # All AI features
learning = ["ruvector-postgres/learning"]         # Self-learning
attention = ["ruvector-postgres/attention"]       # 46 attention mechanisms
gnn = ["ruvector-postgres/gnn"]                   # Graph neural networks
hyperbolic = ["ruvector-postgres/hyperbolic"]     # Hyperbolic embeddings
embeddings = ["ruvector-postgres/embeddings"]     # Local embedding generation
solver = ["ruvector-postgres/solver"]                   # Sublinear solvers
math-distances = ["ruvector-postgres/math-distances"]   # Math distances & spectral
tda = ["ruvector-postgres/tda"]                         # Topological data analysis
sona-learning = ["ruvector-postgres/sona-learning"]     # Sona learning
domain-expansion = ["ruvector-postgres/domain-expansion"] # Domain expansion
analytics-complete = ["solver", "math-distances", "tda"] # All analytics

Build with all features:

cargo pgrx install --release --features "ai-complete,embeddings,analytics-complete,attention-extended,sona-learning,domain-expansion"
πŸ“ SQL Examples
-- Enable extension
CREATE EXTENSION ruvector;

-- Create table with vector column
CREATE TABLE documents (
  id SERIAL PRIMARY KEY,
  content TEXT,
  embedding VECTOR(1536)
);

-- Create HNSW index
CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops)
  WITH (m = 16, ef_construction = 200);

-- Insert vectors
INSERT INTO documents (content, embedding)
VALUES ('Hello world', '[0.1, 0.2, ...]'::vector);

-- Semantic search (cosine similarity)
SELECT id, content, embedding <=> '[0.1, 0.2, ...]'::vector AS distance
FROM documents
ORDER BY distance
LIMIT 10;

-- Hybrid search (vector + full-text)
SELECT id, content
FROM documents
WHERE to_tsvector(content) @@ to_tsquery('machine & learning')
ORDER BY embedding <=> query_embedding
LIMIT 10;

-- GNN-enhanced search (with learning)
SELECT * FROM ruvector_gnn_search(
  'documents',
  '[0.1, 0.2, ...]'::vector,
  10,  -- limit
  'gcn' -- gnn_type: gcn, graphsage, gat, gin
);

-- Generate embeddings locally (no API needed)
SELECT ruvector_embed('all-MiniLM-L6-v2', 'Your text here');

-- Flash attention
SELECT ruvector_flash_attention(query, key, value);

See ruvector-postgres README for full SQL API reference (143 functions).


Developer Tools

πŸ› οΈ Tools & Utilities
CrateDescriptioncrates.io
ruvector-benchBenchmarking suite for vector operationscrates.io
ruvector-metricsObservability, metrics, and monitoringcrates.io
ruvector-filterMetadata filtering and query predicatescrates.io
ruvector-collectionsMulti-tenant collection managementcrates.io
ruvector-snapshotPoint-in-time snapshots and backupscrates.io
micro-hnsw-wasmLightweight HNSW implementation for WASMcrates.io

Embedded & IoT

CrateDescriptionTarget
ruvector-esp32ESP32/ESP-IDF vector searchESP32, ESP32-S3
rvliteSQLite-style edge DB (no_std compatible)ARM, RISC-V, WASM
micro-hnsw-wasm<50KB HNSW for constrained devicesWASM, embedded
// ESP32 example (no_std)
#![no_std]
use rvlite::RvLite;

let db = RvLite::new(128);  // 128-dim vectors
db.insert(0, &embedding);
let results = db.search(&query, 5);

Browser & Edge (WASM)

🌐 WASM Packages (Browser & Edge)

Specialized WebAssembly modules for browser and edge deployment. These packages bring advanced AI and distributed computing primitives to JavaScript/TypeScript with near-native performance.

Quick Install (All Browser WASM)

# Core vector search
npm install ruvector-wasm @ruvector/rvlite

# AI & Neural
npm install @ruvector/gnn-wasm @ruvector/attention-wasm @ruvector/sona-wasm

# Graph & Algorithms
npm install @ruvector/graph-wasm @ruvector/mincut-wasm @ruvector/hyperbolic-hnsw-wasm

# Exotic AI
npm install @ruvector/economy-wasm @ruvector/exotic-wasm @ruvector/nervous-system-wasm

# LLM (browser inference)
npm install @ruvector/ruvllm-wasm
CategoryPackagesTotal Size
Coreruvector-wasm, rvlite~200KB
AI/Neuralgnn, attention, sona~300KB
Graphgraph, mincut, hyperbolic-hnsw~250KB
Exoticeconomy, exotic, nervous-system~350KB
LLMruvllm-wasm~435KB (178KB gzipped)

Installation

# Install individual packages
npm install @ruvector/learning-wasm
npm install @ruvector/economy-wasm
npm install @ruvector/exotic-wasm
npm install @ruvector/nervous-system-wasm
npm install @ruvector/attention-unified-wasm

# Or build from source
cd crates/ruvector-learning-wasm
wasm-pack build --target web

ruvector-learning-wasm

MicroLoRA, BTSP, and HDC for self-learning AI systems.

Ultra-fast Low-Rank Adaptation (LoRA) optimized for WASM execution with <100us adaptation latency. Designed for real-time per-operator learning in query optimization and AI agent systems.

FeaturePerformanceDescription
MicroLoRA<100us latencyRank-2 LoRA matrices for instant weight adaptation
Per-Operator ScopingZero-allocation hot pathsSeparate adapters for different operator types
Trajectory TrackingLock-free buffersRecord learning trajectories for replay

Architecture:

Input Embedding (256-dim)
       |
       v
  +---------+
  | A: d x 2 |  Down projection
  +---------+
       |
       v
  +---------+
  | B: 2 x d |  Up projection
  +---------+
       |
       v
Delta W = alpha * (A @ B)
       |
       v
Output = Input + Delta W

JavaScript/TypeScript Example:

import init, { WasmMicroLoRA } from '@ruvector/learning-wasm';

await init();

// Create MicroLoRA engine (256-dim, alpha=0.1, lr=0.01)
const lora = new WasmMicroLoRA(256, 0.1, 0.01);

// Forward pass with adaptation
const input = new Float32Array(256).fill(0.5);
const output = lora.forward_array(input);

// Adapt based on gradient signal
const gradient = new Float32Array(256).fill(0.1);
lora.adapt_array(gradient);

// Adapt with reward signal for RL
lora.adapt_with_reward(0.8);  // 80% improvement

console.log(`Adaptations: ${lora.adapt_count()}`);
console.log(`Delta norm: ${lora.delta_norm()}`);

ruvector-economy-wasm

CRDT-based autonomous credit economy for distributed compute networks.

P2P-safe concurrent transactions using Conflict-free Replicated Data Types (CRDTs). Features a 10x-to-1x early adopter contribution curve and stake/slash mechanisms for participation incentives.

FeatureDescription
CRDT LedgerG-Counter (earned) + PN-Counter (spent) for P2P consistency
Contribution Curve10x early adopter multiplier decaying to 1x baseline
Stake/SlashParticipation requirements with slashing for bad actors
Reputation ScoringMulti-factor: accuracy * uptime * stake_weight
Merkle VerificationSHA-256 state root for quick ledger verification

Architecture:

+------------------------+
|     CreditLedger       |  <-- CRDT-based P2P-safe ledger
|  +------------------+  |
|  | G-Counter: Earned|  |  <-- Monotonically increasing
|  | PN-Counter: Spent|  |  <-- Can handle disputes/refunds
|  | Stake: Locked    |  |  <-- Participation requirement
|  | State Root       |  |  <-- Merkle root for verification
|  +------------------+  |
+------------------------+
          |
          v
+------------------------+
|  ContributionCurve     |  <-- Exponential decay: 10x -> 1x
+------------------------+
          |
          v
+------------------------+
|   ReputationScore      |  <-- accuracy * uptime * stake_weight
+------------------------+

JavaScript/TypeScript Example:

import init, {
  CreditLedger,
  ReputationScore,
  contribution_multiplier
} from '@ruvector/economy-wasm';

await init();

// Create a new ledger for a node
const ledger = new CreditLedger("node-123");

// Earn credits (with early adopter multiplier)
ledger.creditWithMultiplier(100, "task:abc");
console.log(`Balance: ${ledger.balance()}`);
console.log(`Multiplier: ${ledger.currentMultiplier()}x`);

// Stake for participation
ledger.stake(50);
console.log(`Staked: ${ledger.stakedAmount()}`);

// Check multiplier for network compute hours
const mult = contribution_multiplier(50000.0);  // 50K hours
console.log(`Network multiplier: ${mult}x`);  // ~8.5x

// Track reputation
const rep = new ReputationScore(0.95, 0.98, 1000);
console.log(`Composite score: ${rep.composite_score()}`);

// P2P merge with another ledger (CRDT operation)
const otherEarned = new Uint8Array([/* serialized earned counter */]);
const otherSpent = new Uint8Array([/* serialized spent counter */]);
const mergedCount = ledger.merge(otherEarned, otherSpent);

ruvector-exotic-wasm

Exotic AI mechanisms for emergent behavior in distributed systems.

Novel coordination primitives inspired by decentralized governance, developmental biology, and quantum physics.

MechanismInspirationUse Case
Neural Autonomous Organization (NAO)DAOs + oscillatory syncDecentralized AI agent governance
Morphogenetic NetworkDevelopmental biologyEmergent network topology
Time Crystal CoordinatorQuantum time crystalsRobust distributed coordination

NAO Features:

  • Stake-weighted quadratic voting
  • Oscillatory synchronization for coherence
  • Quorum-based consensus (configurable threshold)

Morphogenetic Network Features:

  • Cellular differentiation through morphogen gradients
  • Emergent network topology via growth/pruning
  • Synaptic pruning for optimization

Time Crystal Features:

  • Period-doubled oscillations for stable coordination
  • Floquet engineering for noise resilience
  • Phase-locked agent synchronization

JavaScript/TypeScript Example:

import init, {
  WasmNAO,
  WasmMorphogeneticNetwork,
  WasmTimeCrystal,
  ExoticEcosystem
} from '@ruvector/exotic-wasm';

await init();

// Neural Autonomous Organization
const nao = new WasmNAO(0.7);  // 70% quorum
nao.addMember("agent_1", 100);  // 100 stake
nao.addMember("agent_2", 50);

const propId = nao.propose("Upgrade memory backend");
nao.vote(propId, "agent_1", 0.9);  // 90% approval weight
nao.vote(propId, "agent_2", 0.6);

if (nao.execute(propId)) {
  console.log("Proposal executed!");
}

// Morphogenetic Network
const net = new WasmMorphogeneticNetwork(100, 100);  // 100x100 grid
net.seedSignaling(50, 50);  // Seed signaling cell at center

for (let i = 0; i < 1000; i++) {
  net.grow(0.1);  // 10% growth rate
}
net.differentiate();
net.prune(0.1);  // 10% pruning threshold

// Time Crystal Coordinator
const crystal = new WasmTimeCrystal(10, 100);  // 10 oscillators, 100ms period
crystal.crystallize();

for (let i = 0; i < 200; i++) {
  const pattern = crystal.tick();
  // Use pattern for coordination decisions
}

console.log(`Synchronization: ${crystal.orderParameter()}`);

// Combined Ecosystem (all three working together)
const eco = new ExoticEcosystem(5, 50, 8);  // 5 agents, 50x50 grid, 8 oscillators
eco.crystallize();

for (let i = 0; i < 100; i++) {
  eco.step();
}

console.log(eco.summaryJson());

ruvector-nervous-system-wasm

Bio-inspired neural system components for browser execution.

ComponentPerformanceDescription
BTSPImmediateBehavioral Timescale Synaptic Plasticity for one-shot learning
HDC<50ns bind, <100ns similarityHyperdimensional Computing with 10,000-bit vectors
WTA<1usWinner-Take-All for instant decisions
K-WTA<10usK-Winner-Take-All for sparse distributed coding
Global Workspace<10us4-7 item attention bottleneck (Miller's Law)

Hyperdimensional Computing:

  • 10,000-bit binary hypervectors
  • 104010^{40} representational capacity
  • XOR binding (associative, commutative, self-inverse)
  • Hamming distance similarity with SIMD optimization

Biological References:

  • BTSP: Bittner et al. 2017 - Hippocampal place fields
  • HDC: Kanerva 1988, Plate 2003 - Hyperdimensional computing
  • WTA: Cortical microcircuits - Lateral inhibition
  • Global Workspace: Baars 1988, Dehaene 2014 - Consciousness

JavaScript/TypeScript Example:

import init, {
  BTSPLayer,
  Hypervector,
  HdcMemory,
  WTALayer,
  KWTALayer,
  GlobalWorkspace,
  WorkspaceItem,
} from '@ruvector/nervous-system-wasm';

await init();

// One-shot learning with BTSP
const btsp = new BTSPLayer(100, 2000.0);  // 100 dim, 2000ms tau
const pattern = new Float32Array(100).fill(0.1);
btsp.one_shot_associate(pattern, 1.0);  // Immediate association
const output = btsp.forward(pattern);

// Hyperdimensional Computing
const apple = Hypervector.random();
const orange = Hypervector.random();
const fruit = apple.bind(orange);  // XOR binding

const similarity = apple.similarity(orange);  // ~0.0 (orthogonal)
console.log(`Similarity: ${similarity}`);  // Random vectors are orthogonal

// HDC Memory
const memory = new HdcMemory();
memory.store("apple", apple);
memory.store("orange", orange);

const results = memory.retrieve(apple, 0.9);  // threshold 0.9
const topK = memory.top_k(fruit, 3);  // top-3 similar

// Instant decisions with WTA
const wta = new WTALayer(1000, 0.5, 0.8);  // 1000 neurons, threshold, inhibition
const activations = new Float32Array(1000);
// ... fill activations ...
const winner = wta.compete(activations);

// Sparse coding with K-WTA
const kwta = new KWTALayer(1000, 50);  // 1000 neurons, k=50 winners
const winners = kwta.select(activations);

// Attention bottleneck with Global Workspace
const workspace = new GlobalWorkspace(7);  // Miller's Law: 7 +/- 2
const item = new WorkspaceItem(
  new Float32Array([1, 2, 3]),  // content
  0.9,  // salience
  1,    // source
  Date.now()  // timestamp
);
workspace.broadcast(item);

ruvector-attention-unified-wasm

Unified API for 18+ attention mechanisms across Neural, DAG, Graph, and SSM domains.

A single WASM interface that routes to the appropriate attention implementation based on your data structure and requirements.

CategoryMechanismsBest For
NeuralScaled Dot-Product, Multi-Head, Hyperbolic, Linear, Flash, Local-Global, MoETransformers, sequences
DAGTopological, Causal Cone, Critical Path, MinCut-Gated, Hierarchical Lorentz, Parallel Branch, Temporal BTSPQuery DAGs, workflows
GraphGAT, GCN, GraphSAGEGNNs, knowledge graphs
SSMMambaLong sequences, streaming

Mechanism Selection:

+------------------+     +-------------------+
|   Your Data      | --> | UnifiedAttention  | --> Optimal Mechanism
+------------------+     +-------------------+
                               |
        +----------------------+----------------------+
        |                      |                      |
   +----v----+           +-----v-----+          +-----v----+
   | Neural  |           |    DAG    |          |  Graph   |
   +---------+           +-----------+          +----------+
   | dot_prod|           | topological|         | gat      |
   | multi_hd|           | causal_cone|         | gcn      |
   | flash   |           | mincut_gtd |         | graphsage|
   +---------+           +-----------+          +----------+

JavaScript/TypeScript Example:

import init, {
  UnifiedAttention,
  availableMechanisms,
  getStats,
  softmax,
  temperatureSoftmax,
  cosineSimilarity,
  // Neural attention
  ScaledDotProductAttention,
  MultiHeadAttention,
  // DAG attention
  TopologicalAttention,
  MinCutGatedAttention,
  // Graph attention
  GraphAttention,
  // SSM
  MambaSSM,
} from '@ruvector/attention-unified-wasm';

await init();

// List all available mechanisms
console.log(availableMechanisms());
// { neural: [...], dag: [...], graph: [...], ssm: [...] }

console.log(getStats());
// { total_mechanisms: 18, neural_count: 7, dag_count: 7, ... }

// Unified selector - routes to appropriate implementation
const attention = new UnifiedAttention("multi_head");
console.log(`Category: ${attention.category}`);  // "neural"
console.log(`Supports sequences: ${attention.supportsSequences()}`);  // true
console.log(`Supports graphs: ${attention.supportsGraphs()}`);  // false

// For DAG structures
const dagAttention = new UnifiedAttention("topological");
console.log(`Category: ${dagAttention.category}`);  // "dag"
console.log(`Supports graphs: ${dagAttention.supportsGraphs()}`);  // true

// Hyperbolic attention for hierarchical data
const hypAttention = new UnifiedAttention("hierarchical_lorentz");
console.log(`Supports hyperbolic: ${hypAttention.supportsHyperbolic()}`);  // true

// Utility functions
const logits = [1.0, 2.0, 3.0, 4.0];
const probs = softmax(logits);
console.log(`Probabilities sum to: ${probs.reduce((a, b) => a + b)}`);  // 1.0

// Temperature-scaled softmax (lower = more peaked)
const sharperProbs = temperatureSoftmax(logits, 0.5);

// Cosine similarity
const vecA = [1.0, 0.0, 0.0];
const vecB = [1.0, 0.0, 0.0];
console.log(`Similarity: ${cosineSimilarity(vecA, vecB)}`);  // 1.0

WASM Package Summary

PackageSize TargetKey Features
@ruvector/learning-wasm<50KBMicroLoRA (<100us), trajectory tracking
@ruvector/economy-wasm<100KBCRDT ledger, 10x->1x curve, stake/slash
@ruvector/exotic-wasm<150KBNAO, Morphogenetic, Time Crystal
@ruvector/nervous-system-wasm<100KBBTSP, HDC (10K-bit), WTA, Global Workspace
@ruvector/attention-unified-wasm<200KB18+ attention mechanisms, unified API
@ruvnet/ruvector-verified-wasm<80KBFormal proof verification in browser/edge

Common Patterns:

// All packages follow the same initialization pattern
import init, { /* exports */ } from '@ruvector/<package>-wasm';
await init();

// Version check
import { version } from '@ruvector/<package>-wasm';
console.log(`Version: ${version()}`);

// Feature discovery
import { available_mechanisms } from '@ruvector/<package>-wasm';
console.log(available_mechanisms());

Self-Learning Systems

🧠 Self-Learning Intelligence Hooks

Make your AI assistant smarter over time.

When you use Claude Code (or any AI coding assistant), it starts fresh every session. It doesn't remember which approaches worked, which files you typically edit together, or what errors you've seen before.

RuVector Hooks fixes this. It's a lightweight intelligence layer that:

  1. Remembers what works β€” Tracks which agent types succeed for different tasks
  2. Learns from mistakes β€” Records error patterns and suggests fixes you've used before
  3. Predicts your workflow β€” Knows that after editing api.rs, you usually edit api_test.rs
  4. Coordinates teams β€” Manages multi-agent swarms for complex tasks

Think of it as giving your AI assistant a memory and intuition about your codebase.

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Claude Code    │────▢│  RuVector Hooks  │────▢│   Intelligence  β”‚
β”‚  (PreToolUse)   β”‚     β”‚   (pre-edit)     β”‚     β”‚      Layer      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                         β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Q-Learning    β”‚     β”‚  Vector Memory   β”‚     β”‚  Swarm Graph    β”‚
β”‚   Ξ±=0.1 Ξ³=0.95  β”‚     β”‚  64-dim embed    β”‚     β”‚  Coordination   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The hooks integrate with Claude Code's event system:

  • PreToolUse β†’ Provides guidance before edits (agent routing, related files)
  • PostToolUse β†’ Records outcomes for learning (success/failure, patterns)
  • SessionStart/Stop β†’ Manages session state and metrics export

Technical Specifications

ComponentImplementationDetails
Q-LearningTemporal DifferenceΞ±=0.1, Ξ³=0.95, Ξ΅=0.1 (Ξ΅-greedy exploration)
EmbeddingsHash-based vectors64 dimensions, normalized, cosine similarity
LRU Cachelru crate1000 entries, ~10x faster Q-value lookups
Compressionflate2 gzip70-83% storage reduction, fast compression
StorageJSON / PostgreSQLAuto-fallback, 5000 memory entry limit
Cross-platformRust + TypeScriptWindows (USERPROFILE), Unix (HOME)

Performance

MetricValue
Q-value lookup (cached)<1Β΅s
Q-value lookup (uncached)~50Β΅s
Memory search (1000 entries)<5ms
Storage compression ratio70-83%
Session start overhead<10ms
Crate/PackageDescriptionStatus
ruvector-cli hooksRust CLI with 34 hooks commandscrates.io
@ruvector/cli hooksnpm CLI with 29 hooks commandsnpm

Quick Start

# Rust CLI
cargo install ruvector-cli
ruvector hooks init
ruvector hooks install

# npm CLI
npx @ruvector/cli hooks init
npx @ruvector/cli hooks install

Core Capabilities

FeatureDescriptionTechnical Details
Q-Learning RoutingRoutes tasks to best agent with learned confidence scoresTD learning with Ξ±=0.1, Ξ³=0.95, Ξ΅-greedy exploration
Semantic MemoryVector-based memory with embeddings for context retrieval64-dim hash embeddings, cosine similarity, top-k search
Error LearningRecords error patterns and suggests fixesPattern matching for E0308, E0433, TS2322, etc.
File SequencesPredicts next files to edit based on historical patternsMarkov chain transitions, frequency-weighted suggestions
Swarm CoordinationRegisters agents, tracks coordination edges, optimizesGraph-based topology, weighted edges, task assignment
LRU Cache1000-entry cache for faster Q-value lookups~10x speedup, automatic eviction, RefCell for interior mutability
Gzip CompressionStorage savings with automatic compressionflate2 fast mode, 70-83% reduction, transparent load/save
Batch SavesDirty flag tracking to reduce disk I/OOnly writes when data changes, force_save() override
Shell CompletionsTab completion for all commandsbash, zsh, fish, PowerShell support

Supported Error Codes

The intelligence layer has built-in knowledge for common error patterns:

LanguageError CodesAuto-Suggested Fixes
RustE0308, E0433, E0425, E0277, E0382Type mismatches, missing imports, borrow checker
TypeScriptTS2322, TS2339, TS2345, TS7006Type assignments, property access, argument types
PythonImportError, AttributeError, TypeErrorModule imports, attribute access, type errors
Goundefined, cannot use, not enough argumentsVariable scope, type conversion, function calls

Commands Reference

# Setup
ruvector hooks init [--force] [--postgres]  # Initialize hooks (--postgres for DB schema)
ruvector hooks install                   # Install into Claude settings

# Core
ruvector hooks stats                     # Show intelligence statistics
ruvector hooks session-start [--resume]  # Start/resume a session
ruvector hooks session-end               # End session with metrics

# Memory
ruvector hooks remember -t edit "content"  # Store in semantic memory
ruvector hooks recall "query" -k 5         # Search memory semantically

# Learning
ruvector hooks learn <state> <action> --reward 0.8  # Record trajectory
ruvector hooks suggest <state> --actions "a,b,c"    # Get action suggestion
ruvector hooks route "implement caching" --file src/cache.rs  # Route to agent

# Claude Code Hooks
ruvector hooks pre-edit <file>           # Pre-edit intelligence hook
ruvector hooks post-edit <file> --success  # Post-edit learning hook
ruvector hooks pre-command <cmd>         # Pre-command hook
ruvector hooks post-command <cmd> --success  # Post-command hook
ruvector hooks suggest-context           # UserPromptSubmit context injection
ruvector hooks track-notification        # Track notification patterns
ruvector hooks pre-compact [--auto]      # Pre-compact hook (auto/manual)

# Claude Code v2.0.55+ Features
ruvector hooks lsp-diagnostic --file <f> --severity error  # LSP diagnostics
ruvector hooks suggest-ultrathink "complex task"  # Recommend extended reasoning
ruvector hooks async-agent --action spawn --agent-id <id>  # Async sub-agents

# Intelligence
ruvector hooks record-error <cmd> <stderr>  # Record error pattern
ruvector hooks suggest-fix E0308           # Get fix for error code
ruvector hooks suggest-next <file> -n 3    # Predict next files
ruvector hooks should-test <file>          # Check if tests needed

# Swarm
ruvector hooks swarm-register <id> <type>  # Register agent
ruvector hooks swarm-coordinate <src> <tgt>  # Record coordination
ruvector hooks swarm-optimize "task1,task2"  # Optimize distribution
ruvector hooks swarm-recommend "rust"      # Recommend agent for task
ruvector hooks swarm-heal <agent-id>       # Handle agent failure
ruvector hooks swarm-stats                 # Show swarm statistics

# Optimization (Rust only)
ruvector hooks compress                   # Compress storage (70-83% savings)
ruvector hooks cache-stats                # Show LRU cache statistics
ruvector hooks completions bash           # Generate shell completions

Tutorial: Claude Code Integration

1. Initialize and install hooks:

ruvector hooks init
ruvector hooks install --settings-dir .claude

This creates .claude/settings.json with hook configurations:

{
  "hooks": {
    "PreToolUse": [
      { "matcher": "Edit|Write|MultiEdit", "hooks": ["ruvector hooks pre-edit \"$TOOL_INPUT_FILE_PATH\""] },
      { "matcher": "Bash", "hooks": ["ruvector hooks pre-command \"$TOOL_INPUT_COMMAND\""] }
    ],
    "PostToolUse": [
      { "matcher": "Edit|Write|MultiEdit", "hooks": ["ruvector hooks post-edit ... --success"] },
      { "matcher": "Bash", "hooks": ["ruvector hooks post-command ... --success"] }
    ],
    "SessionStart": ["ruvector hooks session-start"],
    "Stop": ["ruvector hooks session-end --export-metrics"],
    "PreCompact": ["ruvector hooks pre-compact"]
  }
}

All 7 Claude Code hooks covered:

HookWhen It FiresWhat RuVector Does
PreToolUseBefore file edit, command, or TaskSuggests agent, shows related files, validates agent assignments
PostToolUseAfter file edit or commandRecords outcome, updates Q-values, injects context
SessionStartWhen session begins/resumesLoads intelligence, shows stats (startup vs resume)
StopWhen session endsSaves state, exports metrics
PreCompactBefore context compactionPreserves critical memories (auto vs manual)
UserPromptSubmitBefore processing user promptInjects learned patterns as context
NotificationOn system notificationsTracks notification patterns

Advanced Features:

  • Stdin JSON Parsing: Hooks receive full JSON via stdin (session_id, tool_input, tool_response)
  • Context Injection: PostToolUse returns additionalContext to inject into Claude's context
  • Timeout Optimization: All hooks have optimized timeouts (1-5 seconds vs 60s default)

2. Use routing for intelligent agent selection:

# Route a task to the best agent
$ ruvector hooks route "implement vector search" --file src/lib.rs
{
  "recommended": "rust-developer",
  "confidence": 0.85,
  "reasoning": "learned from 47 similar edits"
}

3. Learn from outcomes:

# Record successful outcome
ruvector hooks learn "edit-rs-lib" "rust-developer" --reward 1.0

# Record failed outcome
ruvector hooks learn "edit-rs-lib" "typescript-dev" --reward -0.5

4. Get error fix suggestions:

$ ruvector hooks suggest-fix E0308
{
  "code": "E0308",
  "type": "type_mismatch",
  "fixes": [
    "Check return type matches function signature",
    "Use .into() or .as_ref() for type conversion",
    "Verify generic type parameters"
  ]
}

Tutorial: Swarm Coordination

1. Register agents:

ruvector hooks swarm-register agent-1 rust-developer --capabilities "rust,async,testing"
ruvector hooks swarm-register agent-2 typescript-dev --capabilities "ts,react,node"
ruvector hooks swarm-register agent-3 reviewer --capabilities "review,security,performance"

2. Record coordination patterns:

# Agent-1 hands off to Agent-3 for review
ruvector hooks swarm-coordinate agent-1 agent-3 --weight 0.9

3. Optimize task distribution:

$ ruvector hooks swarm-optimize "implement-api,write-tests,code-review"
{
  "assignments": {
    "implement-api": "agent-1",
    "write-tests": "agent-1",
    "code-review": "agent-3"
  }
}

4. Handle failures with self-healing:

# Mark agent as failed and redistribute
ruvector hooks swarm-heal agent-2

PostgreSQL Storage (Optional)

For production deployments, use PostgreSQL instead of JSON files:

# Set connection URL
export RUVECTOR_POSTGRES_URL="postgres://user:pass@localhost/ruvector"

# Initialize PostgreSQL schema (automatic)
ruvector hooks init --postgres

# Or apply schema manually
psql $RUVECTOR_POSTGRES_URL -f crates/ruvector-cli/sql/hooks_schema.sql

# Build CLI with postgres feature
cargo build -p ruvector-cli --features postgres

The PostgreSQL backend provides:

  • Vector embeddings with native ruvector type
  • Q-learning functions (ruvector_hooks_update_q, ruvector_hooks_best_action)
  • Swarm coordination tables with foreign key relationships
  • Automatic memory cleanup (keeps last 5000 entries)

Additional Modules

πŸ”¬ Scientific OCR (SciPix)
PackageDescriptionInstall
ruvector-scipixRust OCR engine for scientific documentscargo add ruvector-scipix
@ruvector/scipixTypeScript client for SciPix APInpm install @ruvector/scipix

SciPix extracts text and mathematical equations from images, converting them to LaTeX, MathML, or plain text.

Features:

  • Multi-format output β€” LaTeX, MathML, AsciiMath, plain text, structured JSON
  • Batch processing β€” Process multiple images with parallel execution
  • Content detection β€” Equations, tables, diagrams, mixed content
  • Confidence scoring β€” Per-region confidence levels (high/medium/low)
  • PDF support β€” Extract from multi-page PDFs with page selection
import { SciPixClient, OutputFormat } from '@ruvector/scipix';

const client = new SciPixClient({
  baseUrl: 'http://localhost:8080',
  apiKey: 'your-api-key',
});

// OCR an image file
const result = await client.ocrFile('./equation.png', {
  formats: [OutputFormat.LaTeX, OutputFormat.MathML],
  detectEquations: true,
});

console.log('LaTeX:', result.latex);
console.log('Confidence:', result.confidence);

// Quick LaTeX extraction
const latex = await client.extractLatex('./math.png');

// Batch processing
const batchResult = await client.batchOcr({
  images: [
    { source: 'base64...', id: 'eq1' },
    { source: 'base64...', id: 'eq2' },
  ],
  defaultOptions: { formats: [OutputFormat.LaTeX] },
});
# Rust CLI usage
scipix-cli ocr --input equation.png --format latex
scipix-cli serve --port 3000

# MCP server for Claude/AI assistants
scipix-cli mcp
claude mcp add scipix -- scipix-cli mcp

See npm/packages/scipix/README.md for full documentation.

πŸ”— ONNX Embeddings
ExampleDescriptionPath
ruvector-onnx-embeddingsProduction-ready ONNX embedding generation in pure Rustexamples/onnx-embeddings

ONNX Embeddings provides native embedding generation using ONNX Runtime β€” no Python required. Supports 8+ pretrained models (all-MiniLM, BGE, E5, GTE), multiple pooling strategies, GPU acceleration (CUDA, TensorRT, CoreML, WebGPU), and direct RuVector index integration for RAG pipelines.

use ruvector_onnx_embeddings::{Embedder, PretrainedModel};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Create embedder with default model (all-MiniLM-L6-v2)
    let mut embedder = Embedder::default_model().await?;

    // Generate embedding (384 dimensions)
    let embedding = embedder.embed_one("Hello, world!")?;

    // Compute semantic similarity
    let sim = embedder.similarity(
        "I love programming in Rust",
        "Rust is my favorite language"
    )?;
    println!("Similarity: {:.4}", sim); // ~0.85

    Ok(())
}

Supported Models:

ModelDimensionSpeedBest For
AllMiniLmL6V2384FastGeneral purpose (default)
BgeSmallEnV15384FastSearch & retrieval
AllMpnetBaseV2768AccurateProduction RAG
πŸ”§ Bindings & Tools

Native bindings and tools for integrating RuVector into any environment β€” Node.js, browsers, CLI, or as an HTTP/gRPC server.

CrateDescriptioncrates.io
ruvector-nodeNative Node.js bindings via napi-rscrates.io
ruvector-wasmWASM bindings for browsers & edgecrates.io
ruvllm-wasmBrowser LLM inference with WebGPUcrates.io
ruvector-cliCommand-line interfacecrates.io
ruvector-serverHTTP/gRPC servercrates.io

Node.js (Native Performance)

npm install @ruvector/node
const { RuVector } = require('@ruvector/node');
const db = new RuVector({ dimensions: 1536 });
db.insert('doc1', embedding, { title: 'Hello' });
const results = db.search(queryEmbedding, 10);

Browser (WASM)

npm install @ruvector/wasm
import { RuVectorWasm } from '@ruvector/wasm';
const db = await RuVectorWasm.create({ dimensions: 384 });
await db.insert('doc1', embedding);
const results = await db.search(query, 5);

CLI

cargo install ruvector-cli
ruvector init mydb --dim 1536
ruvector insert mydb --file embeddings.json
ruvector search mydb --query "[0.1, 0.2, ...]" --limit 10

HTTP Server

cargo install ruvector-server
ruvector-server --port 8080 --data ./vectors

# REST API
curl -X POST http://localhost:8080/search \
  -H "Content-Type: application/json" \
  -d '{"vector": [0.1, 0.2, ...], "limit": 10}'

Examples & Tutorials

πŸ“š Production Examples

50+ production-ready examples demonstrating RuVector integration patterns.

Boundary-First Discovery (NEW β€” 17 experiments, 7/7 real seizures detected)

Boundary-first detection finds hidden structure by analyzing WHERE correlations change β€” not WHERE individual measurements cross thresholds. Validated on real clinical EEG data from PhysioNet. Research paper | Seizure deep-dive

ExampleDescriptionKey Result
boundary-discoveryPhase transition detection proofz=-3.90
brain-boundary-discoverySeizure prediction 45s early (synthetic)z=-32.62
real-eeg-analysisReal CHB-MIT EEG seizure detectionz=-2.23, 274s warning
real-eeg-multi-seizure7/7 real seizures detected (100%)225s mean warning
seizure-therapeutic-simEntrainment delays seizure 60s+252% alpha restored
temporal-attractor-discovery3/3 regime transitions foundz=-6.83
weather-boundary-discovery20 days before thermometerz=-10.85
health-boundary-discovery13 days before clinical thresholdsz=-3.90
market-boundary-discovery42 days before market crashz=-3.90
music-boundary-discoveryGenre boundaries discoveredz=-13.01
seti-exotic-signals6/6 invisible signals found (trad: 0/6)z=-8.19
earthquake-boundary-discovery41 days before mainshockz=-2.29
pandemic-boundary-discovery50 days before outbreakz=-12.31
infrastructure-boundary-discovery179 days before bridge collapsez=-2.15

All Examples

ExampleDescriptionType
security_hardened.rvfSecurity RVF: 22 capabilities β€” TEE, AIDefence, eBPF, RBAC, Paranoid policyRust/RVF
agentic-jujutsuQuantum-resistant version control for AI agents (23x faster than Git)Rust
mincut6 self-organizing network demos: strange loops, time crystals, causal discoveryRust
subpolynomial-timen^0.12 subpolynomial algorithm demosRust
exo-ai-2025Cognitive substrate with 9 neural-symbolic crates + 11 research experimentsRust/TS
neural-traderAI trading with DRL + sentiment analysis + SONA learningRust
ultra-low-latency-sim13+ quadrillion meta-simulations/sec with SIMDRust
meta-cognition-spiking-neural-networkSpiking neural network with meta-cognitive learning (10-50x speedup)npm
spiking-networkBiologically-inspired spiking neural networksRust
ruvLLMLLM integration patterns for RAG and AI agentsRust
onnx-embeddingsProduction ONNX embedding generation without PythonRust
onnx-embeddings-wasmWASM ONNX embeddings for browsersWASM
refrag-pipelineRAG pipeline with vector search and document processingRust
scipixScientific OCR: equations β†’ LaTeX/MathML with ONNX inferenceRust
graphGraph database examples with Cypher queriesRust
edge364KB WASM edge deploymentRust
edge-fullFull-featured edge vector DBRust
edge-netNetworked edge deployment with zero-cost swarmsRust
vibecast-7sense7-sense perception AI applicationTypeScript
apify13 Apify actors: trading, memory engine, synth data, market researchnpm
google-cloudGCP templates for Cloud Run, GKE, Vertex AITerraform
wasm-reactReact integration with WASM vector operationsWASM
wasm-vanillaVanilla JS WASM example for browser vector searchWASM
wasmCore WASM examples and bindingsWASM
nodejsNode.js integration examplesNode.js
rustCore Rust usage examplesRust
dnarvDNA: AI-native genomic analysis, variant calling, .rvdna formatRust
delta-behaviorMathematics of systems that refuse to collapse β€” behavioral change trackingRust
dataDataset discovery framework β€” graph-based pattern finding in massive datasetsRust
prime-radiantPrime-Radiant coherence engine examples and usage demosRust
benchmarksComprehensive benchmarks for temporal reasoning and vector operationsRust
vwm-viewerVisual vector world model viewer (HTML Canvas)HTML
verified-applications10 exotic domains: weapons filter, medical diagnostics, financial routing, agent contracts, sensor swarm, quantization proof, AGI memory, vector signatures, simulation integrity, legal forensicsRust
rvf-kernel-optimizedVerified + hyper-optimized Linux kernel RVF with proof-carrying ingestRust
πŸŽ“ Tutorials

Tutorial 1: Vector Search in 60 Seconds

import { VectorDB } from 'ruvector';

// Create DB with 384-dimensional vectors
const db = new VectorDB(384);

// Add vectors
db.insert('doc1', [0.1, 0.2, ...]);  // 384 floats
db.insert('doc2', [0.3, 0.1, ...]);

// Search (returns top 5 nearest neighbors)
const results = db.search(queryVector, 5);
// -> [{ id: 'doc1', score: 0.95 }, { id: 'doc2', score: 0.87 }]

Tutorial 2: Graph Queries with Cypher

import { GraphDB } from 'ruvector';

const graph = new GraphDB();

// Create nodes and relationships
graph.query(`
  CREATE (a:Person {name: 'Alice', embedding: $emb1})
  CREATE (b:Person {name: 'Bob', embedding: $emb2})
  CREATE (a)-[:KNOWS {since: 2020}]->(b)
`, { emb1: aliceVector, emb2: bobVector });

// Hybrid query: graph traversal + vector similarity
const results = graph.query(`
  MATCH (p:Person)-[:KNOWS*1..3]->(friend)
  WHERE vector.similarity(friend.embedding, $query) > 0.8
  RETURN friend.name, vector.similarity(friend.embedding, $query) as score
  ORDER BY score DESC
`, { query: queryVector });

Tutorial 3: Self-Learning with SONA

use ruvector_sona::{SonaEngine, SonaConfig};

// Initialize SONA with LoRA adapters
let sona = SonaEngine::with_config(SonaConfig {
    hidden_dim: 256,
    lora_rank: 8,
    ewc_lambda: 0.4,  // Elastic Weight Consolidation
    ..Default::default()
});

// Record successful action
let mut trajectory = sona.begin_trajectory(query_embedding);
trajectory.add_step(result_embedding, vec![], 1.0);  // reward=1.0
sona.end_trajectory(trajectory, true);  // success=true

// SONA learns and improves future predictions
sona.force_learn();

// Later: get improved predictions
let prediction = sona.predict(&new_query_embedding);

Tutorial 4: Dynamic Min-Cut (n^0.12 Updates)

use ruvector_mincut::{DynamicMinCut, Graph};

// Build graph
let mut graph = Graph::new(100);  // 100 nodes
graph.add_edge(0, 1, 10.0);
graph.add_edge(1, 2, 5.0);
graph.add_edge(0, 2, 15.0);

// Compute initial min-cut
let mut mincut = DynamicMinCut::new(&graph);
let (value, cut_edges) = mincut.compute();
println!("Min-cut value: {}", value);  // -> 15.0

// Dynamic update - subpolynomial time O(n^0.12)!
graph.update_edge(1, 2, 20.0);
let (new_value, _) = mincut.recompute();  // Much faster than recomputing from scratch

Tutorial 5: 39 Attention Mechanisms

use ruvector_attention::{
    Attention, FlashAttention, LinearAttention,
    HyperbolicAttention, GraphAttention, MinCutGatedAttention
};

// FlashAttention - O(n) memory, fastest for long sequences
let flash = FlashAttention::new(512, 8);  // dim=512, heads=8
let output = flash.forward(&query, &key, &value);

// LinearAttention - O(n) time complexity
let linear = LinearAttention::new(512, 8);

// HyperbolicAttention - for hierarchical data (PoincarΓ© ball)
let hyper = HyperbolicAttention::new(512, 8, Curvature(-1.0));

// GraphAttention - respects graph structure
let gat = GraphAttention::new(512, 8, &adjacency_matrix);

// MinCutGatedAttention - 50% compute reduction via sparsity
let mincut_gated = MinCutGatedAttention::new(512, 8, sparsity: 0.5);
let sparse_output = mincut_gated.forward(&query, &key, &value);

Tutorial 6: Spiking Neural Networks

import { SpikingNetwork, HDCEncoder } from '@ruvector/spiking-neural';

// High-Dimensional Computing encoder (10K-bit vectors)
const encoder = new HDCEncoder(10000);
const encoded = encoder.encode("hello world");

// Spiking network with BTSP learning
const network = new SpikingNetwork({
  layers: [784, 256, 10],
  learning: 'btsp',  // Behavioral Time-Scale Plasticity
  threshold: 1.0
});

// Train with spike timing
network.train(spikes, labels, { epochs: 10 });

// Inference
const output = network.forward(inputSpikes);

Tutorial 7: Claude Code Hooks Integration

# 1. Initialize hooks
npx @ruvector/cli hooks init

# 2. Install into Claude settings
npx @ruvector/cli hooks install

# 3. Hooks now capture:
#    - File edits (pre/post)
#    - Commands (pre/post)
#    - Sessions (start/end)
#    - Errors and fixes

# 4. Query learned patterns
npx @ruvector/cli hooks recall "authentication error"
# -> Returns similar past solutions

# 5. Get AI routing suggestions
npx @ruvector/cli hooks route "implement caching"
# -> Suggests: rust-developer (confidence: 0.89)

Tutorial 8: Edge Deployment with rvLite

import { RvLite } from '@ruvector/rvlite';

// Create persistent edge database (IndexedDB in browser)
const db = await RvLite.create({
  path: 'my-vectors.db',
  dimensions: 384
});

// Works offline - all computation local
await db.insert('doc1', embedding1, { title: 'Hello' });
await db.insert('doc2', embedding2, { title: 'World' });

// Semantic search with metadata filtering
const results = await db.search(queryEmbedding, {
  limit: 10,
  filter: { title: { $contains: 'Hello' } }
});

// Sync when online
await db.sync('https://api.example.com/vectors');
πŸ• WASM & Utility Packages
PackageDescriptionVersionDownloads
@ruvector/wasmWASM core vector DBnpmdownloads
@ruvector/gnn-wasmWASM GNN layersnpmdownloads
@ruvector/graph-wasmWASM graph DBnpmdownloads
@ruvector/attention-wasmWASM attentionnpmdownloads
@ruvector/tiny-dancer-wasmWASM AI routingnpmdownloads
@ruvector/router-wasmWASM semantic routernpmdownloads
@ruvector/postgres-cliPostgres extension CLInpmdownloads
@ruvector/agentic-synthSynthetic data generatornpmdownloads
@ruvector/graph-data-generatorGraph data generationnpmdownloads
@ruvector/agentic-integrationAgentic workflowsnpmdownloads
rvliteSQLite-style edge DB (SQL/SPARQL/Cypher)npmdownloads

Platform-specific native bindings (auto-detected):

  • @ruvector/node-linux-x64-gnu, @ruvector/node-linux-arm64-gnu, @ruvector/node-darwin-x64, @ruvector/node-darwin-arm64, @ruvector/node-win32-x64-msvc
  • @ruvector/gnn-linux-x64-gnu, @ruvector/gnn-linux-arm64-gnu, @ruvector/gnn-darwin-x64, @ruvector/gnn-darwin-arm64, @ruvector/gnn-win32-x64-msvc
  • @ruvector/tiny-dancer-linux-x64-gnu, @ruvector/tiny-dancer-linux-arm64-gnu, @ruvector/tiny-dancer-darwin-x64, @ruvector/tiny-dancer-darwin-arm64, @ruvector/tiny-dancer-win32-x64-msvc
  • @ruvector/router-linux-x64-gnu, @ruvector/router-linux-arm64-gnu, @ruvector/router-darwin-x64, @ruvector/router-darwin-arm64, @ruvector/router-win32-x64-msvc
  • @ruvector/attention-linux-x64-gnu, @ruvector/attention-linux-arm64-gnu, @ruvector/attention-darwin-x64, @ruvector/attention-darwin-arm64, @ruvector/attention-win32-x64-msvc
  • @ruvector/ruvllm-linux-x64-gnu, @ruvector/ruvllm-linux-arm64-gnu, @ruvector/ruvllm-darwin-x64, @ruvector/ruvllm-darwin-arm64, @ruvector/ruvllm-win32-x64-msvc

See GitHub Issue #20 for multi-platform npm package roadmap.

# Install all-in-one package
npm install ruvector

# Or install individual packages
npm install @ruvector/core @ruvector/gnn @ruvector/graph-node

# List all available packages
npx ruvector install
const ruvector = require('ruvector');

// Vector search
const db = new ruvector.VectorDB(128);
db.insert('doc1', embedding1);
const results = db.search(queryEmbedding, 10);

// Graph queries (Cypher)
db.execute("CREATE (a:Person {name: 'Alice'})-[:KNOWS]->(b:Person {name: 'Bob'})");
db.execute("MATCH (p:Person)-[:KNOWS]->(friend) RETURN friend.name");

// GNN-enhanced search
const layer = new ruvector.GNNLayer(128, 256, 4);
const enhanced = layer.forward(query, neighbors, weights);

// Compression (2-32x memory savings)
const compressed = ruvector.compress(embedding, 0.3);

// Tiny Dancer: AI agent routing
const router = new ruvector.Router();
const decision = router.route(candidates, { optimize: 'cost' });
πŸ¦€ Rust Usage Examples
cargo add ruvector-graph ruvector-gnn
use ruvector_graph::{GraphDB, NodeBuilder};
use ruvector_gnn::{RuvectorLayer, differentiable_search};

let db = GraphDB::new();

let doc = NodeBuilder::new("doc1")
    .label("Document")
    .property("embedding", vec![0.1, 0.2, 0.3])
    .build();
db.create_node(doc)?;

// GNN layer
let layer = RuvectorLayer::new(128, 256, 4, 0.1);
let enhanced = layer.forward(&query, &neighbors, &weights);
use ruvector_raft::{RaftNode, RaftNodeConfig};
use ruvector_cluster::{ClusterManager, ConsistentHashRing};
use ruvector_replication::{SyncManager, SyncMode};

// Configure a 5-node Raft cluster
let config = RaftNodeConfig {
    node_id: "node-1".into(),
    cluster_members: vec!["node-1", "node-2", "node-3", "node-4", "node-5"]
        .into_iter().map(Into::into).collect(),
    election_timeout_min: 150,  // ms
    election_timeout_max: 300,  // ms
    heartbeat_interval: 50,     // ms
};
let raft = RaftNode::new(config);

// Auto-sharding with consistent hashing (150 virtual nodes per real node)
let ring = ConsistentHashRing::new(64, 3); // 64 shards, replication factor 3
let shard = ring.get_shard("my-vector-key");

// Multi-master replication with conflict resolution
let sync = SyncManager::new(SyncMode::SemiSync { min_replicas: 2 });
πŸŽ“ RuvLLM Training & RLM Fine-Tuning Tutorials

Hybrid Routing (90% Accuracy)

RuvLTRA achieves 90% routing accuracy using a keyword-first strategy with embedding fallback:

// Optimal routing: Keywords first, embeddings as tiebreaker
function routeTask(task, taskEmbedding, agentEmbeddings) {
  const keywordScores = getKeywordScores(task);
  const maxKw = Math.max(...Object.values(keywordScores));

  if (maxKw > 0) {
    const candidates = Object.entries(keywordScores)
      .filter(([_, score]) => score === maxKw)
      .map(([agent]) => agent);

    if (candidates.length === 1) return { agent: candidates[0] };
    return pickByEmbedding(candidates, taskEmbedding, agentEmbeddings);
  }

  return embeddingSimilarity(taskEmbedding, agentEmbeddings);
}

Run the benchmark: node npm/packages/ruvllm/scripts/hybrid-model-compare.js

Generate Training Data

# Using CLI (recommended)
npx @ruvector/ruvllm train stats              # View dataset statistics
npx @ruvector/ruvllm train dataset            # Export training data
npx @ruvector/ruvllm train contrastive        # Run full training pipeline

# With options
npx @ruvector/ruvllm train dataset --output ./my-training
npx @ruvector/ruvllm train contrastive --epochs 20 --batch-size 32 --lr 0.0001

Programmatic API:

import { ContrastiveTrainer, generateTrainingDataset, getDatasetStats } from '@ruvector/ruvllm';

const stats = getDatasetStats();
console.log(`${stats.totalExamples} examples, ${stats.agentTypes} agent types`);

const trainer = new ContrastiveTrainer({ epochs: 10, margin: 0.5 });
trainer.addTriplet(anchor, anchorEmb, positive, positiveEmb, negative, negativeEmb, true);
const result = trainer.train();
trainer.exportTrainingData('./output');

Fine-Tune with LoRA

pip install transformers peft datasets accelerate

python -m peft.lora_train \
  --model_name Qwen/Qwen2.5-0.5B-Instruct \
  --dataset ./data/training/routing-examples.jsonl \
  --output_dir ./ruvltra-routing-lora \
  --lora_r 8 --lora_alpha 16 \
  --num_train_epochs 3 \
  --learning_rate 2e-4

Convert to GGUF

# Merge LoRA weights
python -c "
from peft import PeftModel
from transformers import AutoModelForCausalLM
base = AutoModelForCausalLM.from_pretrained('Qwen/Qwen2.5-0.5B-Instruct')
model = PeftModel.from_pretrained(base, './ruvltra-routing-lora')
model.merge_and_unload().save_pretrained('./ruvltra-routing-merged')
"

# Convert and quantize
python llama.cpp/convert_hf_to_gguf.py ./ruvltra-routing-merged --outfile ruvltra-routing-f16.gguf
./llama.cpp/llama-quantize ruvltra-routing-f16.gguf ruvltra-routing-q4_k_m.gguf Q4_K_M

Contrastive Embedding Training

Using RuvLLM CLI (recommended):

# Full contrastive training pipeline with triplet loss
npx @ruvector/ruvllm train contrastive --output ./training-output

# Exports: triplets.jsonl, embeddings.json, lora_config.json, train.sh

Using Python (for GPU training):

from sentence_transformers import SentenceTransformer, losses, InputExample
from torch.utils.data import DataLoader

train_examples = [
    InputExample(texts=["implement login", "build auth component"], label=1.0),
    InputExample(texts=["implement login", "write unit tests"], label=0.0),
]

model = SentenceTransformer("Qwen/Qwen2.5-0.5B-Instruct")
train_loss = losses.CosineSimilarityLoss(model)
model.fit([(DataLoader(train_examples, batch_size=16), train_loss)], epochs=5)

Resources: Issue #122 | LoRA Paper | Sentence Transformers

Rust Training Module

For production-scale dataset generation, use the Rust training module (full docs):

use ruvllm::training::{DatasetGenerator, DatasetConfig};

let config = DatasetConfig {
    examples_per_category: 100,
    enable_augmentation: true,
    seed: 42,
    ..Default::default()
};

let dataset = DatasetGenerator::new(config).generate();
let (train, val, test) = dataset.split(0.7, 0.15, 0.15, 42);
dataset.export_jsonl("training.jsonl")?;

Features:

  • 5 agent categories: Coder, Researcher, Security, Architecture, Reviewer (20% each)
  • Model routing: Haiku (simple) β†’ Sonnet (moderate) β†’ Opus (complex/security)
  • Data augmentation: Paraphrasing, complexity variations, domain transfer
  • 8 technical domains: Web, Systems, DataScience, Mobile, DevOps, Security, Database, API
  • Quality scores: 0.80-0.96 based on template quality and category
  • Performance: ~10,000 examples/second, ~50 MB/s JSONL export
cargo run --example generate_claude_dataset --release
# Outputs: train.jsonl, val.jsonl, test.jsonl, stats.json

Project

πŸ“ Project Structure
crates/
β”œβ”€β”€ ruvector-core/           # Vector DB engine (HNSW, storage)
β”œβ”€β”€ ruvector-graph/          # Graph DB + Cypher parser + Hyperedges
β”œβ”€β”€ ruvector-gnn/            # GNN layers, compression, training
β”œβ”€β”€ ruvector-tiny-dancer-core/  # AI agent routing (FastGRNN)
β”œβ”€β”€ ruvector-*-wasm/         # WebAssembly bindings
β”œβ”€β”€ ruvector-*-node/         # Node.js bindings (napi-rs)
└── rvf/                     # RVF Cognitive Containers (13 crates)
    β”œβ”€β”€ rvf-types/           #   Segment types, headers (no_std)
    β”œβ”€β”€ rvf-runtime/         #   Store API, COW engine, compaction
    β”œβ”€β”€ rvf-kernel/          #   Linux kernel builder
    β”œβ”€β”€ rvf-ebpf/            #   eBPF programs (XDP/TC/socket)
    β”œβ”€β”€ rvf-launch/          #   QEMU microvm launcher
    β”œβ”€β”€ rvf-cli/             #   CLI with 17 subcommands
    └── ...                  #   wire, manifest, index, quant, crypto, server, import

Contributing

We welcome contributions! See CONTRIBUTING.md.

# Run tests
cargo test --workspace

# Run benchmarks
cargo bench --workspace

# Build WASM
cargo build -p ruvector-gnn-wasm --target wasm32-unknown-unknown

License

MIT License β€” free for commercial and personal use.


Built by rUv β€’ GitHub β€’ npm β€’ crates.io β€’ Docs β€’ RVF

Vector search that gets smarter over time β€” now shipping as cognitive containers.