Registry / vector-search / ruvector

ruvector

JSON →
library0.2.23jsnpmunverified

RuVector is a self-learning vector database for Node.js built in Rust, offering sub-millisecond hybrid search, Graph RAG, FlashAttention-3, HNSW, and DiskANN, with over 50 attention mechanisms. Current stable version is 2.2.0, with frequent releases (weekly to monthly). Key differentiators: single npm package, no external services required, native Node.js performance via Rust native bindings with WASM fallback, TypeScript-first API, and built-in self-learning capabilities. It integrates deeply with the Claude Code ecosystem and provides enterprise-grade features like ONNX embeddings, AST analysis, and security scanning.

npm install ruvector
INSTALL
IMPORT
SIG · RUVECTOR
R
ruvector
vector-searchjavascriptv0.2.23
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import RuVector from '@ruvector/attention'
const RuVector = require('@ruvector/attention')
ESM-only since v2.0. The main entry point is @ruvector/attention, not ruvector.
HybridSearch
import { HybridSearch } from '@ruvector/attention'
import { HybridSearch } from 'ruvector'
Named export available from @ruvector/attention. Requires peer dep @ruvector/router.
HNSWIndex
import { HNSWIndex } from '@ruvector/attention'
import { HNSWIndex } from 'hnswlib'
RuVector provides its own HNSW implementation; do not mix with hnswlib.

Demonstrates core operations: creating a vector database, adding vectors, hybrid search, FlashAttention-3, and HNSW indexing.

import RuVector, { HNSWIndex, HybridSearch, FlashAttention } from '@ruvector/attention' // Create a new vector database instance const db = new RuVector({ dimension: 384, metric: 'cosine' }) // Add vectors with metadata const id1 = await db.add([0.1, 0.2, 0.3, /* ... 384-d vector */], { label: 'doc1' }) const id2 = await db.add([0.4, 0.5, 0.6, /* ... */], { label: 'doc2' }) // Perform hybrid search (sparse + dense fusion) const hybrid = new HybridSearch(db, { alpha: 0.5 }) const results = await hybrid.search([0.1, 0.2, 0.3], { topK: 5, rerank: true }) console.log('Hybrid results:', results) // Use FlashAttention-3 for exact nearest neighbor const attn = new FlashAttention({ heads: 8, headDim: 64 }) const scores = await attn.compute(queryVectors, keyVectors) // Build HNSW index for fast approximate search const index = new HNSWIndex({ dimension: 384, M: 16, efConstruction: 200 }) await index.build(vectors) const neighbors = await index.search(query, 10) console.log('ANN neighbors:', neighbors) // Persist to disk using DiskANN await db.save('./my_index.ruv')
Debug
Known issues
breakingSince v2.0.0, the package has moved from default export 'ruvector' to package '@ruvector/attention'. All imports from 'ruvector' will fail.
fix
Change imports to use '@ruvector/attention' instead of 'ruvector'.
affects: >=2.0.0
breakingNode.js <18.0.0 is no longer supported. Engine requirement is >=18.0.0.
fix
Upgrade Node.js to version 18 or later.
affects: >=2.0.0
deprecatedThe 'ruvector' package on npm is legacy and will not receive updates. Use '@ruvector/attention' for all new projects.
fix
Migrate to @ruvector/attention.
affects: >=2.0.0
gotchaThe package uses native Node.js addons (N-API) by default. If they fail to load, it falls back to WASM, which may be slower and lack some features (e.g., DiskANN).
fix
Ensure your platform is supported or set environment variable RUVECTOR_FORCE_WASM=1 to force WASM.
affects: *
gotchaHybridSearch requires both 'alpha' parameter in constructor and both sparse/dense indexes to be built. Missing one will cause silent fallback to dense-only.
fix
Always ensure both sparse (e.g., SPLADE) and dense indexes are added to the database before using HybridSearch.
affects: >=2.1.0
breakingIn v0.x to v1.x migration, the API for adding vectors changed from 'db.add(vector, metadata)' to 'db.add({ vector, metadata })' as an object parameter.
fix
Update calls to pass an object with 'vector' and 'metadata' keys.
affects: >=1.0.0 <2.0.0
Errors
Common errors & fixes
Error: Cannot find module '@ruvector/attention' or 'ruvector'
Package not installed or wrong package name used.
fix
Install the correct package: npm install @ruvector/attention
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using CommonJS require() with an ESM-only package.
fix
Use import syntax or set type: module in package.json. Alternatively, use dynamic import().
TypeError: RuVector is not a constructor
Importing the wrong default export, possibly from an older version or wrong subpackage.
fix
Use import RuVector from '@ruvector/attention' (default export) and ensure version >=2.0.0.
Uncaught RuntimeError: memory access out of bounds (WASM)
Native addon failed to load, falling back to WASM with insufficient memory allocation.
fix
Set RUVECTOR_FORCE_WASM=1 and allocate more memory via WebAssembly.Memory, or install platform-specific native package.
Upgrade
Version history
0.2.23latest on npm
Audit
Dependencies
@ruvector/pi-brainrequiredProvides neural attention and memory subsystems required by the core vector operations
@ruvector/routerrequiredHandles intelligent agent routing and query distribution across vector indexes
@ruvector/ruvllmrequiredEnables LLM integration for Graph RAG and natural language query parsing
@ruvector/diskannrequiredProvides DiskANN and Vamana graph-based ANN for large-scale persistent storage
Agent activity
59 hits · last 30 days
node
52
OpenAI (training)
1
Resources