@omendb/omendb 0.0.9 → 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.
Files changed (2) hide show
  1. package/index.d.ts +27 -4
  2. package/package.json +5 -5
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 | null
39
+ get efSearch(): number
42
40
  /** Set ef_search value. */
43
41
  set efSearch(efSearch: number)
44
- /** Get or create a named collection. */
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@omendb/omendb",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Fast embedded vector database with HNSW indexing",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -49,9 +49,9 @@
49
49
  "omendb.node"
50
50
  ],
51
51
  "optionalDependencies": {
52
- "@omendb/omendb-darwin-x64": "0.0.9",
53
- "@omendb/omendb-darwin-arm64": "0.0.9",
54
- "@omendb/omendb-linux-x64-gnu": "0.0.9",
55
- "@omendb/omendb-linux-arm64-gnu": "0.0.9"
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
56
  }
57
57
  }