@wiscale/velesdb-sdk 1.17.0 → 2.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/LICENSE +356 -20
- package/README.md +169 -11
- package/dist/index.d.mts +203 -44
- package/dist/index.d.ts +203 -44
- package/dist/index.js +391 -97
- package/dist/index.mjs +391 -97
- 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 */
|
|
@@ -470,14 +477,16 @@ interface SearchResult {
|
|
|
470
477
|
* @packageDocumentation
|
|
471
478
|
*/
|
|
472
479
|
|
|
480
|
+
/** Graph node/edge ID. Large u64 IDs may be returned as strings to preserve precision. */
|
|
481
|
+
type GraphNodeId = number | string;
|
|
473
482
|
/** Graph edge representing a relationship between nodes */
|
|
474
483
|
interface GraphEdge {
|
|
475
484
|
/** Unique edge ID */
|
|
476
|
-
id:
|
|
485
|
+
id: GraphNodeId;
|
|
477
486
|
/** Source node ID */
|
|
478
|
-
source:
|
|
487
|
+
source: GraphNodeId;
|
|
479
488
|
/** Target node ID */
|
|
480
|
-
target:
|
|
489
|
+
target: GraphNodeId;
|
|
481
490
|
/** Edge label (relationship type, e.g., "KNOWS", "FOLLOWS") */
|
|
482
491
|
label: string;
|
|
483
492
|
/** Edge properties */
|
|
@@ -504,7 +513,7 @@ interface GetEdgesOptions {
|
|
|
504
513
|
/** Request for graph traversal (EPIC-016 US-050) */
|
|
505
514
|
interface TraverseRequest {
|
|
506
515
|
/** Source node ID to start traversal from */
|
|
507
|
-
source:
|
|
516
|
+
source: GraphNodeId;
|
|
508
517
|
/** Traversal strategy: 'bfs' or 'dfs' */
|
|
509
518
|
strategy?: 'bfs' | 'dfs';
|
|
510
519
|
/** Maximum traversal depth */
|
|
@@ -519,7 +528,7 @@ interface TraverseRequest {
|
|
|
519
528
|
/** Request for multi-source parallel BFS traversal */
|
|
520
529
|
interface TraverseParallelRequest {
|
|
521
530
|
/** Source node IDs to start traversal from */
|
|
522
|
-
sources:
|
|
531
|
+
sources: GraphNodeId[];
|
|
523
532
|
/** Maximum traversal depth */
|
|
524
533
|
maxDepth?: number;
|
|
525
534
|
/** Maximum number of results to return */
|
|
@@ -530,11 +539,11 @@ interface TraverseParallelRequest {
|
|
|
530
539
|
/** A single traversal result item */
|
|
531
540
|
interface TraversalResultItem {
|
|
532
541
|
/** Target node ID reached */
|
|
533
|
-
targetId:
|
|
542
|
+
targetId: GraphNodeId;
|
|
534
543
|
/** Depth of traversal (number of hops from source) */
|
|
535
544
|
depth: number;
|
|
536
545
|
/** Path taken (list of edge IDs) */
|
|
537
|
-
path:
|
|
546
|
+
path: GraphNodeId[];
|
|
538
547
|
}
|
|
539
548
|
/** Statistics from traversal operation */
|
|
540
549
|
interface TraversalStats {
|
|
@@ -561,6 +570,42 @@ interface DegreeResponse {
|
|
|
561
570
|
/** Number of outgoing edges */
|
|
562
571
|
outDegree: number;
|
|
563
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
|
+
}
|
|
564
609
|
/** Schema mode for graph collections */
|
|
565
610
|
type GraphSchemaMode = 'schemaless' | 'strict';
|
|
566
611
|
/** Graph collection configuration */
|
|
@@ -581,8 +626,15 @@ interface GraphCollectionConfig {
|
|
|
581
626
|
*/
|
|
582
627
|
/** Semantic memory entry */
|
|
583
628
|
interface SemanticEntry {
|
|
584
|
-
/**
|
|
585
|
-
|
|
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;
|
|
586
638
|
/** Fact text content */
|
|
587
639
|
text: string;
|
|
588
640
|
/** Embedding vector */
|
|
@@ -592,8 +644,24 @@ interface SemanticEntry {
|
|
|
592
644
|
}
|
|
593
645
|
/** Episodic memory event */
|
|
594
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;
|
|
595
655
|
/** Event type identifier */
|
|
596
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;
|
|
597
665
|
/** Event data */
|
|
598
666
|
data: Record<string, unknown>;
|
|
599
667
|
/** Embedding vector */
|
|
@@ -603,13 +671,38 @@ interface EpisodicEvent {
|
|
|
603
671
|
}
|
|
604
672
|
/** Procedural memory pattern */
|
|
605
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;
|
|
606
682
|
/** Procedure name */
|
|
607
683
|
name: string;
|
|
608
684
|
/** Ordered steps */
|
|
609
685
|
steps: string[];
|
|
686
|
+
/**
|
|
687
|
+
* Embedding vector for the pattern.
|
|
688
|
+
*
|
|
689
|
+
* Required so that `matchProceduralPatterns` (a vector search) can
|
|
690
|
+
* recall the pattern — a point stored without a vector is invisible
|
|
691
|
+
* to similarity search.
|
|
692
|
+
*/
|
|
693
|
+
embedding: number[];
|
|
610
694
|
/** Optional metadata */
|
|
611
695
|
metadata?: Record<string, unknown>;
|
|
612
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
|
+
}
|
|
613
706
|
/** Agent memory configuration */
|
|
614
707
|
interface AgentMemoryConfig {
|
|
615
708
|
/** Embedding dimension (default: 384) */
|
|
@@ -929,11 +1022,17 @@ declare const REST_CAPABILITIES: Readonly<CapabilityMap>;
|
|
|
929
1022
|
* Capability map for the WASM backend.
|
|
930
1023
|
*
|
|
931
1024
|
* The WASM build ships a focused subset: the dense / text / hybrid /
|
|
932
|
-
* multi-query search paths
|
|
933
|
-
*
|
|
934
|
-
*
|
|
935
|
-
*
|
|
936
|
-
*
|
|
1025
|
+
* multi-query search paths. Everything that relies on persistent
|
|
1026
|
+
* on-disk structures (secondary indexes, graph, streaming, PQ
|
|
1027
|
+
* training, agent memory, introspection, sparse inverted index) is
|
|
1028
|
+
* explicitly `false`. See `backends/wasm-stubs.ts` for the exact set
|
|
1029
|
+
* of `wasmNotSupported()` throw sites.
|
|
1030
|
+
*
|
|
1031
|
+
* `velesqlQuery` is `false`: `query()` only executes pure top-k NEAR
|
|
1032
|
+
* statements (`SELECT * FROM <collection> WHERE vector NEAR $param
|
|
1033
|
+
* [LIMIT n]`) and throws `NOT_SUPPORTED` for any other VelesQL clause
|
|
1034
|
+
* (WHERE predicates, JOIN, GROUP BY, MATCH, set operations, FUSION),
|
|
1035
|
+
* so full VelesQL is not advertised.
|
|
937
1036
|
*/
|
|
938
1037
|
declare const WASM_CAPABILITIES: Readonly<CapabilityMap>;
|
|
939
1038
|
|
|
@@ -944,6 +1043,7 @@ declare const WASM_CAPABILITIES: Readonly<CapabilityMap>;
|
|
|
944
1043
|
* aggregate, match query, graph node operations, and graph search.
|
|
945
1044
|
* @packageDocumentation
|
|
946
1045
|
*/
|
|
1046
|
+
|
|
947
1047
|
/** Result of `POST /collections/{name}/index/rebuild`. */
|
|
948
1048
|
interface RebuildIndexResponse {
|
|
949
1049
|
/** Informational message from the server. */
|
|
@@ -975,8 +1075,8 @@ interface GuardRailsConfigResponse {
|
|
|
975
1075
|
}
|
|
976
1076
|
/** Options for `listNodes`. */
|
|
977
1077
|
interface ListNodesResponse {
|
|
978
|
-
/** Node IDs in insertion order. */
|
|
979
|
-
nodeIds:
|
|
1078
|
+
/** Node IDs in insertion order (string|number to preserve u64 precision). */
|
|
1079
|
+
nodeIds: GraphNodeId[];
|
|
980
1080
|
/** Total count -- matches `nodeIds.length`. */
|
|
981
1081
|
count: number;
|
|
982
1082
|
}
|
|
@@ -990,7 +1090,7 @@ interface GetNodeEdgesOptions {
|
|
|
990
1090
|
/** Result of `GET /collections/{name}/graph/nodes/{id}/payload`. */
|
|
991
1091
|
interface NodePayloadResponse {
|
|
992
1092
|
/** Node ID. */
|
|
993
|
-
nodeId:
|
|
1093
|
+
nodeId: GraphNodeId;
|
|
994
1094
|
/** Stored payload -- `null` if no payload has been set. */
|
|
995
1095
|
payload: Record<string, unknown> | null;
|
|
996
1096
|
}
|
|
@@ -1004,7 +1104,7 @@ interface GraphSearchRequest {
|
|
|
1004
1104
|
/** Single result item from `graphSearch`. */
|
|
1005
1105
|
interface GraphSearchResultItem {
|
|
1006
1106
|
/** Node ID. */
|
|
1007
|
-
id:
|
|
1107
|
+
id: GraphNodeId;
|
|
1008
1108
|
/** Similarity score. */
|
|
1009
1109
|
score: number;
|
|
1010
1110
|
/** Optional node payload (mirror of `GraphSearchResultItem.payload`). */
|
|
@@ -1044,7 +1144,7 @@ interface MatchQueryResponse {
|
|
|
1044
1144
|
/** Single row of a `MatchQueryResponse`. */
|
|
1045
1145
|
interface MatchQueryResultItem {
|
|
1046
1146
|
/** Variable-binding map from the MATCH pattern. */
|
|
1047
|
-
bindings: Record<string,
|
|
1147
|
+
bindings: Record<string, GraphNodeId>;
|
|
1048
1148
|
/** Similarity score, present only when `similarity()` was used. */
|
|
1049
1149
|
score?: number;
|
|
1050
1150
|
/** Traversal depth reached to produce this row. */
|
|
@@ -1093,13 +1193,6 @@ interface StreamUpsertResponse {
|
|
|
1093
1193
|
networkErrors: number;
|
|
1094
1194
|
}
|
|
1095
1195
|
|
|
1096
|
-
/**
|
|
1097
|
-
* VelesDB TypeScript SDK - Backend Interface
|
|
1098
|
-
*
|
|
1099
|
-
* The `IVelesDBBackend` interface that all backends must implement.
|
|
1100
|
-
* @packageDocumentation
|
|
1101
|
-
*/
|
|
1102
|
-
|
|
1103
1196
|
/** Backend interface that all backends must implement */
|
|
1104
1197
|
interface IVelesDBBackend {
|
|
1105
1198
|
/** Initialize the backend */
|
|
@@ -1228,12 +1321,28 @@ interface IVelesDBBackend {
|
|
|
1228
1321
|
storeSemanticFact(collection: string, entry: SemanticEntry): Promise<void>;
|
|
1229
1322
|
/** Search semantic memory */
|
|
1230
1323
|
searchSemanticMemory(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1231
|
-
/**
|
|
1232
|
-
|
|
1233
|
-
|
|
1324
|
+
/**
|
|
1325
|
+
* Record an episodic event. Returns the point ID as a string (u64
|
|
1326
|
+
* precision preserved).
|
|
1327
|
+
*/
|
|
1328
|
+
recordEpisodicEvent(collection: string, event: EpisodicEvent): Promise<string>;
|
|
1329
|
+
/** Recall episodic events by vector similarity. */
|
|
1234
1330
|
recallEpisodicEvents(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1235
|
-
/**
|
|
1236
|
-
|
|
1331
|
+
/**
|
|
1332
|
+
* Recall episodic events most-recent-first, optionally bounded below by
|
|
1333
|
+
* `since` (inclusive unix-seconds). Mirrors core `episodic.recent(since)`.
|
|
1334
|
+
*/
|
|
1335
|
+
recallRecentEvents(collection: string, since?: number): Promise<EpisodicRecord[]>;
|
|
1336
|
+
/**
|
|
1337
|
+
* Recall episodic events strictly older than `before` (unix-seconds),
|
|
1338
|
+
* most-recent-first. Mirrors core `episodic.older_than(before)`.
|
|
1339
|
+
*/
|
|
1340
|
+
recallOlderThanEvents(collection: string, before: number): Promise<EpisodicRecord[]>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Store a procedural pattern. Returns the point ID as a string (u64
|
|
1343
|
+
* precision preserved).
|
|
1344
|
+
*/
|
|
1345
|
+
storeProceduralPattern(collection: string, pattern: ProceduralPattern): Promise<string>;
|
|
1237
1346
|
/** Match procedural patterns */
|
|
1238
1347
|
matchProceduralPatterns(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1239
1348
|
/** Rebuild a collection's HNSW index (compacts tombstones). */
|
|
@@ -1260,6 +1369,14 @@ interface IVelesDBBackend {
|
|
|
1260
1369
|
upsertNodePayload(collection: string, nodeId: number, payload: Record<string, unknown>): Promise<void>;
|
|
1261
1370
|
/** Vector similarity search scoped to graph nodes only. */
|
|
1262
1371
|
graphSearch(collection: string, request: GraphSearchRequest): Promise<GraphSearchResponse>;
|
|
1372
|
+
/** Create a typed relation edge between two points. Returns the allocated edge ID. */
|
|
1373
|
+
relate(collection: string, req: RelateRequest): Promise<RelateResponse>;
|
|
1374
|
+
/** Remove a relation edge by ID. Returns `true` if removed. */
|
|
1375
|
+
unrelate(collection: string, edgeId: GraphNodeId): Promise<boolean>;
|
|
1376
|
+
/** List outgoing relation edges for a point. */
|
|
1377
|
+
getRelations(collection: string, pointId: GraphNodeId): Promise<RelationsResponse>;
|
|
1378
|
+
/** Durably set (or refresh) the TTL of a point. */
|
|
1379
|
+
setTtlDurable(collection: string, pointId: GraphNodeId, ttlSeconds: number): Promise<void>;
|
|
1263
1380
|
}
|
|
1264
1381
|
|
|
1265
1382
|
/**
|
|
@@ -1302,20 +1419,46 @@ declare class AgentMemoryClient {
|
|
|
1302
1419
|
private readonly backend;
|
|
1303
1420
|
private readonly config?;
|
|
1304
1421
|
constructor(backend: IVelesDBBackend, config?: AgentMemoryConfig | undefined);
|
|
1305
|
-
/**
|
|
1422
|
+
/**
|
|
1423
|
+
* Advisory embedding dimension passed at construction (default: 384).
|
|
1424
|
+
*
|
|
1425
|
+
* This value is **not** enforced and does not create or size any
|
|
1426
|
+
* collection — the dimension that actually governs storage and search
|
|
1427
|
+
* is the one fixed when the collection was created
|
|
1428
|
+
* (`db.createCollection(name, { dimension, metric: 'cosine' })`).
|
|
1429
|
+
* Embeddings you pass to `storeFact` / `recordEvent` / `learnProcedure`
|
|
1430
|
+
* must match that collection dimension.
|
|
1431
|
+
*/
|
|
1306
1432
|
get dimension(): number;
|
|
1307
1433
|
/** Store a semantic fact */
|
|
1308
1434
|
storeFact(collection: string, entry: SemanticEntry): Promise<void>;
|
|
1309
1435
|
/** Search semantic memory */
|
|
1310
1436
|
searchFacts(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1311
|
-
/** Record an episodic event */
|
|
1312
|
-
recordEvent(collection: string, event: EpisodicEvent): Promise<
|
|
1313
|
-
/** Recall episodic events */
|
|
1437
|
+
/** Record an episodic event. Returns the point ID (string, u64-safe). */
|
|
1438
|
+
recordEvent(collection: string, event: EpisodicEvent): Promise<string>;
|
|
1439
|
+
/** Recall episodic events by vector similarity. */
|
|
1314
1440
|
recallEvents(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1315
|
-
/**
|
|
1316
|
-
|
|
1441
|
+
/**
|
|
1442
|
+
* Recall episodic events most-recent-first, optionally bounded below by
|
|
1443
|
+
* `since` (inclusive unix-seconds). Mirrors core `episodic.recent(since)`.
|
|
1444
|
+
*/
|
|
1445
|
+
recallRecent(collection: string, since?: number): Promise<EpisodicRecord[]>;
|
|
1446
|
+
/**
|
|
1447
|
+
* Recall episodic events strictly older than `before` (unix-seconds),
|
|
1448
|
+
* most-recent-first. Mirrors core `episodic.older_than(before)`.
|
|
1449
|
+
*/
|
|
1450
|
+
recallOlderThan(collection: string, before: number): Promise<EpisodicRecord[]>;
|
|
1451
|
+
/** Store a procedural pattern. Returns the point ID (string, u64-safe). */
|
|
1452
|
+
learnProcedure(collection: string, pattern: ProceduralPattern): Promise<string>;
|
|
1317
1453
|
/** Match procedural patterns */
|
|
1318
1454
|
recallProcedures(collection: string, embedding: number[], k?: number): Promise<SearchResult[]>;
|
|
1455
|
+
/**
|
|
1456
|
+
* Delete a memory entry (fact, event, or procedure) by its point ID.
|
|
1457
|
+
*
|
|
1458
|
+
* Accepts the `string` ids returned by `recordEvent` / `learnProcedure`
|
|
1459
|
+
* (u64-safe decimal strings) as well as numeric ids.
|
|
1460
|
+
*/
|
|
1461
|
+
deleteMemory(collection: string, id: string | number): Promise<boolean>;
|
|
1319
1462
|
}
|
|
1320
1463
|
|
|
1321
1464
|
/**
|
|
@@ -1414,6 +1557,10 @@ declare class VelesDB {
|
|
|
1414
1557
|
getNodePayload(collection: string, nodeId: number): Promise<NodePayloadResponse>;
|
|
1415
1558
|
upsertNodePayload(collection: string, nodeId: number, payload: Record<string, unknown>): Promise<void>;
|
|
1416
1559
|
graphSearch(collection: string, request: GraphSearchRequest): Promise<GraphSearchResponse>;
|
|
1560
|
+
relate(collection: string, req: RelateRequest): Promise<RelateResponse>;
|
|
1561
|
+
unrelate(collection: string, edgeId: GraphNodeId): Promise<boolean>;
|
|
1562
|
+
getRelations(collection: string, pointId: GraphNodeId): Promise<RelationsResponse>;
|
|
1563
|
+
setTtlDurable(collection: string, pointId: GraphNodeId, ttlSeconds: number): Promise<void>;
|
|
1417
1564
|
capabilities(): Readonly<CapabilityMap>;
|
|
1418
1565
|
get backendType(): string;
|
|
1419
1566
|
agentMemory(config?: AgentMemoryConfig): AgentMemoryClient;
|
|
@@ -1492,9 +1639,11 @@ declare class WasmBackend implements IVelesDBBackend {
|
|
|
1492
1639
|
}>>;
|
|
1493
1640
|
storeSemanticFact(c: string, e: SemanticEntry): Promise<void>;
|
|
1494
1641
|
searchSemanticMemory(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1495
|
-
recordEpisodicEvent(c: string, e: EpisodicEvent): Promise<
|
|
1642
|
+
recordEpisodicEvent(c: string, e: EpisodicEvent): Promise<string>;
|
|
1496
1643
|
recallEpisodicEvents(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1497
|
-
|
|
1644
|
+
recallRecentEvents(c: string, since?: number): Promise<EpisodicRecord[]>;
|
|
1645
|
+
recallOlderThanEvents(c: string, before: number): Promise<EpisodicRecord[]>;
|
|
1646
|
+
storeProceduralPattern(c: string, p: ProceduralPattern): Promise<string>;
|
|
1498
1647
|
matchProceduralPatterns(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1499
1648
|
rebuildIndex(c: string): Promise<RebuildIndexResponse>;
|
|
1500
1649
|
getGuardrails(): Promise<GuardRailsConfigResponse>;
|
|
@@ -1509,6 +1658,10 @@ declare class WasmBackend implements IVelesDBBackend {
|
|
|
1509
1658
|
upsertNodePayload(c: string, id: number, p: Record<string, unknown>): Promise<void>;
|
|
1510
1659
|
graphSearch(c: string, r: GraphSearchRequest): Promise<GraphSearchResponse>;
|
|
1511
1660
|
sparseSearchNamed(c: string, q: SparseVector, idx: string, o?: SparseSearchNamedOptions): Promise<SearchResult[]>;
|
|
1661
|
+
relate(c: string, req: RelateRequest): Promise<RelateResponse>;
|
|
1662
|
+
unrelate(c: string, edgeId: GraphNodeId): Promise<boolean>;
|
|
1663
|
+
getRelations(c: string, pointId: GraphNodeId): Promise<RelationsResponse>;
|
|
1664
|
+
setTtlDurable(c: string, pointId: GraphNodeId, ttlSeconds: number): Promise<void>;
|
|
1512
1665
|
}
|
|
1513
1666
|
|
|
1514
1667
|
/**
|
|
@@ -1547,6 +1700,10 @@ declare class RestBackend implements IVelesDBBackend {
|
|
|
1547
1700
|
getNodePayload(c: string, id: number): Promise<NodePayloadResponse>;
|
|
1548
1701
|
upsertNodePayload(c: string, id: number, p: Record<string, unknown>): Promise<void>;
|
|
1549
1702
|
graphSearch(c: string, r: GraphSearchRequest): Promise<GraphSearchResponse>;
|
|
1703
|
+
relate(c: string, req: RelateRequest): Promise<RelateResponse>;
|
|
1704
|
+
unrelate(c: string, edgeId: GraphNodeId): Promise<boolean>;
|
|
1705
|
+
getRelations(c: string, pointId: GraphNodeId): Promise<RelationsResponse>;
|
|
1706
|
+
setTtlDurable(c: string, pointId: GraphNodeId, ttlSeconds: number): Promise<void>;
|
|
1550
1707
|
search(c: string, q: number[] | Float32Array, o?: SearchOptions): Promise<SearchResult[]>;
|
|
1551
1708
|
searchBatch(c: string, s: Array<{
|
|
1552
1709
|
vector: number[] | Float32Array;
|
|
@@ -1593,9 +1750,11 @@ declare class RestBackend implements IVelesDBBackend {
|
|
|
1593
1750
|
streamUpsertPoints(c: string, d: VectorDocument[]): Promise<StreamUpsertResponse>;
|
|
1594
1751
|
storeSemanticFact(c: string, e: SemanticEntry): Promise<void>;
|
|
1595
1752
|
searchSemanticMemory(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1596
|
-
recordEpisodicEvent(c: string, e: EpisodicEvent): Promise<
|
|
1753
|
+
recordEpisodicEvent(c: string, e: EpisodicEvent): Promise<string>;
|
|
1597
1754
|
recallEpisodicEvents(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1598
|
-
|
|
1755
|
+
recallRecentEvents(c: string, since?: number): Promise<EpisodicRecord[]>;
|
|
1756
|
+
recallOlderThanEvents(c: string, before: number): Promise<EpisodicRecord[]>;
|
|
1757
|
+
storeProceduralPattern(c: string, p: ProceduralPattern): Promise<string>;
|
|
1599
1758
|
matchProceduralPatterns(c: string, e: number[], k?: number): Promise<SearchResult[]>;
|
|
1600
1759
|
}
|
|
1601
1760
|
|
|
@@ -2087,4 +2246,4 @@ declare class OpenAIEmbedder implements Embedder {
|
|
|
2087
2246
|
embed(texts: string[]): Promise<number[][]>;
|
|
2088
2247
|
}
|
|
2089
2248
|
|
|
2090
|
-
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, 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 };
|
|
2249
|
+
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, 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 };
|