Package Exports
- vectlite
- vectlite/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vectlite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Node Binding
The Node binding now exists in-repo and builds from source.
Current state:
- Rust addon implemented with
napi-rs - JavaScript wrapper and TypeScript declarations included
- local smoke test available in
bindings/node/tests - npm package can be published as a source-build package
- installing the npm package requires a working Rust toolchain on the target machine
Local Build
From the repository root:
cd bindings/node
npm run buildThis compiles the Rust addon and writes bindings/node/vectlite.node.
Local Test
cd bindings/node
npm testnpm Package Model
The npm package is set up as a source-build package:
prepackstages a self-contained native crate plus the core Rust crateinstallcompiles the addon with Cargo on the target machine- the published tarball does not ship prebuilt binaries yet
That keeps one source of truth for the Rust core, but it means npm install vectlite requires:
- Node 18+
- Rust/Cargo installed
- registry/network access to fetch Rust crates during the build
Usage
const { open, sparseTerms } = require('./index.js')
const db = open('knowledge.vdb', { dimension: 384 })
db.upsert('doc1', embedding, { source: 'notes', title: 'Auth Guide' })
const results = db.search(queryEmbedding, {
k: 5,
sparse: sparseTerms('auth guide'),
filter: { source: 'notes' },
})Scope
The initial Node surface covers the core database and store operations:
open,openStore,restoreinsert,upsert,get,delete- batch writes and bulk ingest
- snapshots, backup, compact, flush
- namespaces and collections
- dense, sparse, and hybrid search
- search stats and text helpers
Not yet included:
- JS callback rerank hooks
- prebuilt binaries