@omendb/omendb 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +27 -4
- package/package.json +55 -55
package/index.d.ts
CHANGED
|
@@ -33,15 +33,18 @@ export declare class VectorDatabase {
|
|
|
33
33
|
delete(ids: Array<string>): number
|
|
34
34
|
/** Update a vector's data and/or metadata. */
|
|
35
35
|
update(id: string, vector: Array<number> | Float32Array, metadata?: Record<string, unknown> | undefined): void
|
|
36
|
-
/** Save database to disk. */
|
|
37
|
-
save(): void
|
|
38
36
|
/** Get number of vectors in database. */
|
|
39
37
|
get count(): number
|
|
40
38
|
/** Get current ef_search value. */
|
|
41
|
-
get efSearch(): number
|
|
39
|
+
get efSearch(): number
|
|
42
40
|
/** Set ef_search value. */
|
|
43
41
|
set efSearch(efSearch: number)
|
|
44
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Get or create a named collection.
|
|
44
|
+
*
|
|
45
|
+
* Collection handles share state - changes made through one handle
|
|
46
|
+
* are immediately visible through another (no flush required).
|
|
47
|
+
*/
|
|
45
48
|
collection(name: string): VectorDatabase
|
|
46
49
|
/** List all collections. */
|
|
47
50
|
collections(): Array<string>
|
|
@@ -125,6 +128,14 @@ export interface GetResult {
|
|
|
125
128
|
* dimensions: 128,
|
|
126
129
|
* quantization: 4 // 4-bit quantization
|
|
127
130
|
* });
|
|
131
|
+
*
|
|
132
|
+
* // Quantization with custom rescore settings
|
|
133
|
+
* const db = omendb.open("./mydb", {
|
|
134
|
+
* dimensions: 128,
|
|
135
|
+
* quantization: 4,
|
|
136
|
+
* rescore: false, // Disable rescore for max speed
|
|
137
|
+
* oversample: 5.0 // Or increase oversample for better recall
|
|
138
|
+
* });
|
|
128
139
|
* ```
|
|
129
140
|
*/
|
|
130
141
|
export declare function open(path: string, options?: OpenOptions | undefined | null): VectorDatabase
|
|
@@ -138,6 +149,8 @@ export declare function open(path: string, options?: OpenOptions | undefined | n
|
|
|
138
149
|
* - efConstruction: 100 (build quality, higher = better graph, slower build)
|
|
139
150
|
* - efSearch: 100 (search quality, higher = better recall, slower search)
|
|
140
151
|
* - quantization: null (RaBitQ bit width: 2, 4, or 8 for compression)
|
|
152
|
+
* - rescore: true when quantization enabled (rerank candidates with exact distance)
|
|
153
|
+
* - oversample: 3.0 (fetch k*oversample candidates when rescoring)
|
|
141
154
|
*/
|
|
142
155
|
export interface OpenOptions {
|
|
143
156
|
/** Vector dimensions (default: 128, auto-detected on first insert) */
|
|
@@ -153,6 +166,16 @@ export interface OpenOptions {
|
|
|
153
166
|
* Enables 4-16x memory compression with ~1-2% recall loss
|
|
154
167
|
*/
|
|
155
168
|
quantization?: number
|
|
169
|
+
/**
|
|
170
|
+
* Rescore candidates with exact distance (default: true when quantization enabled)
|
|
171
|
+
* Set to false for maximum speed at the cost of ~20% recall
|
|
172
|
+
*/
|
|
173
|
+
rescore?: boolean
|
|
174
|
+
/**
|
|
175
|
+
* Oversampling factor for rescoring (default: 3.0)
|
|
176
|
+
* Fetches k*oversample candidates then reranks to return top k
|
|
177
|
+
*/
|
|
178
|
+
oversample?: number
|
|
156
179
|
}
|
|
157
180
|
|
|
158
181
|
export interface SearchResult {
|
package/package.json
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
2
|
+
"name": "@omendb/omendb",
|
|
3
|
+
"version": "0.0.10",
|
|
4
|
+
"description": "Fast embedded vector database with HNSW indexing",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/omendb/omendb"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"vector",
|
|
13
|
+
"database",
|
|
14
|
+
"embeddings",
|
|
15
|
+
"hnsw",
|
|
16
|
+
"similarity-search",
|
|
17
|
+
"ai",
|
|
18
|
+
"machine-learning",
|
|
19
|
+
"napi-rs",
|
|
20
|
+
"rust"
|
|
21
|
+
],
|
|
22
|
+
"author": "Nick Jaru",
|
|
23
|
+
"license": "Apache-2.0",
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">= 18"
|
|
26
|
+
},
|
|
27
|
+
"napi": {
|
|
28
|
+
"binaryName": "omendb",
|
|
29
|
+
"packageName": "@omendb/omendb",
|
|
30
|
+
"targets": [
|
|
31
|
+
"x86_64-apple-darwin",
|
|
32
|
+
"aarch64-apple-darwin",
|
|
33
|
+
"x86_64-unknown-linux-gnu",
|
|
34
|
+
"aarch64-unknown-linux-gnu"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "napi build --release",
|
|
39
|
+
"build:debug": "napi build",
|
|
40
|
+
"test": "vitest run"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@napi-rs/cli": "^3.5.0",
|
|
44
|
+
"vitest": "^2.1.0"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"index.js",
|
|
48
|
+
"index.d.ts",
|
|
49
|
+
"omendb.node"
|
|
50
|
+
],
|
|
51
|
+
"optionalDependencies": {
|
|
52
|
+
"@omendb/omendb-darwin-x64": "0.0.10",
|
|
53
|
+
"@omendb/omendb-darwin-arm64": "0.0.10",
|
|
54
|
+
"@omendb/omendb-linux-x64-gnu": "0.0.10",
|
|
55
|
+
"@omendb/omendb-linux-arm64-gnu": "0.0.10"
|
|
56
|
+
}
|
|
57
57
|
}
|