@wiscale/velesdb-sdk 1.18.0 → 3.0.0
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 +126 -9
- package/dist/index.d.mts +243 -33
- package/dist/index.d.ts +243 -33
- package/dist/index.js +561 -58
- package/dist/index.mjs +554 -56
- package/package.json +5 -4
package/dist/index.d.mts
CHANGED
|
@@ -12,8 +12,15 @@ type StorageMode = 'full' | 'sq8' | 'binary' | 'pq' | 'rabitq';
|
|
|
12
12
|
type SearchQuality = 'fast' | 'balanced' | 'accurate' | 'perfect' | 'autotune' | `custom:${number}` | `adaptive:${number}:${number}`;
|
|
13
13
|
/** Backend type for VelesDB connection */
|
|
14
14
|
type BackendType = 'wasm' | 'rest';
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Point ID accepted by the velesdb-server REST API (`u64`).
|
|
17
|
+
*
|
|
18
|
+
* Ids within the JS safe-integer range are numbers; decimal-string ids above
|
|
19
|
+
* `Number.MAX_SAFE_INTEGER` (2^53-1) stay verbatim strings so the full u64
|
|
20
|
+
* range survives the JavaScript boundary without precision loss (the server
|
|
21
|
+
* deserialises both forms since #1004).
|
|
22
|
+
*/
|
|
23
|
+
type RestPointId = number | string;
|
|
17
24
|
/** Configuration options for VelesDB client */
|
|
18
25
|
interface VelesDBConfig {
|
|
19
26
|
/** Backend type: 'wasm' for browser/Node.js, 'rest' for server */
|
|
@@ -563,6 +570,42 @@ interface DegreeResponse {
|
|
|
563
570
|
/** Number of outgoing edges */
|
|
564
571
|
outDegree: number;
|
|
565
572
|
}
|
|
573
|
+
/** Request body for POST /collections/{name}/relations */
|
|
574
|
+
interface RelateRequest {
|
|
575
|
+
/** Source point ID */
|
|
576
|
+
source: GraphNodeId;
|
|
577
|
+
/** Target point ID */
|
|
578
|
+
target: GraphNodeId;
|
|
579
|
+
/** Relationship type label (e.g. "KNOWS", "RELATED_TO") */
|
|
580
|
+
relType: string;
|
|
581
|
+
/** Optional edge properties */
|
|
582
|
+
properties?: Record<string, unknown>;
|
|
583
|
+
}
|
|
584
|
+
/** Response from POST /collections/{name}/relations */
|
|
585
|
+
interface RelateResponse {
|
|
586
|
+
/** Allocated edge ID */
|
|
587
|
+
edgeId: GraphNodeId;
|
|
588
|
+
}
|
|
589
|
+
/** A single outgoing relation edge */
|
|
590
|
+
interface RelationEdge {
|
|
591
|
+
/** Edge ID */
|
|
592
|
+
id: GraphNodeId;
|
|
593
|
+
/** Source point ID */
|
|
594
|
+
source: GraphNodeId;
|
|
595
|
+
/** Target point ID */
|
|
596
|
+
target: GraphNodeId;
|
|
597
|
+
/** Relationship type label */
|
|
598
|
+
relType: string;
|
|
599
|
+
/** Edge properties */
|
|
600
|
+
properties?: Record<string, unknown>;
|
|
601
|
+
}
|
|
602
|
+
/** Response from GET /collections/{name}/points/{id}/relations */
|
|
603
|
+
interface RelationsResponse {
|
|
604
|
+
/** Outgoing relation edges */
|
|
605
|
+
edges: RelationEdge[];
|
|
606
|
+
/** Total count */
|
|
607
|
+
count: number;
|
|
608
|
+
}
|
|
566
609
|
/** Schema mode for graph collections */
|
|
567
610
|
type GraphSchemaMode = 'schemaless' | 'strict';
|
|
568
611
|
/** Graph collection configuration */
|
|
@@ -583,8 +626,15 @@ interface GraphCollectionConfig {
|
|
|
583
626
|
*/
|
|
584
627
|
/** Semantic memory entry */
|
|
585
628
|
interface SemanticEntry {
|
|
586
|
-
/**
|
|
587
|
-
|
|
629
|
+
/**
|
|
630
|
+
* Unique fact ID.
|
|
631
|
+
*
|
|
632
|
+
* `string | number` is accepted as a convenience (a string must be a decimal
|
|
633
|
+
* integer). Ids must be non-negative integers within the JS safe-integer
|
|
634
|
+
* range (0..2^53-1): the REST wire transmits point ids as JSON numbers, so
|
|
635
|
+
* out-of-range ids are rejected (not silently truncated).
|
|
636
|
+
*/
|
|
637
|
+
id: string | number;
|
|
588
638
|
/** Fact text content */
|
|
589
639
|
text: string;
|
|
590
640
|
/** Embedding vector */
|
|
@@ -594,8 +644,24 @@ interface SemanticEntry {
|
|
|
594
644
|
}
|
|
595
645
|
/** Episodic memory event */
|
|
596
646
|
interface EpisodicEvent {
|
|
647
|
+
/**
|
|
648
|
+
* Optional caller-provided event ID. When omitted, a monotonic id is
|
|
649
|
+
* generated. `string | number` is accepted as a convenience; ids must be
|
|
650
|
+
* non-negative integers within the JS safe-integer range (0..2^53-1) because
|
|
651
|
+
* the REST wire transmits them as JSON numbers, and out-of-range ids are
|
|
652
|
+
* rejected (not silently truncated).
|
|
653
|
+
*/
|
|
654
|
+
id?: string | number;
|
|
597
655
|
/** Event type identifier */
|
|
598
656
|
eventType: string;
|
|
657
|
+
/**
|
|
658
|
+
* Event timestamp as a NUMERIC unix time in **seconds**.
|
|
659
|
+
*
|
|
660
|
+
* Mirrors the core episodic store, which persists a numeric `timestamp`
|
|
661
|
+
* that feeds `recent(since)` / `older_than(before)`. When omitted it
|
|
662
|
+
* defaults to the current unix-seconds value (`floor(Date.now() / 1000)`).
|
|
663
|
+
*/
|
|
664
|
+
timestamp?: number;
|
|
599
665
|
/** Event data */
|
|
600
666
|
data: Record<string, unknown>;
|
|
601
667
|
/** Embedding vector */
|
|
@@ -605,6 +671,14 @@ interface EpisodicEvent {
|
|
|
605
671
|
}
|
|
606
672
|
/** Procedural memory pattern */
|
|
607
673
|
interface ProceduralPattern {
|
|
674
|
+
/**
|
|
675
|
+
* Optional caller-provided pattern ID. When omitted, a monotonic id is
|
|
676
|
+
* generated. `string | number` is accepted as a convenience; ids must be
|
|
677
|
+
* non-negative integers within the JS safe-integer range (0..2^53-1) because
|
|
678
|
+
* the REST wire transmits them as JSON numbers, and out-of-range ids are
|
|
679
|
+
* rejected (not silently truncated).
|
|
680
|
+
*/
|
|
681
|
+
id?: string | number;
|
|
608
682
|
/** Procedure name */
|
|
609
683
|
name: string;
|
|
610
684
|
/** Ordered steps */
|
|
@@ -620,6 +694,15 @@ interface ProceduralPattern {
|
|
|
620
694
|
/** Optional metadata */
|
|
621
695
|
metadata?: Record<string, unknown>;
|
|
622
696
|
}
|
|
697
|
+
/** A single episodic event recalled by timestamp. */
|
|
698
|
+
interface EpisodicRecord {
|
|
699
|
+
/** Point id as a string (u64 precision preserved). */
|
|
700
|
+
id: string;
|
|
701
|
+
/** Numeric unix-seconds timestamp. */
|
|
702
|
+
timestamp: number;
|
|
703
|
+
/** Full point payload (includes `event_type`, caller data/metadata). */
|
|
704
|
+
payload: Record<string, unknown>;
|
|
705
|
+
}
|
|
623
706
|
/** Agent memory configuration */
|
|
624
707
|
interface AgentMemoryConfig {
|
|
625
708
|
/** Embedding dimension (default: 384) */
|
|
@@ -918,6 +1001,8 @@ interface CapabilityMap {
|
|
|
918
1001
|
secondaryIndexes: boolean;
|
|
919
1002
|
/** Agent Memory SDK (semantic, episodic, procedural). */
|
|
920
1003
|
agentMemory: boolean;
|
|
1004
|
+
/** Enable the bounded streaming-ingestion channel (`enableStreaming`). */
|
|
1005
|
+
enableStreaming: boolean;
|
|
921
1006
|
/** Streaming insert with backpressure (`streamInsert`). */
|
|
922
1007
|
streamInsert: boolean;
|
|
923
1008
|
/** Product quantization training (`trainPq`). */
|
|
@@ -939,11 +1024,17 @@ declare const REST_CAPABILITIES: Readonly<CapabilityMap>;
|
|
|
939
1024
|
* Capability map for the WASM backend.
|
|
940
1025
|
*
|
|
941
1026
|
* The WASM build ships a focused subset: the dense / text / hybrid /
|
|
942
|
-
* multi-query search paths
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
*
|
|
946
|
-
*
|
|
1027
|
+
* multi-query search paths. Everything that relies on persistent
|
|
1028
|
+
* on-disk structures (secondary indexes, graph, streaming, PQ
|
|
1029
|
+
* training, agent memory, introspection, sparse inverted index) is
|
|
1030
|
+
* explicitly `false`. See `backends/wasm-stubs.ts` for the exact set
|
|
1031
|
+
* of `wasmNotSupported()` throw sites.
|
|
1032
|
+
*
|
|
1033
|
+
* `velesqlQuery` is `false`: `query()` only executes pure top-k NEAR
|
|
1034
|
+
* statements (`SELECT * FROM <collection> WHERE vector NEAR $param
|
|
1035
|
+
* [LIMIT n]`) and throws `NOT_SUPPORTED` for any other VelesQL clause
|
|
1036
|
+
* (WHERE predicates, JOIN, GROUP BY, MATCH, set operations, FUSION),
|
|
1037
|
+
* so full VelesQL is not advertised.
|
|
947
1038
|
*/
|
|
948
1039
|
declare const WASM_CAPABILITIES: Readonly<CapabilityMap>;
|
|
949
1040
|
|
|
@@ -1084,6 +1175,23 @@ interface AggregateResponse {
|
|
|
1084
1175
|
count: number;
|
|
1085
1176
|
};
|
|
1086
1177
|
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Configuration for `POST /collections/{name}/stream/enable`.
|
|
1180
|
+
*
|
|
1181
|
+
* Enables the bounded streaming-ingestion channel on a collection so that
|
|
1182
|
+
* subsequent `streamInsert` calls are accepted. Every field is optional;
|
|
1183
|
+
* omitted fields fall back to the server defaults (`bufferSize` 10000,
|
|
1184
|
+
* `batchSize` 128, `flushIntervalMs` 50). camelCase here, converted to the
|
|
1185
|
+
* snake_case wire body by the backend.
|
|
1186
|
+
*/
|
|
1187
|
+
interface StreamingConfig {
|
|
1188
|
+
/** Bounded ingestion channel capacity (server default: 10000). */
|
|
1189
|
+
bufferSize?: number;
|
|
1190
|
+
/** Points flushed to the index per batch (server default: 128). */
|
|
1191
|
+
batchSize?: number;
|
|
1192
|
+
/** Max milliseconds before a partial batch is flushed (server default: 50). */
|
|
1193
|
+
flushIntervalMs?: number;
|
|
1194
|
+
}
|
|
1087
1195
|
/**
|
|
1088
1196
|
* Response from `POST /collections/{name}/points/stream` (NDJSON batch upsert).
|
|
1089
1197
|
*
|
|
@@ -1104,13 +1212,6 @@ interface StreamUpsertResponse {
|
|
|
1104
1212
|
networkErrors: number;
|
|
1105
1213
|
}
|
|
1106
1214
|
|
|
1107
|
-
/**
|
|
1108
|
-
* VelesDB TypeScript SDK - Backend Interface
|
|
1109
|
-
*
|
|
1110
|
-
* The `IVelesDBBackend` interface that all backends must implement.
|
|
1111
|
-
* @packageDocumentation
|
|
1112
|
-
*/
|
|
1113
|
-
|
|
1114
1215
|
/** Backend interface that all backends must implement */
|
|
1115
1216
|
interface IVelesDBBackend {
|
|
1116
1217
|
/** Initialize the backend */
|
|
@@ -1138,6 +1239,17 @@ interface IVelesDBBackend {
|
|
|
1138
1239
|
upsert(collection: string, doc: VectorDocument): Promise<void>;
|
|
1139
1240
|
/** Upsert (insert or replace) multiple vectors */
|
|
1140
1241
|
upsertBatch(collection: string, docs: VectorDocument[]): Promise<void>;
|
|
1242
|
+
/**
|
|
1243
|
+
* Bulk upsert multiple vectors via the binary wire format (REST only).
|
|
1244
|
+
*
|
|
1245
|
+
* Encodes `(id, vector)` pairs into the deterministic VRB1 binary layout
|
|
1246
|
+
* and POSTs them as `application/octet-stream`, avoiding per-point JSON
|
|
1247
|
+
* overhead. Payloads are not carried on this path. Not supported by the
|
|
1248
|
+
* WASM backend.
|
|
1249
|
+
*
|
|
1250
|
+
* @returns the number of points the server reports as inserted.
|
|
1251
|
+
*/
|
|
1252
|
+
upsertBatchRaw(collection: string, docs: VectorDocument[]): Promise<number>;
|
|
1141
1253
|
/** Search for similar vectors */
|
|
1142
1254
|
search(collection: string, query: number[] | Float32Array, options?: SearchOptions): Promise<SearchResult[]>;
|
|
1143
1255
|
/** Delete a vector by ID */
|
|
@@ -1175,6 +1287,11 @@ interface IVelesDBBackend {
|
|
|
1175
1287
|
collectionSanity(collection: string): Promise<CollectionSanityResponse>;
|
|
1176
1288
|
/** Multi-query fusion search */
|
|
1177
1289
|
multiQuerySearch(collection: string, vectors: Array<number[] | Float32Array>, options?: MultiQuerySearchOptions): Promise<SearchResult[]>;
|
|
1290
|
+
/** Multi-query fusion search returning only IDs and scores */
|
|
1291
|
+
multiQuerySearchIds(collection: string, vectors: Array<number[] | Float32Array>, options?: MultiQuerySearchOptions): Promise<Array<{
|
|
1292
|
+
id: number;
|
|
1293
|
+
score: number;
|
|
1294
|
+
}>>;
|
|
1178
1295
|
/** Check if collection is empty */
|
|
1179
1296
|
isEmpty(collection: string): Promise<boolean>;
|
|
1180
1297
|
/** Flush pending changes to disk */
|
|
@@ -1212,6 +1329,14 @@ interface IVelesDBBackend {
|
|
|
1212
1329
|
sparseSearchNamed(collection: string, query: SparseVector, indexName: string, options?: SparseSearchNamedOptions): Promise<SearchResult[]>;
|
|
1213
1330
|
/** Train Product Quantization on a collection */
|
|
1214
1331
|
trainPq(collection: string, options?: PqTrainOptions): Promise<string>;
|
|
1332
|
+
/**
|
|
1333
|
+
* Enable the bounded streaming-ingestion channel on a collection.
|
|
1334
|
+
*
|
|
1335
|
+
* POSTs an optional `StreamingConfig` to
|
|
1336
|
+
* `POST /collections/{name}/stream/enable`; omitted config fields fall
|
|
1337
|
+
* back to the server defaults. Must be called before `streamInsert`.
|
|
1338
|
+
*/
|
|
1339
|
+
enableStreaming(collection: string, config?: StreamingConfig): Promise<void>;
|
|
1215
1340
|
/** Stream-insert documents with backpressure support */
|
|
1216
1341
|
streamInsert(collection: string, docs: VectorDocument[]): Promise<void>;
|
|
1217
1342
|
/**
|
|
@@ -1239,12 +1364,28 @@ interface IVelesDBBackend {
|
|
|
1239
1364
|
storeSemanticFact(collection: string, entry: SemanticEntry): Promise<void>;
|
|
1240
1365
|
/** Search semantic memory */
|
|
1241
1366
|
searchSemanticMemory(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1242
|
-
/**
|
|
1243
|
-
|
|
1244
|
-
|
|
1367
|
+
/**
|
|
1368
|
+
* Record an episodic event. Returns the point ID as a string (u64
|
|
1369
|
+
* precision preserved).
|
|
1370
|
+
*/
|
|
1371
|
+
recordEpisodicEvent(collection: string, event: EpisodicEvent): Promise<string>;
|
|
1372
|
+
/** Recall episodic events by vector similarity. */
|
|
1245
1373
|
recallEpisodicEvents(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1246
|
-
/**
|
|
1247
|
-
|
|
1374
|
+
/**
|
|
1375
|
+
* Recall episodic events most-recent-first, optionally bounded below by
|
|
1376
|
+
* `since` (inclusive unix-seconds). Mirrors core `episodic.recent(since)`.
|
|
1377
|
+
*/
|
|
1378
|
+
recallRecentEvents(collection: string, since?: number): Promise<EpisodicRecord[]>;
|
|
1379
|
+
/**
|
|
1380
|
+
* Recall episodic events strictly older than `before` (unix-seconds),
|
|
1381
|
+
* most-recent-first. Mirrors core `episodic.older_than(before)`.
|
|
1382
|
+
*/
|
|
1383
|
+
recallOlderThanEvents(collection: string, before: number): Promise<EpisodicRecord[]>;
|
|
1384
|
+
/**
|
|
1385
|
+
* Store a procedural pattern. Returns the point ID as a string (u64
|
|
1386
|
+
* precision preserved).
|
|
1387
|
+
*/
|
|
1388
|
+
storeProceduralPattern(collection: string, pattern: ProceduralPattern): Promise<string>;
|
|
1248
1389
|
/** Match procedural patterns */
|
|
1249
1390
|
matchProceduralPatterns(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1250
1391
|
/** Rebuild a collection's HNSW index (compacts tombstones). */
|
|
@@ -1271,6 +1412,14 @@ interface IVelesDBBackend {
|
|
|
1271
1412
|
upsertNodePayload(collection: string, nodeId: number, payload: Record<string, unknown>): Promise<void>;
|
|
1272
1413
|
/** Vector similarity search scoped to graph nodes only. */
|
|
1273
1414
|
graphSearch(collection: string, request: GraphSearchRequest): Promise<GraphSearchResponse>;
|
|
1415
|
+
/** Create a typed relation edge between two points. Returns the allocated edge ID. */
|
|
1416
|
+
relate(collection: string, req: RelateRequest): Promise<RelateResponse>;
|
|
1417
|
+
/** Remove a relation edge by ID. Returns `true` if removed. */
|
|
1418
|
+
unrelate(collection: string, edgeId: GraphNodeId): Promise<boolean>;
|
|
1419
|
+
/** List outgoing relation edges for a point. */
|
|
1420
|
+
getRelations(collection: string, pointId: GraphNodeId): Promise<RelationsResponse>;
|
|
1421
|
+
/** Durably set (or refresh) the TTL of a point. */
|
|
1422
|
+
setTtlDurable(collection: string, pointId: GraphNodeId, ttlSeconds: number): Promise<void>;
|
|
1274
1423
|
}
|
|
1275
1424
|
|
|
1276
1425
|
/**
|
|
@@ -1328,16 +1477,31 @@ declare class AgentMemoryClient {
|
|
|
1328
1477
|
storeFact(collection: string, entry: SemanticEntry): Promise<void>;
|
|
1329
1478
|
/** Search semantic memory */
|
|
1330
1479
|
searchFacts(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1331
|
-
/** Record an episodic event. Returns the
|
|
1332
|
-
recordEvent(collection: string, event: EpisodicEvent): Promise<
|
|
1333
|
-
/** Recall episodic events */
|
|
1480
|
+
/** Record an episodic event. Returns the point ID (string, u64-safe). */
|
|
1481
|
+
recordEvent(collection: string, event: EpisodicEvent): Promise<string>;
|
|
1482
|
+
/** Recall episodic events by vector similarity. */
|
|
1334
1483
|
recallEvents(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1335
|
-
/**
|
|
1336
|
-
|
|
1484
|
+
/**
|
|
1485
|
+
* Recall episodic events most-recent-first, optionally bounded below by
|
|
1486
|
+
* `since` (inclusive unix-seconds). Mirrors core `episodic.recent(since)`.
|
|
1487
|
+
*/
|
|
1488
|
+
recallRecent(collection: string, since?: number): Promise<EpisodicRecord[]>;
|
|
1489
|
+
/**
|
|
1490
|
+
* Recall episodic events strictly older than `before` (unix-seconds),
|
|
1491
|
+
* most-recent-first. Mirrors core `episodic.older_than(before)`.
|
|
1492
|
+
*/
|
|
1493
|
+
recallOlderThan(collection: string, before: number): Promise<EpisodicRecord[]>;
|
|
1494
|
+
/** Store a procedural pattern. Returns the point ID (string, u64-safe). */
|
|
1495
|
+
learnProcedure(collection: string, pattern: ProceduralPattern): Promise<string>;
|
|
1337
1496
|
/** Match procedural patterns */
|
|
1338
1497
|
recallProcedures(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1339
|
-
/**
|
|
1340
|
-
|
|
1498
|
+
/**
|
|
1499
|
+
* Delete a memory entry (fact, event, or procedure) by its point ID.
|
|
1500
|
+
*
|
|
1501
|
+
* Accepts the `string` ids returned by `recordEvent` / `learnProcedure`
|
|
1502
|
+
* (u64-safe decimal strings) as well as numeric ids.
|
|
1503
|
+
*/
|
|
1504
|
+
deleteMemory(collection: string, id: string | number): Promise<boolean>;
|
|
1341
1505
|
}
|
|
1342
1506
|
|
|
1343
1507
|
/**
|
|
@@ -1369,6 +1533,18 @@ declare class VelesDB {
|
|
|
1369
1533
|
listCollections(): Promise<Collection[]>;
|
|
1370
1534
|
upsert(collection: string, doc: VectorDocument): Promise<void>;
|
|
1371
1535
|
upsertBatch(collection: string, docs: VectorDocument[]): Promise<void>;
|
|
1536
|
+
/**
|
|
1537
|
+
* Bulk upsert via the binary wire format (REST backend only).
|
|
1538
|
+
*
|
|
1539
|
+
* Encodes `(id, vector)` pairs into the deterministic VRB1 binary layout
|
|
1540
|
+
* and sends them as a single `application/octet-stream` request, avoiding
|
|
1541
|
+
* per-point JSON overhead. Payloads are not carried — use
|
|
1542
|
+
* {@link upsertBatch} when you need them. Throws a not-supported error on
|
|
1543
|
+
* the WASM backend.
|
|
1544
|
+
*
|
|
1545
|
+
* @returns the number of points the server reports as inserted.
|
|
1546
|
+
*/
|
|
1547
|
+
upsertBatchRaw(collection: string, docs: VectorDocument[]): Promise<number>;
|
|
1372
1548
|
delete(collection: string, id: string | number): Promise<boolean>;
|
|
1373
1549
|
get(collection: string, id: string | number): Promise<VectorDocument | null>;
|
|
1374
1550
|
isEmpty(collection: string): Promise<boolean>;
|
|
@@ -1391,6 +1567,11 @@ declare class VelesDB {
|
|
|
1391
1567
|
filter?: FilterInput;
|
|
1392
1568
|
}): Promise<SearchResult[]>;
|
|
1393
1569
|
multiQuerySearch(collection: string, vectors: Array<number[] | Float32Array>, options?: MultiQuerySearchOptions): Promise<SearchResult[]>;
|
|
1570
|
+
/** Multi-query fusion search returning only IDs and scores (no payloads). */
|
|
1571
|
+
multiQuerySearchIds(collection: string, vectors: Array<number[] | Float32Array>, options?: MultiQuerySearchOptions): Promise<Array<{
|
|
1572
|
+
id: number;
|
|
1573
|
+
score: number;
|
|
1574
|
+
}>>;
|
|
1394
1575
|
/**
|
|
1395
1576
|
* Pure sparse search against a named sparse index.
|
|
1396
1577
|
*
|
|
@@ -1405,6 +1586,7 @@ declare class VelesDB {
|
|
|
1405
1586
|
collectionSanity(collection: string): Promise<CollectionSanityResponse>;
|
|
1406
1587
|
scroll(collection: string, request?: ScrollRequest): Promise<ScrollResponse>;
|
|
1407
1588
|
trainPq(collection: string, options?: PqTrainOptions): Promise<string>;
|
|
1589
|
+
enableStreaming(collection: string, config?: StreamingConfig): Promise<void>;
|
|
1408
1590
|
streamInsert(collection: string, docs: VectorDocument[]): Promise<void>;
|
|
1409
1591
|
streamUpsertPoints(collection: string, docs: VectorDocument[]): Promise<StreamUpsertResponse>;
|
|
1410
1592
|
searchIds(collection: string, query: number[] | Float32Array, options?: SearchOptions): Promise<Array<{
|
|
@@ -1436,6 +1618,10 @@ declare class VelesDB {
|
|
|
1436
1618
|
getNodePayload(collection: string, nodeId: number): Promise<NodePayloadResponse>;
|
|
1437
1619
|
upsertNodePayload(collection: string, nodeId: number, payload: Record<string, unknown>): Promise<void>;
|
|
1438
1620
|
graphSearch(collection: string, request: GraphSearchRequest): Promise<GraphSearchResponse>;
|
|
1621
|
+
relate(collection: string, req: RelateRequest): Promise<RelateResponse>;
|
|
1622
|
+
unrelate(collection: string, edgeId: GraphNodeId): Promise<boolean>;
|
|
1623
|
+
getRelations(collection: string, pointId: GraphNodeId): Promise<RelationsResponse>;
|
|
1624
|
+
setTtlDurable(collection: string, pointId: GraphNodeId, ttlSeconds: number): Promise<void>;
|
|
1439
1625
|
capabilities(): Readonly<CapabilityMap>;
|
|
1440
1626
|
get backendType(): string;
|
|
1441
1627
|
agentMemory(config?: AgentMemoryConfig): AgentMemoryClient;
|
|
@@ -1465,6 +1651,7 @@ declare class WasmBackend implements IVelesDBBackend {
|
|
|
1465
1651
|
listCollections(): Promise<Collection[]>;
|
|
1466
1652
|
upsert(collectionName: string, doc: VectorDocument): Promise<void>;
|
|
1467
1653
|
upsertBatch(collectionName: string, docs: VectorDocument[]): Promise<void>;
|
|
1654
|
+
upsertBatchRaw(c: string, d: VectorDocument[]): Promise<number>;
|
|
1468
1655
|
delete(collectionName: string, id: string | number): Promise<boolean>;
|
|
1469
1656
|
get(collectionName: string, id: string | number): Promise<VectorDocument | null>;
|
|
1470
1657
|
isEmpty(collectionName: string): Promise<boolean>;
|
|
@@ -1502,6 +1689,7 @@ declare class WasmBackend implements IVelesDBBackend {
|
|
|
1502
1689
|
traverseParallel(c: string, r: TraverseParallelRequest): Promise<TraverseResponse>;
|
|
1503
1690
|
getNodeDegree(c: string, n: number): Promise<DegreeResponse>;
|
|
1504
1691
|
trainPq(c: string, o?: PqTrainOptions): Promise<string>;
|
|
1692
|
+
enableStreaming(c: string, cfg?: StreamingConfig): Promise<void>;
|
|
1505
1693
|
streamInsert(c: string, d: VectorDocument[]): Promise<void>;
|
|
1506
1694
|
streamUpsertPoints(c: string, d: VectorDocument[]): Promise<StreamUpsertResponse>;
|
|
1507
1695
|
createGraphCollection(n: string, c?: GraphCollectionConfig): Promise<void>;
|
|
@@ -1512,11 +1700,17 @@ declare class WasmBackend implements IVelesDBBackend {
|
|
|
1512
1700
|
id: number;
|
|
1513
1701
|
score: number;
|
|
1514
1702
|
}>>;
|
|
1703
|
+
multiQuerySearchIds(c: string, v: Array<number[] | Float32Array>, o?: MultiQuerySearchOptions): Promise<Array<{
|
|
1704
|
+
id: number;
|
|
1705
|
+
score: number;
|
|
1706
|
+
}>>;
|
|
1515
1707
|
storeSemanticFact(c: string, e: SemanticEntry): Promise<void>;
|
|
1516
1708
|
searchSemanticMemory(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1517
|
-
recordEpisodicEvent(c: string, e: EpisodicEvent): Promise<
|
|
1709
|
+
recordEpisodicEvent(c: string, e: EpisodicEvent): Promise<string>;
|
|
1518
1710
|
recallEpisodicEvents(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1519
|
-
|
|
1711
|
+
recallRecentEvents(c: string, since?: number): Promise<EpisodicRecord[]>;
|
|
1712
|
+
recallOlderThanEvents(c: string, before: number): Promise<EpisodicRecord[]>;
|
|
1713
|
+
storeProceduralPattern(c: string, p: ProceduralPattern): Promise<string>;
|
|
1520
1714
|
matchProceduralPatterns(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1521
1715
|
rebuildIndex(c: string): Promise<RebuildIndexResponse>;
|
|
1522
1716
|
getGuardrails(): Promise<GuardRailsConfigResponse>;
|
|
@@ -1531,6 +1725,10 @@ declare class WasmBackend implements IVelesDBBackend {
|
|
|
1531
1725
|
upsertNodePayload(c: string, id: number, p: Record<string, unknown>): Promise<void>;
|
|
1532
1726
|
graphSearch(c: string, r: GraphSearchRequest): Promise<GraphSearchResponse>;
|
|
1533
1727
|
sparseSearchNamed(c: string, q: SparseVector, idx: string, o?: SparseSearchNamedOptions): Promise<SearchResult[]>;
|
|
1728
|
+
relate(c: string, req: RelateRequest): Promise<RelateResponse>;
|
|
1729
|
+
unrelate(c: string, edgeId: GraphNodeId): Promise<boolean>;
|
|
1730
|
+
getRelations(c: string, pointId: GraphNodeId): Promise<RelationsResponse>;
|
|
1731
|
+
setTtlDurable(c: string, pointId: GraphNodeId, ttlSeconds: number): Promise<void>;
|
|
1534
1732
|
}
|
|
1535
1733
|
|
|
1536
1734
|
/**
|
|
@@ -1553,6 +1751,7 @@ declare class RestBackend implements IVelesDBBackend {
|
|
|
1553
1751
|
listCollections(): Promise<Collection[]>;
|
|
1554
1752
|
upsert(c: string, d: VectorDocument): Promise<void>;
|
|
1555
1753
|
upsertBatch(c: string, d: VectorDocument[]): Promise<void>;
|
|
1754
|
+
upsertBatchRaw(c: string, d: VectorDocument[]): Promise<number>;
|
|
1556
1755
|
delete(c: string, id: string | number): Promise<boolean>;
|
|
1557
1756
|
get(c: string, id: string | number): Promise<VectorDocument | null>;
|
|
1558
1757
|
isEmpty(c: string): Promise<boolean>;
|
|
@@ -1569,6 +1768,10 @@ declare class RestBackend implements IVelesDBBackend {
|
|
|
1569
1768
|
getNodePayload(c: string, id: number): Promise<NodePayloadResponse>;
|
|
1570
1769
|
upsertNodePayload(c: string, id: number, p: Record<string, unknown>): Promise<void>;
|
|
1571
1770
|
graphSearch(c: string, r: GraphSearchRequest): Promise<GraphSearchResponse>;
|
|
1771
|
+
relate(c: string, req: RelateRequest): Promise<RelateResponse>;
|
|
1772
|
+
unrelate(c: string, edgeId: GraphNodeId): Promise<boolean>;
|
|
1773
|
+
getRelations(c: string, pointId: GraphNodeId): Promise<RelationsResponse>;
|
|
1774
|
+
setTtlDurable(c: string, pointId: GraphNodeId, ttlSeconds: number): Promise<void>;
|
|
1572
1775
|
search(c: string, q: number[] | Float32Array, o?: SearchOptions): Promise<SearchResult[]>;
|
|
1573
1776
|
searchBatch(c: string, s: Array<{
|
|
1574
1777
|
vector: number[] | Float32Array;
|
|
@@ -1586,6 +1789,10 @@ declare class RestBackend implements IVelesDBBackend {
|
|
|
1586
1789
|
filter?: FilterInput;
|
|
1587
1790
|
}): Promise<SearchResult[]>;
|
|
1588
1791
|
multiQuerySearch(c: string, v: Array<number[] | Float32Array>, o?: MultiQuerySearchOptions): Promise<SearchResult[]>;
|
|
1792
|
+
multiQuerySearchIds(c: string, v: Array<number[] | Float32Array>, o?: MultiQuerySearchOptions): Promise<Array<{
|
|
1793
|
+
id: number;
|
|
1794
|
+
score: number;
|
|
1795
|
+
}>>;
|
|
1589
1796
|
searchIds(c: string, q: number[] | Float32Array, o?: SearchOptions): Promise<Array<{
|
|
1590
1797
|
id: number;
|
|
1591
1798
|
score: number;
|
|
@@ -1611,13 +1818,16 @@ declare class RestBackend implements IVelesDBBackend {
|
|
|
1611
1818
|
analyzeCollection(c: string): Promise<CollectionStatsResponse>;
|
|
1612
1819
|
getCollectionConfig(c: string): Promise<CollectionConfigResponse>;
|
|
1613
1820
|
trainPq(c: string, o?: PqTrainOptions): Promise<string>;
|
|
1821
|
+
enableStreaming(c: string, cfg?: StreamingConfig): Promise<void>;
|
|
1614
1822
|
streamInsert(c: string, d: VectorDocument[]): Promise<void>;
|
|
1615
1823
|
streamUpsertPoints(c: string, d: VectorDocument[]): Promise<StreamUpsertResponse>;
|
|
1616
1824
|
storeSemanticFact(c: string, e: SemanticEntry): Promise<void>;
|
|
1617
1825
|
searchSemanticMemory(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1618
|
-
recordEpisodicEvent(c: string, e: EpisodicEvent): Promise<
|
|
1826
|
+
recordEpisodicEvent(c: string, e: EpisodicEvent): Promise<string>;
|
|
1619
1827
|
recallEpisodicEvents(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1620
|
-
|
|
1828
|
+
recallRecentEvents(c: string, since?: number): Promise<EpisodicRecord[]>;
|
|
1829
|
+
recallOlderThanEvents(c: string, before: number): Promise<EpisodicRecord[]>;
|
|
1830
|
+
storeProceduralPattern(c: string, p: ProceduralPattern): Promise<string>;
|
|
1621
1831
|
matchProceduralPatterns(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1622
1832
|
}
|
|
1623
1833
|
|
|
@@ -2109,4 +2319,4 @@ declare class OpenAIEmbedder implements Embedder {
|
|
|
2109
2319
|
embed(texts: string[]): Promise<number[][]>;
|
|
2110
2320
|
}
|
|
2111
2321
|
|
|
2112
|
-
export { type ActualStats, type AddEdgeRequest, AgentMemoryClient, type AgentMemoryConfig, type AggregateQueryOptions, type AggregateResponse, type AggregationQueryResponse, AllocationFailedError, type AsyncIndexBuilderOptions, type BackendType, BackpressureError, type CapabilityMap, type Collection, type CollectionConfig, type CollectionConfigResponse, CollectionExistsError, CollectionNotFoundError, type CollectionSanityChecks, type CollectionSanityDiagnostics, type CollectionSanityResponse, type CollectionStatsResponse, type CollectionType, type ColumnStatsDetail, ColumnStoreError, type CompareOp, type Condition, ConfigError, ConnectionError, type CreateIndexOptions, DatabaseLockedError, type DeferredIndexerOptions, type DegreeResponse, DimensionMismatchError, type DistanceMetric, EdgeExistsError, EdgeNotFoundError, type EdgesResponse, type Embedder, type EpisodicEvent, EpochMismatchError, type ExplainCost, type ExplainFeatures, type ExplainPlanStep, type ExplainResponse, type Filter, type FilterInput, type FusionOptions, type FusionStrategy, type GetEdgesOptions, type GetNodeEdgesOptions, GpuError, type GraphCollectionConfig, type GraphEdge, type GraphNodeId, GraphNotSupportedError, type GraphSchemaMode, type GraphSearchRequest, type GraphSearchResponse, type GraphSearchResultItem, GuardRailError, type GuardRailsConfigResponse, type GuardRailsUpdateRequest, type HnswParams, type IVelesDBBackend, IncompatibleSchemaVersionError, IndexCorruptedError, IndexError, type IndexInfo, type IndexType, InternalError, InvalidCollectionNameError, InvalidDimensionError, InvalidEdgeLabelError, InvalidQuantizerConfigError, InvalidVectorError, IoError, type JsonValue, type ListNodesResponse, type MatchQueryOptions, type MatchQueryResponse, type MatchQueryResultItem, type MultiQuerySearchOptions, type NearVectorOptions, NodeNotFoundError, type NodePayloadResponse, type NodeStats, NotFoundError, OpenAIEmbedder, type OpenAIEmbedderOptions, OverflowError, PointNotFoundError, type PqTrainOptions, type ProceduralPattern, type QueryApiResponse, QueryError, type QueryOptions, type QueryResponse, type QueryResult, type QueryStats, REST_CAPABILITIES, type RebuildIndexResponse, type RelDirection, type RelOptions, RestBackend, type RestPointId, SchemaValidationError, type ScrollRequest, type ScrollResponse, SearchNotSupportedError, type SearchOptions, type SearchQuality, type SearchQualityWire, type SearchResult, type SemanticEntry, SerializationError, SnapshotBuildFailedError, SparseIndexError, type SparseSearchNamedOptions, type SparseVector, StorageError, type StorageMode, type StreamUpsertResponse, TrainingFailedError, type TraversalResultItem, type TraversalStats, type TraverseParallelRequest, type TraverseRequest, type TraverseResponse, VELES_ERROR_CODES, ValidationError, type VectorDocument, VectorNotAllowedError, VectorRequiredError, VelesDB, type VelesDBConfig, VelesDBError, VelesError, type VelesErrorCode, VelesQLBuilder, WASM_CAPABILITIES, WasmBackend, f, isTypedFilter, normalizeFilter, parseVelesError, searchQualityToMode, velesql };
|
|
2322
|
+
export { type ActualStats, type AddEdgeRequest, AgentMemoryClient, type AgentMemoryConfig, type AggregateQueryOptions, type AggregateResponse, type AggregationQueryResponse, AllocationFailedError, type AsyncIndexBuilderOptions, type BackendType, BackpressureError, type CapabilityMap, type Collection, type CollectionConfig, type CollectionConfigResponse, CollectionExistsError, CollectionNotFoundError, type CollectionSanityChecks, type CollectionSanityDiagnostics, type CollectionSanityResponse, type CollectionStatsResponse, type CollectionType, type ColumnStatsDetail, ColumnStoreError, type CompareOp, type Condition, ConfigError, ConnectionError, type CreateIndexOptions, DatabaseLockedError, type DeferredIndexerOptions, type DegreeResponse, DimensionMismatchError, type DistanceMetric, EdgeExistsError, EdgeNotFoundError, type EdgesResponse, type Embedder, type EpisodicEvent, type EpisodicRecord, EpochMismatchError, type ExplainCost, type ExplainFeatures, type ExplainPlanStep, type ExplainResponse, type Filter, type FilterInput, type FusionOptions, type FusionStrategy, type GetEdgesOptions, type GetNodeEdgesOptions, GpuError, type GraphCollectionConfig, type GraphEdge, type GraphNodeId, GraphNotSupportedError, type GraphSchemaMode, type GraphSearchRequest, type GraphSearchResponse, type GraphSearchResultItem, GuardRailError, type GuardRailsConfigResponse, type GuardRailsUpdateRequest, type HnswParams, type IVelesDBBackend, IncompatibleSchemaVersionError, IndexCorruptedError, IndexError, type IndexInfo, type IndexType, InternalError, InvalidCollectionNameError, InvalidDimensionError, InvalidEdgeLabelError, InvalidQuantizerConfigError, InvalidVectorError, IoError, type JsonValue, type ListNodesResponse, type MatchQueryOptions, type MatchQueryResponse, type MatchQueryResultItem, type MultiQuerySearchOptions, type NearVectorOptions, NodeNotFoundError, type NodePayloadResponse, type NodeStats, NotFoundError, OpenAIEmbedder, type OpenAIEmbedderOptions, OverflowError, PointNotFoundError, type PqTrainOptions, type ProceduralPattern, type QueryApiResponse, QueryError, type QueryOptions, type QueryResponse, type QueryResult, type QueryStats, REST_CAPABILITIES, type RebuildIndexResponse, type RelDirection, type RelOptions, type RelateRequest, type RelateResponse, type RelationEdge, type RelationsResponse, RestBackend, type RestPointId, SchemaValidationError, type ScrollRequest, type ScrollResponse, SearchNotSupportedError, type SearchOptions, type SearchQuality, type SearchQualityWire, type SearchResult, type SemanticEntry, SerializationError, SnapshotBuildFailedError, SparseIndexError, type SparseSearchNamedOptions, type SparseVector, StorageError, type StorageMode, type StreamUpsertResponse, type StreamingConfig, TrainingFailedError, type TraversalResultItem, type TraversalStats, type TraverseParallelRequest, type TraverseRequest, type TraverseResponse, VELES_ERROR_CODES, ValidationError, type VectorDocument, VectorNotAllowedError, VectorRequiredError, VelesDB, type VelesDBConfig, VelesDBError, VelesError, type VelesErrorCode, VelesQLBuilder, WASM_CAPABILITIES, WasmBackend, f, isTypedFilter, normalizeFilter, parseVelesError, searchQualityToMode, velesql };
|