ruvector/npm/packages/graph-node/index.js
Claude f3f7a95752 feat: Add Neo4j-compatible hypergraph database package (ruvector-graph)
Major new package implementing a distributed hypergraph database with:

## Core Components (crates/ruvector-graph/)
- Cypher-compatible query parser with lexer, AST, optimizer
- Query execution engine with SIMD optimization and parallel execution
- ACID transaction support with MVCC isolation levels
- Distributed consensus and federation layer
- Vector-graph hybrid queries for AI/RAG workloads
- Performance optimizations (100x faster than Neo4j target)

## Bindings
- WASM bindings (crates/ruvector-graph-wasm/)
- NAPI-RS Node.js bindings (crates/ruvector-graph-node/)
- NPM packages for both targets

## CLI Integration
- 8 new graph commands: create, query, shell, import, export, info, benchmark, serve

## CI/CD
- Updated build-native.yml for graph packages
- New graph-ci.yml for testing and benchmarks
- New graph-release.yml for automated publishing

## Data Generation
- OpenRouter/Kimi K2 integration (packages/graph-data-generator/)
- Agentic-synth benchmark suite integration

## Tests & Benchmarks
- 11 test files covering all components
- Criterion benchmarks for performance validation
- Neo4j compatibility test suite

## Architecture Highlights
- CSR graph layout for cache-friendly access
- SIMD-vectorized query operators
- Roaring bitmaps for label indexes
- Bloom filters for fast negative lookups
- Adaptive radix tree for property indexes

Note: This is a comprehensive implementation created by 15 parallel agents.
Some integration fixes may be needed to resolve cross-module dependencies.

Co-authored-by: Claude AI Swarm <swarm@claude.ai>
2025-11-25 23:11:54 +00:00

45 lines
1.1 KiB
JavaScript

const { platform, arch } = process;
// Platform mapping
const platformMap = {
'linux': {
'x64': '@ruvector/graph-node-linux-x64-gnu',
'arm64': '@ruvector/graph-node-linux-arm64-gnu'
},
'darwin': {
'x64': '@ruvector/graph-node-darwin-x64',
'arm64': '@ruvector/graph-node-darwin-arm64'
},
'win32': {
'x64': '@ruvector/graph-node-win32-x64-msvc'
}
};
function loadNativeModule() {
const platformPackage = platformMap[platform]?.[arch];
if (!platformPackage) {
throw new Error(
`Unsupported platform: ${platform}-${arch}\n` +
`RuVector Graph Node native module is available for:\n` +
`- Linux (x64, ARM64)\n` +
`- macOS (x64, ARM64)\n` +
`- Windows (x64)`
);
}
try {
return require(platformPackage);
} catch (error) {
if (error.code === 'MODULE_NOT_FOUND') {
throw new Error(
`Native module not found for ${platform}-${arch}\n` +
`Please install: npm install ${platformPackage}\n` +
`Or reinstall @ruvector/graph-node to get optional dependencies`
);
}
throw error;
}
}
module.exports = loadNativeModule();