@wiscale/velesdb-sdk 1.9.1 → 1.9.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 CHANGED
@@ -2,9 +2,17 @@
2
2
 
3
3
  Official TypeScript SDK for [VelesDB](https://github.com/cyberlife-coder/VelesDB) -- the local-first vector database for AI and RAG. Sub-millisecond semantic search in Browser and Node.js.
4
4
 
5
- **v1.9.1** | Node.js >= 18 | Browser (WASM) | MIT License
5
+ **v1.9.2** | Node.js >= 18 | Browser (WASM) | MIT License
6
6
 
7
- ## What's New in v1.9.1
7
+ ## What's New in v1.9.2
8
+
9
+ - **SearchQuality type** -- new `SearchQuality` type and `quality` field in `SearchOptions` for per-query recall/latency control (`fast`, `balanced`, `accurate`, `perfect`, `custom:N`, `adaptive:min:max`)
10
+ - **StorageMode in HnswParams** -- `storageMode` field in HNSW configuration
11
+ - **Relative score fusion** -- `'relative_score'` fusion strategy in `MultiQuerySearchOptions`
12
+ - **DistanceMetric "ip" alias** -- `"ip"` accepted as an alias for `"dot"` (inner product)
13
+ - **StorageMode aliases** -- `"f32"`, `"int8"`, `"bit"` accepted as aliases for `"full"`, `"sq8"`, `"binary"`
14
+
15
+ ### Previous (v1.9.1)
8
16
 
9
17
  - **Agent Memory API** -- semantic, episodic, and procedural memory for AI agents (REST only)
10
18
  - **Graph collections** -- dedicated `createGraphCollection()` for knowledge graphs (REST only)
@@ -122,8 +130,8 @@ Create a vector collection.
122
130
  | Option | Type | Default | Description |
123
131
  |--------|------|---------|-------------|
124
132
  | `dimension` | `number` | Required | Vector dimension |
125
- | `metric` | `'cosine' \| 'euclidean' \| 'dot' \| 'hamming' \| 'jaccard'` | `'cosine'` | Distance metric |
126
- | `storageMode` | `'full' \| 'sq8' \| 'binary'` | `'full'` | Quantization mode |
133
+ | `metric` | `'cosine' \| 'euclidean' \| 'dot' \| 'hamming' \| 'jaccard'` | `'cosine'` | Distance metric (aliases: `'ip'`/`'inner'`/`'dotproduct'` for dot) |
134
+ | `storageMode` | `'full' \| 'sq8' \| 'binary'` | `'full'` | Quantization mode (aliases: `'f32'` for full, `'int8'` for sq8, `'bit'` for binary) |
127
135
  | `hnsw` | `{ m?: number, efConstruction?: number }` | - | HNSW index tuning |
128
136
  | `description` | `string` | - | Optional description |
129
137
 
@@ -234,6 +242,7 @@ Vector similarity search.
234
242
  | `filter` | `object` | - | Payload filter expression |
235
243
  | `includeVectors` | `boolean` | `false` | Include vectors in results |
236
244
  | `sparseVector` | `Record<number, number>` | - | Sparse vector for hybrid sparse+dense search |
245
+ | `quality` | `SearchQuality` | - | Search quality mode (e.g., `'fast'`, `'balanced'`, `'custom:256'`, `'adaptive:32:512'`) |
237
246
 
238
247
  ```typescript
239
248
  const results = await db.search('docs', queryVector, {
@@ -689,6 +698,7 @@ import {
689
698
  type CollectionConfig,
690
699
  type VectorDocument,
691
700
  type SearchOptions,
701
+ type SearchQuality,
692
702
  type SearchResult,
693
703
  type SparseVector,
694
704
  type MultiQuerySearchOptions,
package/dist/index.d.mts CHANGED
@@ -6,6 +6,8 @@
6
6
  type DistanceMetric = 'cosine' | 'euclidean' | 'dot' | 'hamming' | 'jaccard';
7
7
  /** Storage mode for vector quantization */
8
8
  type StorageMode = 'full' | 'sq8' | 'binary' | 'pq' | 'rabitq';
9
+ /** Search quality preset controlling recall vs speed tradeoff. */
10
+ type SearchQuality = 'fast' | 'balanced' | 'accurate' | 'perfect' | 'autotune' | `custom:${number}` | `adaptive:${number}:${number}`;
9
11
  /** Backend type for VelesDB connection */
10
12
  type BackendType = 'wasm' | 'rest';
11
13
  /** Numeric point ID required by velesdb-server REST API (`u64`). */
@@ -87,6 +89,8 @@ interface SearchOptions {
87
89
  includeVectors?: boolean;
88
90
  /** Optional sparse vector for hybrid sparse+dense search */
89
91
  sparseVector?: SparseVector;
92
+ /** Search quality preset (default: 'balanced'). */
93
+ quality?: SearchQuality;
90
94
  }
91
95
  /** PQ (Product Quantization) training options */
92
96
  interface PqTrainOptions {
@@ -98,7 +102,7 @@ interface PqTrainOptions {
98
102
  opq?: boolean;
99
103
  }
100
104
  /** Fusion strategy for multi-query search */
101
- type FusionStrategy = 'rrf' | 'average' | 'maximum' | 'weighted';
105
+ type FusionStrategy = 'rrf' | 'average' | 'maximum' | 'weighted' | 'relative_score';
102
106
  /** Multi-query search options */
103
107
  interface MultiQuerySearchOptions {
104
108
  /** Number of results to return (default: 10) */
@@ -1324,4 +1328,4 @@ declare class VelesQLBuilder {
1324
1328
  */
1325
1329
  declare function velesql(): VelesQLBuilder;
1326
1330
 
1327
- export { type AddEdgeRequest, AgentMemoryClient, type AgentMemoryConfig, type AggregationQueryResponse, type BackendType, BackpressureError, type Collection, type CollectionConfig, type CollectionConfigResponse, type CollectionSanityChecks, type CollectionSanityDiagnostics, type CollectionSanityResponse, type CollectionStatsResponse, type CollectionType, ConnectionError, type CreateIndexOptions, type DegreeResponse, type DistanceMetric, type EdgesResponse, type EpisodicEvent, type ExplainCost, type ExplainFeatures, type ExplainPlanStep, type ExplainResponse, type FusionOptions, type FusionStrategy, type GetEdgesOptions, type GraphCollectionConfig, type GraphEdge, type GraphSchemaMode, type HnswParams, type IVelesDBBackend, type IndexInfo, type IndexType, type MultiQuerySearchOptions, type NearVectorOptions, NotFoundError, type PqTrainOptions, type ProceduralPattern, type QueryApiResponse, type QueryOptions, type QueryResponse, type QueryResult, type QueryStats, type RelDirection, type RelOptions, RestBackend, type RestPointId, type SearchOptions, type SearchResult, type SemanticEntry, type SparseVector, type StorageMode, type TraversalResultItem, type TraversalStats, type TraverseRequest, type TraverseResponse, ValidationError, type VectorDocument, VelesDB, type VelesDBConfig, VelesDBError, VelesQLBuilder, WasmBackend, velesql };
1331
+ export { type AddEdgeRequest, AgentMemoryClient, type AgentMemoryConfig, type AggregationQueryResponse, type BackendType, BackpressureError, type Collection, type CollectionConfig, type CollectionConfigResponse, type CollectionSanityChecks, type CollectionSanityDiagnostics, type CollectionSanityResponse, type CollectionStatsResponse, type CollectionType, ConnectionError, type CreateIndexOptions, type DegreeResponse, type DistanceMetric, type EdgesResponse, type EpisodicEvent, type ExplainCost, type ExplainFeatures, type ExplainPlanStep, type ExplainResponse, type FusionOptions, type FusionStrategy, type GetEdgesOptions, type GraphCollectionConfig, type GraphEdge, type GraphSchemaMode, type HnswParams, type IVelesDBBackend, type IndexInfo, type IndexType, type MultiQuerySearchOptions, type NearVectorOptions, NotFoundError, type PqTrainOptions, type ProceduralPattern, type QueryApiResponse, type QueryOptions, type QueryResponse, type QueryResult, type QueryStats, type RelDirection, type RelOptions, RestBackend, type RestPointId, type SearchOptions, type SearchQuality, type SearchResult, type SemanticEntry, type SparseVector, type StorageMode, type TraversalResultItem, type TraversalStats, type TraverseRequest, type TraverseResponse, ValidationError, type VectorDocument, VelesDB, type VelesDBConfig, VelesDBError, VelesQLBuilder, WasmBackend, velesql };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@
6
6
  type DistanceMetric = 'cosine' | 'euclidean' | 'dot' | 'hamming' | 'jaccard';
7
7
  /** Storage mode for vector quantization */
8
8
  type StorageMode = 'full' | 'sq8' | 'binary' | 'pq' | 'rabitq';
9
+ /** Search quality preset controlling recall vs speed tradeoff. */
10
+ type SearchQuality = 'fast' | 'balanced' | 'accurate' | 'perfect' | 'autotune' | `custom:${number}` | `adaptive:${number}:${number}`;
9
11
  /** Backend type for VelesDB connection */
10
12
  type BackendType = 'wasm' | 'rest';
11
13
  /** Numeric point ID required by velesdb-server REST API (`u64`). */
@@ -87,6 +89,8 @@ interface SearchOptions {
87
89
  includeVectors?: boolean;
88
90
  /** Optional sparse vector for hybrid sparse+dense search */
89
91
  sparseVector?: SparseVector;
92
+ /** Search quality preset (default: 'balanced'). */
93
+ quality?: SearchQuality;
90
94
  }
91
95
  /** PQ (Product Quantization) training options */
92
96
  interface PqTrainOptions {
@@ -98,7 +102,7 @@ interface PqTrainOptions {
98
102
  opq?: boolean;
99
103
  }
100
104
  /** Fusion strategy for multi-query search */
101
- type FusionStrategy = 'rrf' | 'average' | 'maximum' | 'weighted';
105
+ type FusionStrategy = 'rrf' | 'average' | 'maximum' | 'weighted' | 'relative_score';
102
106
  /** Multi-query search options */
103
107
  interface MultiQuerySearchOptions {
104
108
  /** Number of results to return (default: 10) */
@@ -1324,4 +1328,4 @@ declare class VelesQLBuilder {
1324
1328
  */
1325
1329
  declare function velesql(): VelesQLBuilder;
1326
1330
 
1327
- export { type AddEdgeRequest, AgentMemoryClient, type AgentMemoryConfig, type AggregationQueryResponse, type BackendType, BackpressureError, type Collection, type CollectionConfig, type CollectionConfigResponse, type CollectionSanityChecks, type CollectionSanityDiagnostics, type CollectionSanityResponse, type CollectionStatsResponse, type CollectionType, ConnectionError, type CreateIndexOptions, type DegreeResponse, type DistanceMetric, type EdgesResponse, type EpisodicEvent, type ExplainCost, type ExplainFeatures, type ExplainPlanStep, type ExplainResponse, type FusionOptions, type FusionStrategy, type GetEdgesOptions, type GraphCollectionConfig, type GraphEdge, type GraphSchemaMode, type HnswParams, type IVelesDBBackend, type IndexInfo, type IndexType, type MultiQuerySearchOptions, type NearVectorOptions, NotFoundError, type PqTrainOptions, type ProceduralPattern, type QueryApiResponse, type QueryOptions, type QueryResponse, type QueryResult, type QueryStats, type RelDirection, type RelOptions, RestBackend, type RestPointId, type SearchOptions, type SearchResult, type SemanticEntry, type SparseVector, type StorageMode, type TraversalResultItem, type TraversalStats, type TraverseRequest, type TraverseResponse, ValidationError, type VectorDocument, VelesDB, type VelesDBConfig, VelesDBError, VelesQLBuilder, WasmBackend, velesql };
1331
+ export { type AddEdgeRequest, AgentMemoryClient, type AgentMemoryConfig, type AggregationQueryResponse, type BackendType, BackpressureError, type Collection, type CollectionConfig, type CollectionConfigResponse, type CollectionSanityChecks, type CollectionSanityDiagnostics, type CollectionSanityResponse, type CollectionStatsResponse, type CollectionType, ConnectionError, type CreateIndexOptions, type DegreeResponse, type DistanceMetric, type EdgesResponse, type EpisodicEvent, type ExplainCost, type ExplainFeatures, type ExplainPlanStep, type ExplainResponse, type FusionOptions, type FusionStrategy, type GetEdgesOptions, type GraphCollectionConfig, type GraphEdge, type GraphSchemaMode, type HnswParams, type IVelesDBBackend, type IndexInfo, type IndexType, type MultiQuerySearchOptions, type NearVectorOptions, NotFoundError, type PqTrainOptions, type ProceduralPattern, type QueryApiResponse, type QueryOptions, type QueryResponse, type QueryResult, type QueryStats, type RelDirection, type RelOptions, RestBackend, type RestPointId, type SearchOptions, type SearchQuality, type SearchResult, type SemanticEntry, type SparseVector, type StorageMode, type TraversalResultItem, type TraversalStats, type TraverseRequest, type TraverseResponse, ValidationError, type VectorDocument, VelesDB, type VelesDBConfig, VelesDBError, VelesQLBuilder, WasmBackend, velesql };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wiscale/velesdb-sdk",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "VelesDB TypeScript SDK: The Local Vector Database for AI & RAG. Microsecond semantic search in Browser & Node.js.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",