File size: 1,625 Bytes
40d7073 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # RuVector — Bug Fixes
This is a patched version of [ruvector](https://github.com/ruvector/ruvector) with two critical bugs fixed.
## Bugs Fixed
### Bug 1: CLI `create` command fails with "Missing field `dimensions`"
**Symptom:** `npx ruvector create ./db -d 384` fails with `Missing field 'dimensions'`
**Root Cause:** The CLI passes `{ dimension: 384 }` (singular) to the `VectorDB` constructor, but the native Rust binding (`@ruvector/core`) expects `{ dimensions: 384 }` (plural).
**Fix:** The `VectorDBWrapper` constructor now normalizes `dimension` → `dimensions` automatically. (`dist/index.js`)
### Bug 2: JS API insert fails with "Dimension mismatch: expected 384, got 0"
**Symptom:** `await db.insert([...384 floats...], metadata)` fails with dimension mismatch even though the vector has the correct length.
**Root Cause:** The `insert()` method only accepted object-style args `insert({vector, metadata})`, but users naturally call it with positional args `insert(vector, metadata)`. When a Float32Array was passed as the first arg, `entry.vector` was `undefined`, creating an empty Float32Array(0).
**Fix:** Both `insert()` and `search()` now accept positional arguments in addition to object-style:
- `db.insert(vector, metadata)` — positional style (new)
- `db.insert({vector, metadata})` — object style (still works)
- `db.search(vector, k)` — positional style (new)
- `db.search({vector, k})` — object style (still works)
## Files Modified
- `dist/index.js` — VectorDBWrapper class (constructor, insert, search methods)
## Original Repository
https://github.com/ruvector/ruvector
|