@rbalchii/native-vector
v1.0.1
Published
Sovereign Native Vector Search Module (Custom C++ Addon with USearch)
Readme
@rbalchii/native-vector
Sovereign Native Vector Search Module for Anchor OS.
Overview
This module provides high-performance, local-only vector search capabilities using optimal SIMD instructions and memory-mapped files. It is designed to replace external vector databases with a lightweight, embedded solution that respects node-id sovereignty.
Features
- High Performance: Native C++ addon using USearch.
- Memory Efficient: Uses memory-mapped files (mmap) for zero-copy loading.
- Hardware Acceleration: Automatically selects AVX2 or SSE4.1 kernels.
- Sovereign: No external API calls; all data remains local.
Installation
npm install @rbalchii/native-vectorUsage
import { SoulIndex } from '@rbalchii/native-vector';
// Initialize with 768 dimensions (default)
const index = new SoulIndex(768);
// Add vector (ID must be integer)
index.add(1, new Float32Array([...]));
// Search (returns IDs and Distances)
const results = index.search(new Float32Array([...]), 10);
// Save/Load
index.save('./memory.index');
index.view('./memory.index'); // mmap (instant)Architecture
- Core: C++ N-API wrapper around
usearch. - Prebuilds:
node-gyp-buildloads the correct binary for the architecture.
