endee 1.0.3 → 1.0.4-beta.2
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/README.md +174 -3
- package/dist/endee.d.ts +2 -2
- package/dist/endee.d.ts.map +1 -1
- package/dist/endee.js +27 -9
- package/dist/endee.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/indexClient.d.ts +4 -2
- package/dist/indexClient.d.ts.map +1 -1
- package/dist/indexClient.js +64 -12
- package/dist/indexClient.js.map +1 -1
- package/dist/types/index.d.ts +24 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +8 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Endee is a TypeScript client for a vector database designed for maximum speed an
|
|
|
7
7
|
- **TypeScript First**: Full type safety and IntelliSense support
|
|
8
8
|
- **Fast ANN Searches**: Efficient similarity searches on vector data
|
|
9
9
|
- **Multiple Distance Metrics**: Support for cosine, L2, and inner product distance metrics
|
|
10
|
+
- **Hybrid Indexes**: Support for dense vectors, sparse vectors, and hybrid (dense + sparse) searches
|
|
10
11
|
- **Metadata Support**: Attach and search with metadata and filters
|
|
11
12
|
- **Client-Side Encryption**: Optional AES-256 encryption for your metadata
|
|
12
13
|
- **High Performance**: Optimized for speed and efficiency
|
|
@@ -29,7 +30,7 @@ npm install endee
|
|
|
29
30
|
## Quick Start
|
|
30
31
|
|
|
31
32
|
```typescript
|
|
32
|
-
import { Endee } from "endee";
|
|
33
|
+
import { Endee, Precision } from "endee";
|
|
33
34
|
|
|
34
35
|
// Initialize client with your Auth token
|
|
35
36
|
const endee = new Endee("<auth-token>");
|
|
@@ -83,6 +84,8 @@ const endee = new Endee();
|
|
|
83
84
|
### Managing Indexes
|
|
84
85
|
|
|
85
86
|
```typescript
|
|
87
|
+
import { Precision } from "endee";
|
|
88
|
+
|
|
86
89
|
// List all indexes
|
|
87
90
|
const indexes = await endee.listIndexes();
|
|
88
91
|
|
|
@@ -93,7 +96,8 @@ await endee.createIndex({
|
|
|
93
96
|
spaceType: "l2", // space type (cosine, l2, ip)
|
|
94
97
|
M: 32, // M: Graph connectivity parameter
|
|
95
98
|
efCon: 256, // efCon: Construction-time parameter
|
|
96
|
-
precision:
|
|
99
|
+
precision: Precision.INT8D // Quantization precision (default: Precision.INT8D)
|
|
100
|
+
sparseDimension: 1000 // Optional: Enable hybrid index with sparse dimension
|
|
97
101
|
});
|
|
98
102
|
|
|
99
103
|
// Delete an index
|
|
@@ -142,6 +146,142 @@ const description = await index.describe();
|
|
|
142
146
|
console.log(description);
|
|
143
147
|
```
|
|
144
148
|
|
|
149
|
+
## Hybrid Indexes
|
|
150
|
+
|
|
151
|
+
Endee supports **Hybrid Indexes** that combine dense vectors with sparse vectors, enabling powerful search capabilities. Hybrid indexes allow you to:
|
|
152
|
+
|
|
153
|
+
- Store both dense embeddings (e.g., from neural networks) and sparse features (e.g., keyword frequencies, categorical encodings)
|
|
154
|
+
- Perform dense-only searches (traditional vector similarity)
|
|
155
|
+
- Perform sparse-only searches (keyword/feature matching)
|
|
156
|
+
- Perform hybrid searches (combining both dense and sparse signals)
|
|
157
|
+
|
|
158
|
+
### Creating a Hybrid Index
|
|
159
|
+
|
|
160
|
+
To create a hybrid index, specify the `sparseDimension` parameter when creating an index:
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
// Create a hybrid index with dense dimension 384 and sparse dimension 10000
|
|
164
|
+
await endee.createIndex({
|
|
165
|
+
name: "hybrid_index",
|
|
166
|
+
dimension: 384, // Dense vector dimension
|
|
167
|
+
sparseDimension: 10000, // Sparse vector dimension (max index value)
|
|
168
|
+
spaceType: "cosine",
|
|
169
|
+
precision: "medium"
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// Get the hybrid index reference
|
|
173
|
+
const index = await endee.getIndex("hybrid_index");
|
|
174
|
+
|
|
175
|
+
// Check if index is hybrid
|
|
176
|
+
const description = index.describe();
|
|
177
|
+
console.log(description.isHybrid); // true
|
|
178
|
+
console.log(description.sparseDimension); // 10000
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Upserting Vectors with Sparse Data
|
|
182
|
+
|
|
183
|
+
When working with a hybrid index, you can insert vectors with both dense and sparse components:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
// Insert vectors with both dense and sparse components (hybrid index only)
|
|
187
|
+
await index.upsert([
|
|
188
|
+
{
|
|
189
|
+
id: "doc2",
|
|
190
|
+
vector: [0.2, 0.3, 0.4, /* ... 384 dimensions */], // Dense vector
|
|
191
|
+
sparseIndices: [5, 42, 100, 500], // Sparse feature indices
|
|
192
|
+
sparseValues: [0.8, 0.6, 0.9, 0.7], // Sparse feature values
|
|
193
|
+
meta: { title: "Document 2", category: "tech" }
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: "doc3",
|
|
197
|
+
vector: [0.3, 0.4, 0.5, /* ... 384 dimensions */],
|
|
198
|
+
sparseIndices: [10, 25, 200],
|
|
199
|
+
sparseValues: [0.5, 0.4, 0.6],
|
|
200
|
+
meta: { title: "Document 3", category: "science" }
|
|
201
|
+
}
|
|
202
|
+
]);
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Important Notes:**
|
|
206
|
+
- `sparseIndices` and `sparseValues` must have the same length
|
|
207
|
+
- Sparse indices must be in the range `[0, sparseDimension)`
|
|
208
|
+
- Both `sparseIndices` and `sparseValues` must be provided together (or both omitted)
|
|
209
|
+
- You cannot insert sparse data into a dense-only index (one created without `sparseDimension`)
|
|
210
|
+
|
|
211
|
+
### Querying Hybrid Indexes
|
|
212
|
+
|
|
213
|
+
Hybrid indexes support three types of searches:
|
|
214
|
+
|
|
215
|
+
#### 1. Dense Search (Traditional Vector Similarity)
|
|
216
|
+
|
|
217
|
+
Search using only the dense vector component:
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
const results = await index.query({
|
|
221
|
+
vector: [0.2, 0.3, 0.4, /* ... 384 dimensions */], // Query dense vector
|
|
222
|
+
topK: 10,
|
|
223
|
+
ef: 128
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// Results are ranked by dense vector similarity
|
|
227
|
+
for (const item of results) {
|
|
228
|
+
console.log(`ID: ${item.id}, Similarity: ${item.similarity}`);
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### 2. Sparse Search (Keyword/Feature Matching)
|
|
233
|
+
|
|
234
|
+
Search using only the sparse component:
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
const results = await index.query({
|
|
238
|
+
sparseIndices: [5, 42, 100], // Query sparse feature indices
|
|
239
|
+
sparseValues: [0.8, 0.6, 0.9], // Query sparse feature values
|
|
240
|
+
topK: 10,
|
|
241
|
+
ef: 128
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
// Results are ranked by sparse vector similarity
|
|
245
|
+
for (const item of results) {
|
|
246
|
+
console.log(`ID: ${item.id}, Similarity: ${item.similarity}`);
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
#### 3. Hybrid Search (Combined Dense + Sparse)
|
|
251
|
+
|
|
252
|
+
Search using both dense and sparse components for the most powerful results:
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
const results = await index.query({
|
|
256
|
+
vector: [0.2, 0.3, 0.4, /* ... 384 dimensions */], // Dense query
|
|
257
|
+
sparseIndices: [5, 42, 100], // Sparse query indices
|
|
258
|
+
sparseValues: [0.8, 0.6, 0.9], // Sparse query values
|
|
259
|
+
topK: 10,
|
|
260
|
+
ef: 128
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
// Results combine both dense and sparse signals
|
|
264
|
+
for (const item of results) {
|
|
265
|
+
console.log(`ID: ${item.id}, Similarity: ${item.similarity}`);
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Use Cases for Hybrid Indexes
|
|
270
|
+
|
|
271
|
+
Hybrid indexes are ideal for scenarios where you want to combine:
|
|
272
|
+
|
|
273
|
+
- **Semantic similarity** (dense embeddings from transformers) with **keyword matching** (sparse TF-IDF or BM25 features)
|
|
274
|
+
- **Neural embeddings** with **categorical features** or **one-hot encodings**
|
|
275
|
+
- **Content-based recommendations** (dense) with **collaborative filtering signals** (sparse)
|
|
276
|
+
|
|
277
|
+
### Key Points
|
|
278
|
+
|
|
279
|
+
- **Hybrid indexes are optional**: Create them only when you need sparse vector support
|
|
280
|
+
- **Dense-only indexes**: Work with traditional dense vectors only (no sparse support)
|
|
281
|
+
- **Sparse data validation**: The system validates sparse indices are within bounds and arrays match in length
|
|
282
|
+
- **Flexible querying**: You can query with dense only, sparse only, or both on hybrid indexes
|
|
283
|
+
- **Backward compatible**: Dense-only indexes continue to work as before
|
|
284
|
+
|
|
145
285
|
## Filtering
|
|
146
286
|
|
|
147
287
|
Endee supports structured filtering using operators like `$eq`, `$in`, and `$range`. For detailed documentation on filtering, see the [official documentation](https://docs.endee.io/sdks/typescript/usage#filtered-querying).
|
|
@@ -214,6 +354,36 @@ for (const item of results) {
|
|
|
214
354
|
- **Key verification**: The system verifies the key checksum when accessing an encrypted index
|
|
215
355
|
- **No key recovery**: Lost keys cannot be recovered; encrypted data becomes inaccessible
|
|
216
356
|
|
|
357
|
+
## Precision Options
|
|
358
|
+
|
|
359
|
+
Endee supports different quantization precision levels to optimize storage and performance:
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
import { Precision } from "endee";
|
|
363
|
+
|
|
364
|
+
// Available precision options:
|
|
365
|
+
Precision.BINARY // Binary quantization (1-bit) - smallest storage, fastest search
|
|
366
|
+
Precision.INT8D // 8-bit integer quantization (default) - balanced performance
|
|
367
|
+
Precision.INT16D // 16-bit integer quantization - higher precision
|
|
368
|
+
Precision.FLOAT16 // 16-bit floating point - good balance
|
|
369
|
+
Precision.FLOAT32 // 32-bit floating point - highest precision
|
|
370
|
+
|
|
371
|
+
// Example usage:
|
|
372
|
+
await endee.createIndex({
|
|
373
|
+
name: "high_precision_index",
|
|
374
|
+
dimension: 1536,
|
|
375
|
+
spaceType: "cosine",
|
|
376
|
+
precision: Precision.FLOAT32 // Use full precision
|
|
377
|
+
});
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
**Choosing Precision:**
|
|
381
|
+
- `BINARY`: Best for very large datasets where speed and storage are critical
|
|
382
|
+
- `INT8D` (default): Recommended for most use cases - good balance of accuracy and performance
|
|
383
|
+
- `INT16D`: When you need better accuracy than INT8D but less storage than FLOAT32
|
|
384
|
+
- `FLOAT16`: Good compromise between precision and storage for embeddings
|
|
385
|
+
- `FLOAT32`: When you need maximum precision and storage is not a concern
|
|
386
|
+
|
|
217
387
|
## TypeScript Types
|
|
218
388
|
|
|
219
389
|
The package includes comprehensive TypeScript types:
|
|
@@ -225,7 +395,8 @@ import type {
|
|
|
225
395
|
QueryResult,
|
|
226
396
|
CreateIndexOptions,
|
|
227
397
|
IndexDescription,
|
|
228
|
-
SpaceType
|
|
398
|
+
SpaceType,
|
|
399
|
+
Precision
|
|
229
400
|
} from "endee";
|
|
230
401
|
```
|
|
231
402
|
|
package/dist/endee.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Main Endee client for Endee-DB
|
|
3
3
|
*/
|
|
4
|
-
import { Index } from
|
|
5
|
-
import type
|
|
4
|
+
import { Index } from "./indexClient.js";
|
|
5
|
+
import { type CreateIndexOptions } from "./types/index.js";
|
|
6
6
|
export declare class Endee {
|
|
7
7
|
private token;
|
|
8
8
|
private baseUrl;
|
package/dist/endee.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endee.d.ts","sourceRoot":"","sources":["../src/endee.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"endee.d.ts","sourceRoot":"","sources":["../src/endee.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAa,KAAK,kBAAkB,EAAkB,MAAM,kBAAkB,CAAC;AAGtF,qBAAa,KAAK;IAChB,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;gBAEZ,KAAK,GAAE,MAAM,GAAG,IAAW;IAavC,WAAW,IAAI,MAAM;IAUf,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAmEzD,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAgB/B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAuB1C,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,GAAG,IAAW,GAAG,OAAO,CAAC,KAAK,CAAC;CA8CxE"}
|
package/dist/endee.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Main Endee client for Endee-DB
|
|
3
3
|
*/
|
|
4
|
-
import axios from
|
|
5
|
-
import crypto from
|
|
6
|
-
import { raiseException } from
|
|
7
|
-
import { Index } from
|
|
8
|
-
import { isValidIndexName
|
|
9
|
-
import {
|
|
4
|
+
import axios from "axios";
|
|
5
|
+
import crypto from "crypto";
|
|
6
|
+
import { raiseException } from "./exceptions.js";
|
|
7
|
+
import { Index } from "./indexClient.js";
|
|
8
|
+
import { isValidIndexName } from "./utils.js";
|
|
9
|
+
import { Precision } from "./types/index.js";
|
|
10
|
+
import { getChecksum } from "./crypto.js";
|
|
10
11
|
export class Endee {
|
|
11
12
|
token;
|
|
12
13
|
baseUrl;
|
|
@@ -25,18 +26,21 @@ export class Endee {
|
|
|
25
26
|
}
|
|
26
27
|
generateKey() {
|
|
27
28
|
// Generate a random hex key of 32 bytes (256 bit)
|
|
28
|
-
const key = crypto.randomBytes(32).toString(
|
|
29
|
+
const key = crypto.randomBytes(32).toString("hex");
|
|
29
30
|
console.log("Store this encryption key in a secure location. Loss of the key will result in the irreversible loss of associated vector data.\nKey: ", key);
|
|
30
31
|
return key;
|
|
31
32
|
}
|
|
32
33
|
async createIndex(options) {
|
|
33
|
-
const { name, dimension, spaceType =
|
|
34
|
+
const { name, dimension, spaceType = "cosine", M = 16, efCon = 128, key = null, precision = Precision.INT8D, version = null, sparseDimension = null, } = options;
|
|
34
35
|
if (!isValidIndexName(name)) {
|
|
35
36
|
throw new Error("Invalid index name. Index name must be alphanumeric and can contain underscores and less than 48 characters");
|
|
36
37
|
}
|
|
37
38
|
if (dimension > 10000) {
|
|
38
39
|
throw new Error("Dimension cannot be greater than 10000");
|
|
39
40
|
}
|
|
41
|
+
if (sparseDimension && sparseDimension < 0) {
|
|
42
|
+
throw new Error("Sparse dimension cannot be less than 0");
|
|
43
|
+
}
|
|
40
44
|
const normalizedSpaceType = spaceType.toLowerCase();
|
|
41
45
|
if (!["cosine", "l2", "ip"].includes(normalizedSpaceType)) {
|
|
42
46
|
throw new Error(`Invalid space type: ${spaceType}`);
|
|
@@ -55,6 +59,9 @@ export class Endee {
|
|
|
55
59
|
precision: precision,
|
|
56
60
|
version: version,
|
|
57
61
|
};
|
|
62
|
+
if (sparseDimension) {
|
|
63
|
+
data.sparse_dim = sparseDimension;
|
|
64
|
+
}
|
|
58
65
|
if (version !== undefined) {
|
|
59
66
|
data.version = version;
|
|
60
67
|
}
|
|
@@ -134,12 +141,23 @@ export class Endee {
|
|
|
134
141
|
throw err;
|
|
135
142
|
}
|
|
136
143
|
const data = response.data;
|
|
144
|
+
const indexInfo = {
|
|
145
|
+
name: data.index_name,
|
|
146
|
+
spaceType: data.space_type,
|
|
147
|
+
dimension: data.dimension,
|
|
148
|
+
total_elements: data.total_elements,
|
|
149
|
+
precision: data.precision,
|
|
150
|
+
M: data.M,
|
|
151
|
+
checksum: data.checksum,
|
|
152
|
+
version: data.version,
|
|
153
|
+
sparseDimension: data.sparse_dim,
|
|
154
|
+
};
|
|
137
155
|
// Raise error if checksum does not match
|
|
138
156
|
const checksum = getChecksum(key);
|
|
139
157
|
if (checksum !== data.checksum) {
|
|
140
158
|
raiseException(403, "Checksum does not match. Please check the key.");
|
|
141
159
|
}
|
|
142
|
-
const idx = new Index(name, key, this.token, this.baseUrl, this.version,
|
|
160
|
+
const idx = new Index(name, key, this.token, this.baseUrl, this.version, indexInfo);
|
|
143
161
|
return idx;
|
|
144
162
|
}
|
|
145
163
|
}
|
package/dist/endee.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endee.js","sourceRoot":"","sources":["../src/endee.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"endee.js","sourceRoot":"","sources":["../src/endee.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,SAAS,EAA2C,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,KAAK;IACR,KAAK,CAAgB;IACrB,OAAO,CAAS;IAChB,OAAO,CAAS;IAExB,YAAY,QAAuB,IAAI;QACrC,IAAI,CAAC,KAAK,GA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,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAE3B,MAAM,SAAS,GAAc;YAC3B,IAAI,EAAE,IAAI,CAAC,UAAU;YACrB,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,eAAe,EAAE,IAAI,CAAC,UAAU;SACjC,CAAC;QAEF,yCAAyC;QACzC,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,QAAQ,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC/B,cAAc,CAAC,GAAG,EAAE,gDAAgD,CAAC,CAAC;QACxE,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,KAAK,CACnB,IAAI,EACJ,GAAG,EACH,IAAI,CAAC,KAAM,EACX,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,OAAO,EACZ,SAAS,CACV,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Main export file for Endee-DB
|
|
3
3
|
*/
|
|
4
|
-
export { Endee } from
|
|
5
|
-
export { Index } from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
4
|
+
export { Endee } from "./endee.js";
|
|
5
|
+
export { Index } from "./indexClient.js";
|
|
6
|
+
export * from "./exceptions.js";
|
|
7
|
+
export * from "./types/index.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Main export file for Endee-DB
|
|
3
3
|
*/
|
|
4
|
-
export { Endee } from
|
|
5
|
-
export { Index } from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
4
|
+
export { Endee } from "./endee.js";
|
|
5
|
+
export { Index } from "./indexClient.js";
|
|
6
|
+
export * from "./exceptions.js";
|
|
7
|
+
export * from "./types/index.js";
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/indexClient.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Index client for Endee-DB
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { VectorItem, QueryOptions, QueryResult, IndexInfo, IndexDescription } from "./types/index.js";
|
|
5
5
|
export declare class Index {
|
|
6
6
|
private name;
|
|
7
7
|
private key;
|
|
8
8
|
private token;
|
|
9
9
|
private url;
|
|
10
10
|
private count;
|
|
11
|
-
private
|
|
11
|
+
private spaceType;
|
|
12
12
|
private dimension;
|
|
13
13
|
private precision;
|
|
14
14
|
private M;
|
|
15
|
+
private sparseDimension;
|
|
15
16
|
constructor(name: string, key: string | null, token: string, url: string, _version?: number, params?: Partial<IndexInfo>);
|
|
16
17
|
toString(): string;
|
|
18
|
+
private isHybrid;
|
|
17
19
|
private _normalizeVector;
|
|
18
20
|
upsert(inputArray: VectorItem[]): Promise<string>;
|
|
19
21
|
query(options: QueryOptions): Promise<QueryResult[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexClient.d.ts","sourceRoot":"","sources":["../src/indexClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,
|
|
1
|
+
{"version":3,"file":"indexClient.d.ts","sourceRoot":"","sources":["../src/indexClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,EACL,UAAU,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,gBAAgB,EAGjB,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,KAAK;IAChB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,GAAG,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onUnzip } from "./crypto.js";
|
|
7
7
|
import { raiseException } from "./exceptions.js";
|
|
8
|
+
import { Precision } from "./types/index.js";
|
|
8
9
|
export class Index {
|
|
9
10
|
name;
|
|
10
11
|
key;
|
|
11
12
|
token;
|
|
12
13
|
url;
|
|
13
14
|
count;
|
|
14
|
-
|
|
15
|
+
spaceType;
|
|
15
16
|
dimension;
|
|
16
17
|
precision;
|
|
17
18
|
M;
|
|
19
|
+
sparseDimension;
|
|
18
20
|
constructor(name, key, token, url, _version = 1, params = {}) {
|
|
19
21
|
this.name = name;
|
|
20
22
|
this.key = key;
|
|
21
23
|
this.token = token;
|
|
22
24
|
this.url = url;
|
|
23
25
|
this.count = params.total_elements || 0;
|
|
24
|
-
this.
|
|
26
|
+
this.spaceType = params.spaceType || "cosine";
|
|
25
27
|
this.dimension = params.dimension || 0;
|
|
26
|
-
this.precision = params.precision ||
|
|
28
|
+
this.precision = params.precision || Precision.INT8D;
|
|
27
29
|
this.M = params.M || 16;
|
|
30
|
+
this.sparseDimension = params.sparseDimension || 0;
|
|
28
31
|
}
|
|
29
32
|
toString() {
|
|
30
33
|
return this.name;
|
|
31
34
|
}
|
|
35
|
+
isHybrid() {
|
|
36
|
+
return this.sparseDimension > 0;
|
|
37
|
+
}
|
|
32
38
|
_normalizeVector(vector) {
|
|
33
39
|
if (vector.length !== this.dimension) {
|
|
34
40
|
throw new Error(`Vector dimension mismatch: expected ${this.dimension}, got ${vector.length}`);
|
|
35
41
|
}
|
|
36
|
-
if (this.
|
|
42
|
+
if (this.spaceType !== "cosine") {
|
|
37
43
|
return [vector, 1.0];
|
|
38
44
|
}
|
|
39
45
|
const norm = Math.sqrt(vector.reduce((sum, v) => sum + v * v, 0));
|
|
@@ -50,6 +56,25 @@ export class Index {
|
|
|
50
56
|
for (const item of inputArray) {
|
|
51
57
|
const [vector, norm] = this._normalizeVector(item.vector);
|
|
52
58
|
const metaData = jsonZip(item.meta || {}, this.key);
|
|
59
|
+
const sparseIndices = item.sparseIndices || [];
|
|
60
|
+
const sparseValues = item.sparseValues || [];
|
|
61
|
+
if (!this.isHybrid() &&
|
|
62
|
+
(sparseIndices.length > 0 || sparseValues.length > 0)) {
|
|
63
|
+
throw new Error("Cannot insert sparse data into a dense-only index. Create index with sparseDimension > 0 for hybrid support.");
|
|
64
|
+
}
|
|
65
|
+
if (this.isHybrid()) {
|
|
66
|
+
if (sparseIndices.length == 0 || sparseValues.length == 0) {
|
|
67
|
+
throw new Error("Both sparse_indices and sparse_values must be provided for hybrid vectors.");
|
|
68
|
+
}
|
|
69
|
+
if (sparseIndices.length !== sparseValues.length) {
|
|
70
|
+
throw new Error(`sparseIndices and sparseValues must have the same length. Got ${sparseIndices.length} length indices and ${sparseValues.length} length values.`);
|
|
71
|
+
}
|
|
72
|
+
for (const idx of sparseIndices) {
|
|
73
|
+
if (idx < 0 || idx >= this.sparseDimension) {
|
|
74
|
+
throw new Error(`Sparse index ${idx} is out of bounds. Must be in range [0,${this.sparseDimension}).`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
53
78
|
const vectorObj = [
|
|
54
79
|
String(item.id || ""),
|
|
55
80
|
metaData,
|
|
@@ -57,6 +82,9 @@ export class Index {
|
|
|
57
82
|
norm,
|
|
58
83
|
vector,
|
|
59
84
|
];
|
|
85
|
+
if (this.isHybrid()) {
|
|
86
|
+
vectorObj.push(sparseIndices, sparseValues);
|
|
87
|
+
}
|
|
60
88
|
vectorBatch.push(vectorObj);
|
|
61
89
|
}
|
|
62
90
|
const serializedData = encode(vectorBatch);
|
|
@@ -76,24 +104,46 @@ export class Index {
|
|
|
76
104
|
return "Vectors inserted successfully";
|
|
77
105
|
}
|
|
78
106
|
async query(options) {
|
|
79
|
-
const { vector, topK = 10, filter = null, ef = 128, includeVectors = false, } = options;
|
|
80
|
-
if (
|
|
81
|
-
throw new Error("
|
|
82
|
-
if (topK > 200)
|
|
83
|
-
throw new Error("top_k cannot be greater than 200");
|
|
107
|
+
const { vector = null, topK = 10, filter = null, ef = 128, includeVectors = false, sparseIndices = null, sparseValues = null, } = options;
|
|
108
|
+
if (topK > 512 || topK < 0)
|
|
109
|
+
throw new Error("top_k cannot be greater than 512 and less than 0");
|
|
84
110
|
if (ef > 1024)
|
|
85
111
|
throw new Error("ef search cannot be greater than 1024");
|
|
86
|
-
const
|
|
112
|
+
const hasSparse = sparseIndices &&
|
|
113
|
+
sparseIndices.length > 0 &&
|
|
114
|
+
sparseValues &&
|
|
115
|
+
sparseIndices.length > 0;
|
|
116
|
+
var hasDense = false;
|
|
117
|
+
if (vector)
|
|
118
|
+
hasDense = true;
|
|
119
|
+
if (!hasDense && !hasSparse) {
|
|
120
|
+
throw new Error("At least one of 'vector' or 'sparseIndices'/'sparseValues' must be provided.");
|
|
121
|
+
}
|
|
122
|
+
if (hasSparse && !this.isHybrid()) {
|
|
123
|
+
throw new Error("Cannot perform sparse search on a dense-only index. Create index with sparseDimension > 0 for hybrid support.");
|
|
124
|
+
}
|
|
125
|
+
if (hasSparse) {
|
|
126
|
+
if (sparseIndices.length != sparseValues.length) {
|
|
127
|
+
throw new Error(`sparseIndices and sparseValues must have the same length. Got ${sparseIndices.length} length indices and ${sparseValues.length} length values.`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
87
130
|
const headers = {
|
|
88
131
|
Authorization: this.token,
|
|
89
132
|
"Content-Type": "application/json",
|
|
90
133
|
};
|
|
91
134
|
const data = {
|
|
92
|
-
vector: queryVector,
|
|
93
135
|
k: topK,
|
|
94
136
|
ef: ef,
|
|
95
137
|
include_vectors: includeVectors,
|
|
96
138
|
};
|
|
139
|
+
if (vector) {
|
|
140
|
+
const [queryVector] = this._normalizeVector(vector);
|
|
141
|
+
data.vector = queryVector;
|
|
142
|
+
}
|
|
143
|
+
if (hasSparse) {
|
|
144
|
+
data.sparse_indices = sparseIndices;
|
|
145
|
+
data.sparse_values = sparseValues;
|
|
146
|
+
}
|
|
97
147
|
if (filter) {
|
|
98
148
|
data.filter = JSON.stringify(filter);
|
|
99
149
|
}
|
|
@@ -205,8 +255,10 @@ export class Index {
|
|
|
205
255
|
describe() {
|
|
206
256
|
return {
|
|
207
257
|
name: this.name,
|
|
208
|
-
|
|
258
|
+
spaceType: this.spaceType,
|
|
209
259
|
dimension: this.dimension,
|
|
260
|
+
sparseDimension: this.sparseDimension,
|
|
261
|
+
isHybrid: this.isHybrid(),
|
|
210
262
|
count: this.count,
|
|
211
263
|
precision: this.precision,
|
|
212
264
|
M: this.M,
|
package/dist/indexClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexClient.js","sourceRoot":"","sources":["../src/indexClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"indexClient.js","sourceRoot":"","sources":["../src/indexClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAOL,SAAS,EACV,MAAM,kBAAkB,CAAC;AAE1B,MAAM,OAAO,KAAK;IACR,IAAI,CAAS;IACb,GAAG,CAAgB;IACnB,KAAK,CAAS;IACd,GAAG,CAAS;IACZ,KAAK,CAAS;IACd,SAAS,CAAY;IACrB,SAAS,CAAS;IAClB,SAAS,CAAY;IACrB,CAAC,CAAS;IACV,eAAe,CAAS;IAEhC,YACE,IAAY,EACZ,GAAkB,EAClB,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,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAExC,OAAO;YACL,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;YAChB,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;YACpB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;IAED,QAAQ;QACN,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,CAAC,EAAE,IAAI,CAAC,CAAC;SACV,CAAC;IACJ,CAAC;CACF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,30 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for Endee-DB
|
|
3
3
|
*/
|
|
4
|
-
export type SpaceType =
|
|
4
|
+
export type SpaceType = "cosine" | "l2" | "ip";
|
|
5
|
+
export declare enum Precision {
|
|
6
|
+
BINARY = "binary",
|
|
7
|
+
INT8D = "int8d",
|
|
8
|
+
INT16D = "int16d",
|
|
9
|
+
FLOAT16 = "float16",
|
|
10
|
+
FLOAT32 = "float32"
|
|
11
|
+
}
|
|
5
12
|
export interface CreateIndexOptions {
|
|
6
13
|
name: string;
|
|
7
14
|
dimension: number;
|
|
8
15
|
spaceType?: SpaceType;
|
|
9
16
|
M?: number;
|
|
10
17
|
key?: string;
|
|
11
|
-
precision?:
|
|
18
|
+
precision?: Precision;
|
|
12
19
|
efCon?: number;
|
|
13
20
|
version?: number;
|
|
21
|
+
sparseDimension?: number;
|
|
14
22
|
}
|
|
15
23
|
export interface VectorItem {
|
|
16
24
|
id: string;
|
|
17
25
|
vector: number[];
|
|
26
|
+
sparseIndices?: number[];
|
|
27
|
+
sparseValues?: number[];
|
|
18
28
|
meta?: Record<string, unknown>;
|
|
19
29
|
filter?: Record<string, unknown>;
|
|
20
30
|
}
|
|
21
31
|
export interface QueryOptions {
|
|
22
|
-
vector
|
|
32
|
+
vector?: number[];
|
|
23
33
|
topK: number;
|
|
24
34
|
filter?: Array<Record<string, unknown>> | null;
|
|
25
35
|
ef?: number;
|
|
26
36
|
includeVectors?: boolean;
|
|
27
37
|
log?: boolean;
|
|
38
|
+
sparseIndices?: number[];
|
|
39
|
+
sparseValues?: number[];
|
|
28
40
|
}
|
|
29
41
|
export interface QueryResult {
|
|
30
42
|
id: string;
|
|
@@ -37,20 +49,24 @@ export interface QueryResult {
|
|
|
37
49
|
}
|
|
38
50
|
export interface IndexInfo {
|
|
39
51
|
name: string;
|
|
40
|
-
|
|
52
|
+
spaceType: SpaceType;
|
|
41
53
|
dimension: number;
|
|
42
54
|
total_elements?: number;
|
|
43
|
-
precision?:
|
|
55
|
+
precision?: Precision;
|
|
44
56
|
M?: number;
|
|
45
57
|
checksum?: Number;
|
|
46
|
-
|
|
58
|
+
libToken?: string;
|
|
59
|
+
version?: number;
|
|
60
|
+
sparseDimension?: number;
|
|
47
61
|
}
|
|
48
62
|
export interface IndexDescription {
|
|
49
63
|
name: string;
|
|
50
|
-
|
|
64
|
+
spaceType: SpaceType;
|
|
51
65
|
dimension: number;
|
|
66
|
+
isHybrid: boolean;
|
|
52
67
|
count: number;
|
|
53
|
-
precision:
|
|
68
|
+
precision: Precision;
|
|
54
69
|
M: number;
|
|
70
|
+
sparseDimension?: number;
|
|
55
71
|
}
|
|
56
72
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAA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,CAAC;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for Endee-DB
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export var Precision;
|
|
5
|
+
(function (Precision) {
|
|
6
|
+
Precision["BINARY"] = "binary";
|
|
7
|
+
Precision["INT8D"] = "int8d";
|
|
8
|
+
Precision["INT16D"] = "int16d";
|
|
9
|
+
Precision["FLOAT16"] = "float16";
|
|
10
|
+
Precision["FLOAT32"] = "float32";
|
|
11
|
+
})(Precision || (Precision = {}));
|
|
5
12
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,4BAAgB,CAAA;IAChB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,gCAAmB,CAAA;AACrB,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB"}
|