Squashed 'vendor/ruvector/' content from commit b64c2172

git-subtree-dir: vendor/ruvector
git-subtree-split: b64c21726f2bb37286d9ee36a7869fef60cc6900
This commit is contained in:
ruv
2026-02-28 14:39:40 -05:00
commit d803bfe2b1
7854 changed files with 3522914 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
/**
* Native binding wrapper for linux-x64
*/
const nativeBinding = require('./ruvector.node');
// The native module exports VectorDb (lowercase 'b') but we want VectorDB
// Also need to add the withDimensions static method since it's not exported properly
class VectorDB {
constructor(options) {
// Create internal instance
this._db = new nativeBinding.VectorDb(options);
}
static withDimensions(dimensions) {
// Factory method - create with default options
return new VectorDB({
dimensions: dimensions,
distanceMetric: 'Cosine',
storagePath: './ruvector.db'
});
}
async insert(entry) {
return this._db.insert(entry);
}
async insertBatch(entries) {
return this._db.insertBatch(entries);
}
async search(query) {
return this._db.search(query);
}
async delete(id) {
return this._db.delete(id);
}
async get(id) {
return this._db.get(id);
}
async len() {
return this._db.len();
}
async isEmpty() {
return this._db.isEmpty();
}
}
module.exports = {
VectorDB,
CollectionManager: nativeBinding.CollectionManager,
version: nativeBinding.version,
hello: nativeBinding.hello,
getMetrics: nativeBinding.getMetrics,
getHealth: nativeBinding.getHealth,
DistanceMetric: nativeBinding.JsDistanceMetric
};

Binary file not shown.