@wiscale/tauri-plugin-velesdb 1.11.0 → 1.13.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/dist/index.d.mts +269 -11
- package/dist/index.d.ts +269 -11
- package/dist/index.js +40 -0
- package/dist/index.mjs +32 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
*/
|
|
24
24
|
/** Distance metric for vector similarity. */
|
|
25
25
|
type DistanceMetric = 'cosine' | 'euclidean' | 'dot' | 'hamming' | 'jaccard';
|
|
26
|
-
/**
|
|
26
|
+
/** Storage mode for vector compression. */
|
|
27
|
+
type StorageMode = 'full' | 'sq8' | 'binary' | 'pq' | 'rabitq';
|
|
28
|
+
/** Request to create a new vector collection. */
|
|
27
29
|
interface CreateCollectionRequest {
|
|
28
30
|
/** Collection name (unique identifier). */
|
|
29
31
|
name: string;
|
|
@@ -31,6 +33,29 @@ interface CreateCollectionRequest {
|
|
|
31
33
|
dimension: number;
|
|
32
34
|
/** Distance metric for similarity calculations. Default: 'cosine'. */
|
|
33
35
|
metric?: DistanceMetric;
|
|
36
|
+
/** Storage mode for vector compression. Default: 'full'. */
|
|
37
|
+
storageMode?: StorageMode;
|
|
38
|
+
/** HNSW M parameter (max connections per node). Auto-tuned if omitted. */
|
|
39
|
+
hnswM?: number;
|
|
40
|
+
/** HNSW ef_construction parameter. Auto-tuned if omitted. */
|
|
41
|
+
hnswEfConstruction?: number;
|
|
42
|
+
/** HNSW alpha for neighbor diversification. Default: 1.2. */
|
|
43
|
+
hnswAlpha?: number;
|
|
44
|
+
/** HNSW initial max elements capacity. Auto-tuned if omitted. */
|
|
45
|
+
hnswMaxElements?: number;
|
|
46
|
+
/** PQ rescore oversampling factor. Default: 4. */
|
|
47
|
+
pqRescoreOversampling?: number;
|
|
48
|
+
}
|
|
49
|
+
/** Request to create a graph collection with optional schema. */
|
|
50
|
+
interface CreateGraphCollectionRequest {
|
|
51
|
+
/** Collection name (unique identifier). */
|
|
52
|
+
name: string;
|
|
53
|
+
/** Optional vector dimension for node embeddings. */
|
|
54
|
+
dimension?: number;
|
|
55
|
+
/** Distance metric (when dimension is set). Default: 'cosine'. */
|
|
56
|
+
metric?: DistanceMetric;
|
|
57
|
+
/** Graph schema definition. Pass { schemaless: true } for schemaless mode. */
|
|
58
|
+
graphSchema?: Record<string, unknown>;
|
|
34
59
|
}
|
|
35
60
|
/** Request to create a metadata-only collection. */
|
|
36
61
|
interface CreateMetadataCollectionRequest {
|
|
@@ -61,6 +86,8 @@ interface CollectionInfo {
|
|
|
61
86
|
metric: string;
|
|
62
87
|
/** Number of vectors in the collection. */
|
|
63
88
|
count: number;
|
|
89
|
+
/** Storage mode (full, sq8, binary, pq, rabitq, graph, metadata_only). */
|
|
90
|
+
storageMode: string;
|
|
64
91
|
}
|
|
65
92
|
/** A point (vector with metadata) to insert. */
|
|
66
93
|
interface PointInput {
|
|
@@ -86,6 +113,10 @@ interface SearchRequest {
|
|
|
86
113
|
vector: number[];
|
|
87
114
|
/** Number of results to return. Default: 10. */
|
|
88
115
|
topK?: number;
|
|
116
|
+
/** Optional metadata filter. */
|
|
117
|
+
filter?: Record<string, unknown>;
|
|
118
|
+
/** Search quality: 'fast', 'balanced', 'accurate', 'perfect', 'auto', or 'custom:<ef>'. */
|
|
119
|
+
quality?: string;
|
|
89
120
|
}
|
|
90
121
|
/** Request for BM25 text search. */
|
|
91
122
|
interface TextSearchRequest {
|
|
@@ -95,6 +126,8 @@ interface TextSearchRequest {
|
|
|
95
126
|
query: string;
|
|
96
127
|
/** Number of results to return. Default: 10. */
|
|
97
128
|
topK?: number;
|
|
129
|
+
/** Optional metadata filter. */
|
|
130
|
+
filter?: Record<string, unknown>;
|
|
98
131
|
}
|
|
99
132
|
/** Request for hybrid (vector + text) search. */
|
|
100
133
|
interface HybridSearchRequest {
|
|
@@ -108,6 +141,8 @@ interface HybridSearchRequest {
|
|
|
108
141
|
topK?: number;
|
|
109
142
|
/** Weight for vector results (0.0-1.0). Default: 0.5. */
|
|
110
143
|
vectorWeight?: number;
|
|
144
|
+
/** Optional metadata filter. */
|
|
145
|
+
filter?: Record<string, unknown>;
|
|
111
146
|
}
|
|
112
147
|
/** Request for VelesQL query. */
|
|
113
148
|
interface QueryRequest {
|
|
@@ -138,6 +173,8 @@ interface IndividualSearchRequest {
|
|
|
138
173
|
topK?: number;
|
|
139
174
|
/** Optional metadata filter. */
|
|
140
175
|
filter?: Record<string, unknown>;
|
|
176
|
+
/** Search quality: 'fast', 'balanced', 'accurate', 'perfect', 'auto', or 'custom:<ef>'. */
|
|
177
|
+
quality?: string;
|
|
141
178
|
}
|
|
142
179
|
/** Request for batch search. */
|
|
143
180
|
interface BatchSearchRequest {
|
|
@@ -147,7 +184,7 @@ interface BatchSearchRequest {
|
|
|
147
184
|
searches: IndividualSearchRequest[];
|
|
148
185
|
}
|
|
149
186
|
/** Fusion strategy for multi-query search. */
|
|
150
|
-
type FusionStrategy = 'rrf' | 'average' | 'maximum' | 'weighted';
|
|
187
|
+
type FusionStrategy = 'rrf' | 'average' | 'maximum' | 'weighted' | 'relative_score';
|
|
151
188
|
/** Fusion parameters for multi-query search. */
|
|
152
189
|
interface FusionParams {
|
|
153
190
|
/** RRF k parameter (default: 60). */
|
|
@@ -158,6 +195,10 @@ interface FusionParams {
|
|
|
158
195
|
maxWeight?: number;
|
|
159
196
|
/** Weighted fusion: hit weight (default: 0.1). */
|
|
160
197
|
hitWeight?: number;
|
|
198
|
+
/** Relative score fusion: dense branch weight (default: 0.5). */
|
|
199
|
+
denseWeight?: number;
|
|
200
|
+
/** Relative score fusion: sparse branch weight (default: 0.5). */
|
|
201
|
+
sparseWeight?: number;
|
|
161
202
|
}
|
|
162
203
|
/** Request for multi-query fusion search. */
|
|
163
204
|
interface MultiQuerySearchRequest {
|
|
@@ -167,7 +208,7 @@ interface MultiQuerySearchRequest {
|
|
|
167
208
|
vectors: number[][];
|
|
168
209
|
/** Number of results to return. Default: 10. */
|
|
169
210
|
topK?: number;
|
|
170
|
-
/** Fusion strategy: 'rrf', 'average', 'maximum', 'weighted'. Default: 'rrf'. */
|
|
211
|
+
/** Fusion strategy: 'rrf', 'average', 'maximum', 'weighted', 'relative_score'. Default: 'rrf'. */
|
|
171
212
|
fusion?: FusionStrategy;
|
|
172
213
|
/** Fusion parameters. */
|
|
173
214
|
fusionParams?: FusionParams;
|
|
@@ -199,6 +240,28 @@ interface SearchResponse {
|
|
|
199
240
|
/** Query execution time in milliseconds. */
|
|
200
241
|
timingMs: number;
|
|
201
242
|
}
|
|
243
|
+
/** Hybrid result from VelesQL queries (vector + graph + column data). */
|
|
244
|
+
interface HybridResult {
|
|
245
|
+
/** Node/point ID. */
|
|
246
|
+
nodeId: number;
|
|
247
|
+
/** Vector similarity score (if applicable). */
|
|
248
|
+
vectorScore?: number;
|
|
249
|
+
/** Graph traversal score (if applicable). */
|
|
250
|
+
graphScore?: number;
|
|
251
|
+
/** Fused score combining vector and graph components. */
|
|
252
|
+
fusedScore: number;
|
|
253
|
+
/** Payload/bindings from the query. */
|
|
254
|
+
bindings?: Record<string, unknown>;
|
|
255
|
+
/** Column data from aggregation queries. */
|
|
256
|
+
columnData?: Record<string, unknown>;
|
|
257
|
+
}
|
|
258
|
+
/** Response from VelesQL query operations. */
|
|
259
|
+
interface QueryResponse {
|
|
260
|
+
/** Query results. */
|
|
261
|
+
results: HybridResult[];
|
|
262
|
+
/** Query execution time in milliseconds. */
|
|
263
|
+
timingMs: number;
|
|
264
|
+
}
|
|
202
265
|
/** Error returned by plugin commands. */
|
|
203
266
|
interface CommandError {
|
|
204
267
|
/** Human-readable error message. */
|
|
@@ -378,21 +441,28 @@ declare function textSearch(request: TextSearchRequest): Promise<SearchResponse>
|
|
|
378
441
|
*/
|
|
379
442
|
declare function hybridSearch(request: HybridSearchRequest): Promise<SearchResponse>;
|
|
380
443
|
/**
|
|
381
|
-
* Executes a VelesQL query.
|
|
444
|
+
* Executes a VelesQL query (SELECT, MATCH, DDL, DML).
|
|
382
445
|
*
|
|
383
446
|
* @param request - Query request with VelesQL string
|
|
384
|
-
* @returns
|
|
447
|
+
* @returns Query response with hybrid results and timing
|
|
385
448
|
* @throws {CommandError} If query syntax is invalid or collection doesn't exist
|
|
386
449
|
*
|
|
387
450
|
* @example
|
|
388
451
|
* ```typescript
|
|
452
|
+
* // SELECT query
|
|
389
453
|
* const response = await query({
|
|
390
|
-
* query: "SELECT * FROM documents WHERE
|
|
454
|
+
* query: "SELECT * FROM documents WHERE vector NEAR $v LIMIT 10",
|
|
455
|
+
* params: { v: queryEmbedding }
|
|
456
|
+
* });
|
|
457
|
+
*
|
|
458
|
+
* // MATCH (graph) query
|
|
459
|
+
* const response = await query({
|
|
460
|
+
* query: "MATCH (d:Doc)-[:AUTHORED_BY]->(a:Person) RETURN a.name",
|
|
391
461
|
* params: {}
|
|
392
462
|
* });
|
|
393
463
|
* ```
|
|
394
464
|
*/
|
|
395
|
-
declare function query(request: QueryRequest): Promise<
|
|
465
|
+
declare function query(request: QueryRequest): Promise<QueryResponse>;
|
|
396
466
|
/**
|
|
397
467
|
* Retrieves points by their IDs.
|
|
398
468
|
*
|
|
@@ -528,10 +598,13 @@ interface GetEdgesRequest {
|
|
|
528
598
|
interface TraverseGraphRequest {
|
|
529
599
|
collection: string;
|
|
530
600
|
source: number;
|
|
531
|
-
|
|
601
|
+
/** Maximum traversal depth. Default: 3. */
|
|
602
|
+
maxDepth?: number;
|
|
532
603
|
relTypes?: string[];
|
|
533
|
-
|
|
534
|
-
|
|
604
|
+
/** Maximum results to return. Default: 100. */
|
|
605
|
+
limit?: number;
|
|
606
|
+
/** Traversal algorithm. Default: 'bfs'. */
|
|
607
|
+
algorithm?: 'bfs' | 'dfs';
|
|
535
608
|
}
|
|
536
609
|
/** Request to get the degree of a node. */
|
|
537
610
|
interface GetNodeDegreeRequest {
|
|
@@ -615,5 +688,190 @@ declare function traverseGraph(request: TraverseGraphRequest): Promise<Traversal
|
|
|
615
688
|
* ```
|
|
616
689
|
*/
|
|
617
690
|
declare function getNodeDegree(request: GetNodeDegreeRequest): Promise<NodeDegreeOutput>;
|
|
691
|
+
/**
|
|
692
|
+
* Creates a graph collection with optional schema.
|
|
693
|
+
*
|
|
694
|
+
* @param request - Graph collection configuration
|
|
695
|
+
* @returns Collection info
|
|
696
|
+
* @throws {CommandError} If collection already exists or parameters are invalid
|
|
697
|
+
*
|
|
698
|
+
* @example
|
|
699
|
+
* ```typescript
|
|
700
|
+
* // Schemaless graph (default)
|
|
701
|
+
* const info = await createGraphCollection({ name: 'knowledge' });
|
|
702
|
+
*
|
|
703
|
+
* // Graph with embeddings
|
|
704
|
+
* const info = await createGraphCollection({
|
|
705
|
+
* name: 'knowledge', dimension: 768, metric: 'cosine',
|
|
706
|
+
* graphSchema: { schemaless: true }
|
|
707
|
+
* });
|
|
708
|
+
* ```
|
|
709
|
+
*/
|
|
710
|
+
declare function createGraphCollection(request: CreateGraphCollectionRequest): Promise<CollectionInfo>;
|
|
711
|
+
/** Request to scroll through collection points. */
|
|
712
|
+
interface ScrollRequest {
|
|
713
|
+
/** Target collection name. */
|
|
714
|
+
collection: string;
|
|
715
|
+
/** Cursor from a previous scroll (omit for the first batch). */
|
|
716
|
+
cursor?: number;
|
|
717
|
+
/** Number of points per batch. Default: 100. */
|
|
718
|
+
batchSize?: number;
|
|
719
|
+
/** Optional metadata filter. */
|
|
720
|
+
filter?: Record<string, unknown>;
|
|
721
|
+
}
|
|
722
|
+
/** Response from a scroll operation. */
|
|
723
|
+
interface ScrollResponse {
|
|
724
|
+
/** Points in this batch. */
|
|
725
|
+
points: PointOutput[];
|
|
726
|
+
/** Cursor for the next batch (absent when no more points). */
|
|
727
|
+
nextCursor?: number;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Scrolls through collection points with cursor-based pagination.
|
|
731
|
+
*
|
|
732
|
+
* @param request - Scroll parameters
|
|
733
|
+
* @returns Batch of points and optional next cursor
|
|
734
|
+
* @throws {CommandError} If collection doesn't exist
|
|
735
|
+
*
|
|
736
|
+
* @example
|
|
737
|
+
* ```typescript
|
|
738
|
+
* let cursor: number | undefined;
|
|
739
|
+
* do {
|
|
740
|
+
* const batch = await scrollCollection({ collection: 'docs', cursor, batchSize: 50 });
|
|
741
|
+
* batch.points.forEach(p => console.log(p.id));
|
|
742
|
+
* cursor = batch.nextCursor;
|
|
743
|
+
* } while (cursor !== undefined);
|
|
744
|
+
* ```
|
|
745
|
+
*/
|
|
746
|
+
declare function scrollCollection(request: ScrollRequest): Promise<ScrollResponse>;
|
|
747
|
+
/** Request to store knowledge in semantic memory. */
|
|
748
|
+
interface SemanticStoreRequest {
|
|
749
|
+
/** Unique ID for this knowledge fact. */
|
|
750
|
+
id: number;
|
|
751
|
+
/** Text content of the knowledge. */
|
|
752
|
+
content: string;
|
|
753
|
+
/** Embedding vector for the content. */
|
|
754
|
+
embedding: number[];
|
|
755
|
+
}
|
|
756
|
+
/** Request to query semantic memory. */
|
|
757
|
+
interface SemanticQueryRequest {
|
|
758
|
+
/** Query embedding vector. */
|
|
759
|
+
embedding: number[];
|
|
760
|
+
/** Number of results to return. Default: 10. */
|
|
761
|
+
topK?: number;
|
|
762
|
+
}
|
|
763
|
+
/** Result from semantic memory query. */
|
|
764
|
+
interface SemanticQueryResult {
|
|
765
|
+
/** Knowledge fact ID. */
|
|
766
|
+
id: number;
|
|
767
|
+
/** Similarity score. */
|
|
768
|
+
score: number;
|
|
769
|
+
/** Knowledge content text. */
|
|
770
|
+
content: string;
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Stores a knowledge fact in semantic memory.
|
|
774
|
+
*
|
|
775
|
+
* @param request - Semantic store request
|
|
776
|
+
* @throws {CommandError} On storage failure
|
|
777
|
+
*/
|
|
778
|
+
declare function semanticStore(request: SemanticStoreRequest): Promise<void>;
|
|
779
|
+
/**
|
|
780
|
+
* Queries semantic memory by similarity search.
|
|
781
|
+
*
|
|
782
|
+
* @param request - Semantic query request
|
|
783
|
+
* @returns Array of matching knowledge facts
|
|
784
|
+
*/
|
|
785
|
+
declare function semanticQuery(request: SemanticQueryRequest): Promise<SemanticQueryResult[]>;
|
|
786
|
+
/** Request to record an episode. */
|
|
787
|
+
interface EpisodicRecordRequest {
|
|
788
|
+
/** Episode event ID. */
|
|
789
|
+
eventId: number;
|
|
790
|
+
/** Episode description/content. */
|
|
791
|
+
content: string;
|
|
792
|
+
/** Timestamp (epoch seconds). */
|
|
793
|
+
timestamp: number;
|
|
794
|
+
/** Embedding vector for the episode. */
|
|
795
|
+
embedding: number[];
|
|
796
|
+
}
|
|
797
|
+
/** Request to query recent episodes. */
|
|
798
|
+
interface EpisodicRecentRequest {
|
|
799
|
+
/** Number of recent episodes to return. Default: 10. */
|
|
800
|
+
limit?: number;
|
|
801
|
+
/** Only return episodes since this timestamp (epoch seconds). */
|
|
802
|
+
sinceTimestamp?: number;
|
|
803
|
+
}
|
|
804
|
+
/** Result from episodic memory query. */
|
|
805
|
+
interface EpisodicResult {
|
|
806
|
+
/** Episode ID. */
|
|
807
|
+
id: number;
|
|
808
|
+
/** Episode content. */
|
|
809
|
+
content: string;
|
|
810
|
+
/** Timestamp (epoch seconds). */
|
|
811
|
+
timestamp: number;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Records an episode in episodic memory.
|
|
815
|
+
*
|
|
816
|
+
* @param request - Episode to record
|
|
817
|
+
* @throws {CommandError} On storage failure
|
|
818
|
+
*/
|
|
819
|
+
declare function episodicRecord(request: EpisodicRecordRequest): Promise<void>;
|
|
820
|
+
/**
|
|
821
|
+
* Queries recent episodes from episodic memory.
|
|
822
|
+
*
|
|
823
|
+
* @param request - Query parameters (limit, since_timestamp)
|
|
824
|
+
* @returns Array of recent episodes
|
|
825
|
+
*/
|
|
826
|
+
declare function episodicRecent(request: EpisodicRecentRequest): Promise<EpisodicResult[]>;
|
|
827
|
+
/** Request to learn a procedure. */
|
|
828
|
+
interface ProceduralLearnRequest {
|
|
829
|
+
/** Procedure ID. */
|
|
830
|
+
procedureId: number;
|
|
831
|
+
/** Procedure name. */
|
|
832
|
+
name: string;
|
|
833
|
+
/** Steps to perform. */
|
|
834
|
+
steps: string[];
|
|
835
|
+
/** Embedding vector for the procedure. */
|
|
836
|
+
embedding: number[];
|
|
837
|
+
/** Confidence level (0.0-1.0). Default: 1.0. */
|
|
838
|
+
confidence?: number;
|
|
839
|
+
}
|
|
840
|
+
/** Request to recall procedures by similarity. */
|
|
841
|
+
interface ProceduralRecallRequest {
|
|
842
|
+
/** Query embedding vector. */
|
|
843
|
+
embedding: number[];
|
|
844
|
+
/** Number of results. Default: 10. */
|
|
845
|
+
topK?: number;
|
|
846
|
+
/** Minimum confidence threshold. Default: 0.0. */
|
|
847
|
+
minConfidence?: number;
|
|
848
|
+
}
|
|
849
|
+
/** Result from procedural memory recall. */
|
|
850
|
+
interface ProceduralMatchResult {
|
|
851
|
+
/** Procedure ID. */
|
|
852
|
+
id: number;
|
|
853
|
+
/** Procedure name. */
|
|
854
|
+
name: string;
|
|
855
|
+
/** Steps. */
|
|
856
|
+
steps: string[];
|
|
857
|
+
/** Confidence score. */
|
|
858
|
+
confidence: number;
|
|
859
|
+
/** Similarity score from vector search. */
|
|
860
|
+
score: number;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Learns a procedure in procedural memory.
|
|
864
|
+
*
|
|
865
|
+
* @param request - Procedure to learn
|
|
866
|
+
* @throws {CommandError} On storage failure
|
|
867
|
+
*/
|
|
868
|
+
declare function proceduralLearn(request: ProceduralLearnRequest): Promise<void>;
|
|
869
|
+
/**
|
|
870
|
+
* Recalls procedures by similarity from procedural memory.
|
|
871
|
+
*
|
|
872
|
+
* @param request - Recall parameters
|
|
873
|
+
* @returns Array of matching procedures
|
|
874
|
+
*/
|
|
875
|
+
declare function proceduralRecall(request: ProceduralRecallRequest): Promise<ProceduralMatchResult[]>;
|
|
618
876
|
|
|
619
|
-
export { type AddEdgeRequest, type BatchSearchRequest, type CollectionInfo, type CommandError, type CreateCollectionRequest, type CreateMetadataCollectionRequest, type DeletePointsRequest, type DistanceMetric, type EdgeOutput, type FusionParams, type FusionStrategy, type GetEdgesRequest, type GetNodeDegreeRequest, type GetPointsRequest, type HybridSearchRequest, type IndividualSearchRequest, type MetadataPointInput, type MultiQuerySearchRequest, type NodeDegreeOutput, type PointInput, type PointOutput, type QueryRequest, type SearchRequest, type SearchResponse, type SearchResult, type TextSearchRequest, type TraversalOutput, type TraverseGraphRequest, type UpsertMetadataRequest, type UpsertRequest, addEdge, batchSearch, createCollection, createMetadataCollection, deleteCollection, deletePoints, flush, getCollection, getEdges, getNodeDegree, getPoints, hybridSearch, isEmpty, listCollections, multiQuerySearch, query, search, textSearch, traverseGraph, upsert, upsertMetadata };
|
|
877
|
+
export { type AddEdgeRequest, type BatchSearchRequest, type CollectionInfo, type CommandError, type CreateCollectionRequest, type CreateGraphCollectionRequest, type CreateMetadataCollectionRequest, type DeletePointsRequest, type DistanceMetric, type EdgeOutput, type EpisodicRecentRequest, type EpisodicRecordRequest, type EpisodicResult, type FusionParams, type FusionStrategy, type GetEdgesRequest, type GetNodeDegreeRequest, type GetPointsRequest, type HybridResult, type HybridSearchRequest, type IndividualSearchRequest, type MetadataPointInput, type MultiQuerySearchRequest, type NodeDegreeOutput, type PointInput, type PointOutput, type ProceduralLearnRequest, type ProceduralMatchResult, type ProceduralRecallRequest, type QueryRequest, type QueryResponse, type ScrollRequest, type ScrollResponse, type SearchRequest, type SearchResponse, type SearchResult, type SemanticQueryRequest, type SemanticQueryResult, type SemanticStoreRequest, type StorageMode, type TextSearchRequest, type TraversalOutput, type TraverseGraphRequest, type UpsertMetadataRequest, type UpsertRequest, addEdge, batchSearch, createCollection, createGraphCollection, createMetadataCollection, deleteCollection, deletePoints, episodicRecent, episodicRecord, flush, getCollection, getEdges, getNodeDegree, getPoints, hybridSearch, isEmpty, listCollections, multiQuerySearch, proceduralLearn, proceduralRecall, query, scrollCollection, search, semanticQuery, semanticStore, textSearch, traverseGraph, upsert, upsertMetadata };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
*/
|
|
24
24
|
/** Distance metric for vector similarity. */
|
|
25
25
|
type DistanceMetric = 'cosine' | 'euclidean' | 'dot' | 'hamming' | 'jaccard';
|
|
26
|
-
/**
|
|
26
|
+
/** Storage mode for vector compression. */
|
|
27
|
+
type StorageMode = 'full' | 'sq8' | 'binary' | 'pq' | 'rabitq';
|
|
28
|
+
/** Request to create a new vector collection. */
|
|
27
29
|
interface CreateCollectionRequest {
|
|
28
30
|
/** Collection name (unique identifier). */
|
|
29
31
|
name: string;
|
|
@@ -31,6 +33,29 @@ interface CreateCollectionRequest {
|
|
|
31
33
|
dimension: number;
|
|
32
34
|
/** Distance metric for similarity calculations. Default: 'cosine'. */
|
|
33
35
|
metric?: DistanceMetric;
|
|
36
|
+
/** Storage mode for vector compression. Default: 'full'. */
|
|
37
|
+
storageMode?: StorageMode;
|
|
38
|
+
/** HNSW M parameter (max connections per node). Auto-tuned if omitted. */
|
|
39
|
+
hnswM?: number;
|
|
40
|
+
/** HNSW ef_construction parameter. Auto-tuned if omitted. */
|
|
41
|
+
hnswEfConstruction?: number;
|
|
42
|
+
/** HNSW alpha for neighbor diversification. Default: 1.2. */
|
|
43
|
+
hnswAlpha?: number;
|
|
44
|
+
/** HNSW initial max elements capacity. Auto-tuned if omitted. */
|
|
45
|
+
hnswMaxElements?: number;
|
|
46
|
+
/** PQ rescore oversampling factor. Default: 4. */
|
|
47
|
+
pqRescoreOversampling?: number;
|
|
48
|
+
}
|
|
49
|
+
/** Request to create a graph collection with optional schema. */
|
|
50
|
+
interface CreateGraphCollectionRequest {
|
|
51
|
+
/** Collection name (unique identifier). */
|
|
52
|
+
name: string;
|
|
53
|
+
/** Optional vector dimension for node embeddings. */
|
|
54
|
+
dimension?: number;
|
|
55
|
+
/** Distance metric (when dimension is set). Default: 'cosine'. */
|
|
56
|
+
metric?: DistanceMetric;
|
|
57
|
+
/** Graph schema definition. Pass { schemaless: true } for schemaless mode. */
|
|
58
|
+
graphSchema?: Record<string, unknown>;
|
|
34
59
|
}
|
|
35
60
|
/** Request to create a metadata-only collection. */
|
|
36
61
|
interface CreateMetadataCollectionRequest {
|
|
@@ -61,6 +86,8 @@ interface CollectionInfo {
|
|
|
61
86
|
metric: string;
|
|
62
87
|
/** Number of vectors in the collection. */
|
|
63
88
|
count: number;
|
|
89
|
+
/** Storage mode (full, sq8, binary, pq, rabitq, graph, metadata_only). */
|
|
90
|
+
storageMode: string;
|
|
64
91
|
}
|
|
65
92
|
/** A point (vector with metadata) to insert. */
|
|
66
93
|
interface PointInput {
|
|
@@ -86,6 +113,10 @@ interface SearchRequest {
|
|
|
86
113
|
vector: number[];
|
|
87
114
|
/** Number of results to return. Default: 10. */
|
|
88
115
|
topK?: number;
|
|
116
|
+
/** Optional metadata filter. */
|
|
117
|
+
filter?: Record<string, unknown>;
|
|
118
|
+
/** Search quality: 'fast', 'balanced', 'accurate', 'perfect', 'auto', or 'custom:<ef>'. */
|
|
119
|
+
quality?: string;
|
|
89
120
|
}
|
|
90
121
|
/** Request for BM25 text search. */
|
|
91
122
|
interface TextSearchRequest {
|
|
@@ -95,6 +126,8 @@ interface TextSearchRequest {
|
|
|
95
126
|
query: string;
|
|
96
127
|
/** Number of results to return. Default: 10. */
|
|
97
128
|
topK?: number;
|
|
129
|
+
/** Optional metadata filter. */
|
|
130
|
+
filter?: Record<string, unknown>;
|
|
98
131
|
}
|
|
99
132
|
/** Request for hybrid (vector + text) search. */
|
|
100
133
|
interface HybridSearchRequest {
|
|
@@ -108,6 +141,8 @@ interface HybridSearchRequest {
|
|
|
108
141
|
topK?: number;
|
|
109
142
|
/** Weight for vector results (0.0-1.0). Default: 0.5. */
|
|
110
143
|
vectorWeight?: number;
|
|
144
|
+
/** Optional metadata filter. */
|
|
145
|
+
filter?: Record<string, unknown>;
|
|
111
146
|
}
|
|
112
147
|
/** Request for VelesQL query. */
|
|
113
148
|
interface QueryRequest {
|
|
@@ -138,6 +173,8 @@ interface IndividualSearchRequest {
|
|
|
138
173
|
topK?: number;
|
|
139
174
|
/** Optional metadata filter. */
|
|
140
175
|
filter?: Record<string, unknown>;
|
|
176
|
+
/** Search quality: 'fast', 'balanced', 'accurate', 'perfect', 'auto', or 'custom:<ef>'. */
|
|
177
|
+
quality?: string;
|
|
141
178
|
}
|
|
142
179
|
/** Request for batch search. */
|
|
143
180
|
interface BatchSearchRequest {
|
|
@@ -147,7 +184,7 @@ interface BatchSearchRequest {
|
|
|
147
184
|
searches: IndividualSearchRequest[];
|
|
148
185
|
}
|
|
149
186
|
/** Fusion strategy for multi-query search. */
|
|
150
|
-
type FusionStrategy = 'rrf' | 'average' | 'maximum' | 'weighted';
|
|
187
|
+
type FusionStrategy = 'rrf' | 'average' | 'maximum' | 'weighted' | 'relative_score';
|
|
151
188
|
/** Fusion parameters for multi-query search. */
|
|
152
189
|
interface FusionParams {
|
|
153
190
|
/** RRF k parameter (default: 60). */
|
|
@@ -158,6 +195,10 @@ interface FusionParams {
|
|
|
158
195
|
maxWeight?: number;
|
|
159
196
|
/** Weighted fusion: hit weight (default: 0.1). */
|
|
160
197
|
hitWeight?: number;
|
|
198
|
+
/** Relative score fusion: dense branch weight (default: 0.5). */
|
|
199
|
+
denseWeight?: number;
|
|
200
|
+
/** Relative score fusion: sparse branch weight (default: 0.5). */
|
|
201
|
+
sparseWeight?: number;
|
|
161
202
|
}
|
|
162
203
|
/** Request for multi-query fusion search. */
|
|
163
204
|
interface MultiQuerySearchRequest {
|
|
@@ -167,7 +208,7 @@ interface MultiQuerySearchRequest {
|
|
|
167
208
|
vectors: number[][];
|
|
168
209
|
/** Number of results to return. Default: 10. */
|
|
169
210
|
topK?: number;
|
|
170
|
-
/** Fusion strategy: 'rrf', 'average', 'maximum', 'weighted'. Default: 'rrf'. */
|
|
211
|
+
/** Fusion strategy: 'rrf', 'average', 'maximum', 'weighted', 'relative_score'. Default: 'rrf'. */
|
|
171
212
|
fusion?: FusionStrategy;
|
|
172
213
|
/** Fusion parameters. */
|
|
173
214
|
fusionParams?: FusionParams;
|
|
@@ -199,6 +240,28 @@ interface SearchResponse {
|
|
|
199
240
|
/** Query execution time in milliseconds. */
|
|
200
241
|
timingMs: number;
|
|
201
242
|
}
|
|
243
|
+
/** Hybrid result from VelesQL queries (vector + graph + column data). */
|
|
244
|
+
interface HybridResult {
|
|
245
|
+
/** Node/point ID. */
|
|
246
|
+
nodeId: number;
|
|
247
|
+
/** Vector similarity score (if applicable). */
|
|
248
|
+
vectorScore?: number;
|
|
249
|
+
/** Graph traversal score (if applicable). */
|
|
250
|
+
graphScore?: number;
|
|
251
|
+
/** Fused score combining vector and graph components. */
|
|
252
|
+
fusedScore: number;
|
|
253
|
+
/** Payload/bindings from the query. */
|
|
254
|
+
bindings?: Record<string, unknown>;
|
|
255
|
+
/** Column data from aggregation queries. */
|
|
256
|
+
columnData?: Record<string, unknown>;
|
|
257
|
+
}
|
|
258
|
+
/** Response from VelesQL query operations. */
|
|
259
|
+
interface QueryResponse {
|
|
260
|
+
/** Query results. */
|
|
261
|
+
results: HybridResult[];
|
|
262
|
+
/** Query execution time in milliseconds. */
|
|
263
|
+
timingMs: number;
|
|
264
|
+
}
|
|
202
265
|
/** Error returned by plugin commands. */
|
|
203
266
|
interface CommandError {
|
|
204
267
|
/** Human-readable error message. */
|
|
@@ -378,21 +441,28 @@ declare function textSearch(request: TextSearchRequest): Promise<SearchResponse>
|
|
|
378
441
|
*/
|
|
379
442
|
declare function hybridSearch(request: HybridSearchRequest): Promise<SearchResponse>;
|
|
380
443
|
/**
|
|
381
|
-
* Executes a VelesQL query.
|
|
444
|
+
* Executes a VelesQL query (SELECT, MATCH, DDL, DML).
|
|
382
445
|
*
|
|
383
446
|
* @param request - Query request with VelesQL string
|
|
384
|
-
* @returns
|
|
447
|
+
* @returns Query response with hybrid results and timing
|
|
385
448
|
* @throws {CommandError} If query syntax is invalid or collection doesn't exist
|
|
386
449
|
*
|
|
387
450
|
* @example
|
|
388
451
|
* ```typescript
|
|
452
|
+
* // SELECT query
|
|
389
453
|
* const response = await query({
|
|
390
|
-
* query: "SELECT * FROM documents WHERE
|
|
454
|
+
* query: "SELECT * FROM documents WHERE vector NEAR $v LIMIT 10",
|
|
455
|
+
* params: { v: queryEmbedding }
|
|
456
|
+
* });
|
|
457
|
+
*
|
|
458
|
+
* // MATCH (graph) query
|
|
459
|
+
* const response = await query({
|
|
460
|
+
* query: "MATCH (d:Doc)-[:AUTHORED_BY]->(a:Person) RETURN a.name",
|
|
391
461
|
* params: {}
|
|
392
462
|
* });
|
|
393
463
|
* ```
|
|
394
464
|
*/
|
|
395
|
-
declare function query(request: QueryRequest): Promise<
|
|
465
|
+
declare function query(request: QueryRequest): Promise<QueryResponse>;
|
|
396
466
|
/**
|
|
397
467
|
* Retrieves points by their IDs.
|
|
398
468
|
*
|
|
@@ -528,10 +598,13 @@ interface GetEdgesRequest {
|
|
|
528
598
|
interface TraverseGraphRequest {
|
|
529
599
|
collection: string;
|
|
530
600
|
source: number;
|
|
531
|
-
|
|
601
|
+
/** Maximum traversal depth. Default: 3. */
|
|
602
|
+
maxDepth?: number;
|
|
532
603
|
relTypes?: string[];
|
|
533
|
-
|
|
534
|
-
|
|
604
|
+
/** Maximum results to return. Default: 100. */
|
|
605
|
+
limit?: number;
|
|
606
|
+
/** Traversal algorithm. Default: 'bfs'. */
|
|
607
|
+
algorithm?: 'bfs' | 'dfs';
|
|
535
608
|
}
|
|
536
609
|
/** Request to get the degree of a node. */
|
|
537
610
|
interface GetNodeDegreeRequest {
|
|
@@ -615,5 +688,190 @@ declare function traverseGraph(request: TraverseGraphRequest): Promise<Traversal
|
|
|
615
688
|
* ```
|
|
616
689
|
*/
|
|
617
690
|
declare function getNodeDegree(request: GetNodeDegreeRequest): Promise<NodeDegreeOutput>;
|
|
691
|
+
/**
|
|
692
|
+
* Creates a graph collection with optional schema.
|
|
693
|
+
*
|
|
694
|
+
* @param request - Graph collection configuration
|
|
695
|
+
* @returns Collection info
|
|
696
|
+
* @throws {CommandError} If collection already exists or parameters are invalid
|
|
697
|
+
*
|
|
698
|
+
* @example
|
|
699
|
+
* ```typescript
|
|
700
|
+
* // Schemaless graph (default)
|
|
701
|
+
* const info = await createGraphCollection({ name: 'knowledge' });
|
|
702
|
+
*
|
|
703
|
+
* // Graph with embeddings
|
|
704
|
+
* const info = await createGraphCollection({
|
|
705
|
+
* name: 'knowledge', dimension: 768, metric: 'cosine',
|
|
706
|
+
* graphSchema: { schemaless: true }
|
|
707
|
+
* });
|
|
708
|
+
* ```
|
|
709
|
+
*/
|
|
710
|
+
declare function createGraphCollection(request: CreateGraphCollectionRequest): Promise<CollectionInfo>;
|
|
711
|
+
/** Request to scroll through collection points. */
|
|
712
|
+
interface ScrollRequest {
|
|
713
|
+
/** Target collection name. */
|
|
714
|
+
collection: string;
|
|
715
|
+
/** Cursor from a previous scroll (omit for the first batch). */
|
|
716
|
+
cursor?: number;
|
|
717
|
+
/** Number of points per batch. Default: 100. */
|
|
718
|
+
batchSize?: number;
|
|
719
|
+
/** Optional metadata filter. */
|
|
720
|
+
filter?: Record<string, unknown>;
|
|
721
|
+
}
|
|
722
|
+
/** Response from a scroll operation. */
|
|
723
|
+
interface ScrollResponse {
|
|
724
|
+
/** Points in this batch. */
|
|
725
|
+
points: PointOutput[];
|
|
726
|
+
/** Cursor for the next batch (absent when no more points). */
|
|
727
|
+
nextCursor?: number;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Scrolls through collection points with cursor-based pagination.
|
|
731
|
+
*
|
|
732
|
+
* @param request - Scroll parameters
|
|
733
|
+
* @returns Batch of points and optional next cursor
|
|
734
|
+
* @throws {CommandError} If collection doesn't exist
|
|
735
|
+
*
|
|
736
|
+
* @example
|
|
737
|
+
* ```typescript
|
|
738
|
+
* let cursor: number | undefined;
|
|
739
|
+
* do {
|
|
740
|
+
* const batch = await scrollCollection({ collection: 'docs', cursor, batchSize: 50 });
|
|
741
|
+
* batch.points.forEach(p => console.log(p.id));
|
|
742
|
+
* cursor = batch.nextCursor;
|
|
743
|
+
* } while (cursor !== undefined);
|
|
744
|
+
* ```
|
|
745
|
+
*/
|
|
746
|
+
declare function scrollCollection(request: ScrollRequest): Promise<ScrollResponse>;
|
|
747
|
+
/** Request to store knowledge in semantic memory. */
|
|
748
|
+
interface SemanticStoreRequest {
|
|
749
|
+
/** Unique ID for this knowledge fact. */
|
|
750
|
+
id: number;
|
|
751
|
+
/** Text content of the knowledge. */
|
|
752
|
+
content: string;
|
|
753
|
+
/** Embedding vector for the content. */
|
|
754
|
+
embedding: number[];
|
|
755
|
+
}
|
|
756
|
+
/** Request to query semantic memory. */
|
|
757
|
+
interface SemanticQueryRequest {
|
|
758
|
+
/** Query embedding vector. */
|
|
759
|
+
embedding: number[];
|
|
760
|
+
/** Number of results to return. Default: 10. */
|
|
761
|
+
topK?: number;
|
|
762
|
+
}
|
|
763
|
+
/** Result from semantic memory query. */
|
|
764
|
+
interface SemanticQueryResult {
|
|
765
|
+
/** Knowledge fact ID. */
|
|
766
|
+
id: number;
|
|
767
|
+
/** Similarity score. */
|
|
768
|
+
score: number;
|
|
769
|
+
/** Knowledge content text. */
|
|
770
|
+
content: string;
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Stores a knowledge fact in semantic memory.
|
|
774
|
+
*
|
|
775
|
+
* @param request - Semantic store request
|
|
776
|
+
* @throws {CommandError} On storage failure
|
|
777
|
+
*/
|
|
778
|
+
declare function semanticStore(request: SemanticStoreRequest): Promise<void>;
|
|
779
|
+
/**
|
|
780
|
+
* Queries semantic memory by similarity search.
|
|
781
|
+
*
|
|
782
|
+
* @param request - Semantic query request
|
|
783
|
+
* @returns Array of matching knowledge facts
|
|
784
|
+
*/
|
|
785
|
+
declare function semanticQuery(request: SemanticQueryRequest): Promise<SemanticQueryResult[]>;
|
|
786
|
+
/** Request to record an episode. */
|
|
787
|
+
interface EpisodicRecordRequest {
|
|
788
|
+
/** Episode event ID. */
|
|
789
|
+
eventId: number;
|
|
790
|
+
/** Episode description/content. */
|
|
791
|
+
content: string;
|
|
792
|
+
/** Timestamp (epoch seconds). */
|
|
793
|
+
timestamp: number;
|
|
794
|
+
/** Embedding vector for the episode. */
|
|
795
|
+
embedding: number[];
|
|
796
|
+
}
|
|
797
|
+
/** Request to query recent episodes. */
|
|
798
|
+
interface EpisodicRecentRequest {
|
|
799
|
+
/** Number of recent episodes to return. Default: 10. */
|
|
800
|
+
limit?: number;
|
|
801
|
+
/** Only return episodes since this timestamp (epoch seconds). */
|
|
802
|
+
sinceTimestamp?: number;
|
|
803
|
+
}
|
|
804
|
+
/** Result from episodic memory query. */
|
|
805
|
+
interface EpisodicResult {
|
|
806
|
+
/** Episode ID. */
|
|
807
|
+
id: number;
|
|
808
|
+
/** Episode content. */
|
|
809
|
+
content: string;
|
|
810
|
+
/** Timestamp (epoch seconds). */
|
|
811
|
+
timestamp: number;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Records an episode in episodic memory.
|
|
815
|
+
*
|
|
816
|
+
* @param request - Episode to record
|
|
817
|
+
* @throws {CommandError} On storage failure
|
|
818
|
+
*/
|
|
819
|
+
declare function episodicRecord(request: EpisodicRecordRequest): Promise<void>;
|
|
820
|
+
/**
|
|
821
|
+
* Queries recent episodes from episodic memory.
|
|
822
|
+
*
|
|
823
|
+
* @param request - Query parameters (limit, since_timestamp)
|
|
824
|
+
* @returns Array of recent episodes
|
|
825
|
+
*/
|
|
826
|
+
declare function episodicRecent(request: EpisodicRecentRequest): Promise<EpisodicResult[]>;
|
|
827
|
+
/** Request to learn a procedure. */
|
|
828
|
+
interface ProceduralLearnRequest {
|
|
829
|
+
/** Procedure ID. */
|
|
830
|
+
procedureId: number;
|
|
831
|
+
/** Procedure name. */
|
|
832
|
+
name: string;
|
|
833
|
+
/** Steps to perform. */
|
|
834
|
+
steps: string[];
|
|
835
|
+
/** Embedding vector for the procedure. */
|
|
836
|
+
embedding: number[];
|
|
837
|
+
/** Confidence level (0.0-1.0). Default: 1.0. */
|
|
838
|
+
confidence?: number;
|
|
839
|
+
}
|
|
840
|
+
/** Request to recall procedures by similarity. */
|
|
841
|
+
interface ProceduralRecallRequest {
|
|
842
|
+
/** Query embedding vector. */
|
|
843
|
+
embedding: number[];
|
|
844
|
+
/** Number of results. Default: 10. */
|
|
845
|
+
topK?: number;
|
|
846
|
+
/** Minimum confidence threshold. Default: 0.0. */
|
|
847
|
+
minConfidence?: number;
|
|
848
|
+
}
|
|
849
|
+
/** Result from procedural memory recall. */
|
|
850
|
+
interface ProceduralMatchResult {
|
|
851
|
+
/** Procedure ID. */
|
|
852
|
+
id: number;
|
|
853
|
+
/** Procedure name. */
|
|
854
|
+
name: string;
|
|
855
|
+
/** Steps. */
|
|
856
|
+
steps: string[];
|
|
857
|
+
/** Confidence score. */
|
|
858
|
+
confidence: number;
|
|
859
|
+
/** Similarity score from vector search. */
|
|
860
|
+
score: number;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Learns a procedure in procedural memory.
|
|
864
|
+
*
|
|
865
|
+
* @param request - Procedure to learn
|
|
866
|
+
* @throws {CommandError} On storage failure
|
|
867
|
+
*/
|
|
868
|
+
declare function proceduralLearn(request: ProceduralLearnRequest): Promise<void>;
|
|
869
|
+
/**
|
|
870
|
+
* Recalls procedures by similarity from procedural memory.
|
|
871
|
+
*
|
|
872
|
+
* @param request - Recall parameters
|
|
873
|
+
* @returns Array of matching procedures
|
|
874
|
+
*/
|
|
875
|
+
declare function proceduralRecall(request: ProceduralRecallRequest): Promise<ProceduralMatchResult[]>;
|
|
618
876
|
|
|
619
|
-
export { type AddEdgeRequest, type BatchSearchRequest, type CollectionInfo, type CommandError, type CreateCollectionRequest, type CreateMetadataCollectionRequest, type DeletePointsRequest, type DistanceMetric, type EdgeOutput, type FusionParams, type FusionStrategy, type GetEdgesRequest, type GetNodeDegreeRequest, type GetPointsRequest, type HybridSearchRequest, type IndividualSearchRequest, type MetadataPointInput, type MultiQuerySearchRequest, type NodeDegreeOutput, type PointInput, type PointOutput, type QueryRequest, type SearchRequest, type SearchResponse, type SearchResult, type TextSearchRequest, type TraversalOutput, type TraverseGraphRequest, type UpsertMetadataRequest, type UpsertRequest, addEdge, batchSearch, createCollection, createMetadataCollection, deleteCollection, deletePoints, flush, getCollection, getEdges, getNodeDegree, getPoints, hybridSearch, isEmpty, listCollections, multiQuerySearch, query, search, textSearch, traverseGraph, upsert, upsertMetadata };
|
|
877
|
+
export { type AddEdgeRequest, type BatchSearchRequest, type CollectionInfo, type CommandError, type CreateCollectionRequest, type CreateGraphCollectionRequest, type CreateMetadataCollectionRequest, type DeletePointsRequest, type DistanceMetric, type EdgeOutput, type EpisodicRecentRequest, type EpisodicRecordRequest, type EpisodicResult, type FusionParams, type FusionStrategy, type GetEdgesRequest, type GetNodeDegreeRequest, type GetPointsRequest, type HybridResult, type HybridSearchRequest, type IndividualSearchRequest, type MetadataPointInput, type MultiQuerySearchRequest, type NodeDegreeOutput, type PointInput, type PointOutput, type ProceduralLearnRequest, type ProceduralMatchResult, type ProceduralRecallRequest, type QueryRequest, type QueryResponse, type ScrollRequest, type ScrollResponse, type SearchRequest, type SearchResponse, type SearchResult, type SemanticQueryRequest, type SemanticQueryResult, type SemanticStoreRequest, type StorageMode, type TextSearchRequest, type TraversalOutput, type TraverseGraphRequest, type UpsertMetadataRequest, type UpsertRequest, addEdge, batchSearch, createCollection, createGraphCollection, createMetadataCollection, deleteCollection, deletePoints, episodicRecent, episodicRecord, flush, getCollection, getEdges, getNodeDegree, getPoints, hybridSearch, isEmpty, listCollections, multiQuerySearch, proceduralLearn, proceduralRecall, query, scrollCollection, search, semanticQuery, semanticStore, textSearch, traverseGraph, upsert, upsertMetadata };
|
package/dist/index.js
CHANGED
|
@@ -23,9 +23,12 @@ __export(index_exports, {
|
|
|
23
23
|
addEdge: () => addEdge,
|
|
24
24
|
batchSearch: () => batchSearch,
|
|
25
25
|
createCollection: () => createCollection,
|
|
26
|
+
createGraphCollection: () => createGraphCollection,
|
|
26
27
|
createMetadataCollection: () => createMetadataCollection,
|
|
27
28
|
deleteCollection: () => deleteCollection,
|
|
28
29
|
deletePoints: () => deletePoints,
|
|
30
|
+
episodicRecent: () => episodicRecent,
|
|
31
|
+
episodicRecord: () => episodicRecord,
|
|
29
32
|
flush: () => flush,
|
|
30
33
|
getCollection: () => getCollection,
|
|
31
34
|
getEdges: () => getEdges,
|
|
@@ -35,8 +38,13 @@ __export(index_exports, {
|
|
|
35
38
|
isEmpty: () => isEmpty,
|
|
36
39
|
listCollections: () => listCollections,
|
|
37
40
|
multiQuerySearch: () => multiQuerySearch,
|
|
41
|
+
proceduralLearn: () => proceduralLearn,
|
|
42
|
+
proceduralRecall: () => proceduralRecall,
|
|
38
43
|
query: () => query,
|
|
44
|
+
scrollCollection: () => scrollCollection,
|
|
39
45
|
search: () => search,
|
|
46
|
+
semanticQuery: () => semanticQuery,
|
|
47
|
+
semanticStore: () => semanticStore,
|
|
40
48
|
textSearch: () => textSearch,
|
|
41
49
|
traverseGraph: () => traverseGraph,
|
|
42
50
|
upsert: () => upsert,
|
|
@@ -107,14 +115,41 @@ async function traverseGraph(request) {
|
|
|
107
115
|
async function getNodeDegree(request) {
|
|
108
116
|
return (0, import_core.invoke)("plugin:velesdb|get_node_degree", { request });
|
|
109
117
|
}
|
|
118
|
+
async function createGraphCollection(request) {
|
|
119
|
+
return (0, import_core.invoke)("plugin:velesdb|create_graph_collection", { request });
|
|
120
|
+
}
|
|
121
|
+
async function scrollCollection(request) {
|
|
122
|
+
return (0, import_core.invoke)("plugin:velesdb|scroll_collection", { request });
|
|
123
|
+
}
|
|
124
|
+
async function semanticStore(request) {
|
|
125
|
+
return (0, import_core.invoke)("plugin:velesdb|semantic_store", { request });
|
|
126
|
+
}
|
|
127
|
+
async function semanticQuery(request) {
|
|
128
|
+
return (0, import_core.invoke)("plugin:velesdb|semantic_query", { request });
|
|
129
|
+
}
|
|
130
|
+
async function episodicRecord(request) {
|
|
131
|
+
return (0, import_core.invoke)("plugin:velesdb|episodic_record", { request });
|
|
132
|
+
}
|
|
133
|
+
async function episodicRecent(request) {
|
|
134
|
+
return (0, import_core.invoke)("plugin:velesdb|episodic_recent", { request });
|
|
135
|
+
}
|
|
136
|
+
async function proceduralLearn(request) {
|
|
137
|
+
return (0, import_core.invoke)("plugin:velesdb|procedural_learn", { request });
|
|
138
|
+
}
|
|
139
|
+
async function proceduralRecall(request) {
|
|
140
|
+
return (0, import_core.invoke)("plugin:velesdb|procedural_recall", { request });
|
|
141
|
+
}
|
|
110
142
|
// Annotate the CommonJS export names for ESM import in node:
|
|
111
143
|
0 && (module.exports = {
|
|
112
144
|
addEdge,
|
|
113
145
|
batchSearch,
|
|
114
146
|
createCollection,
|
|
147
|
+
createGraphCollection,
|
|
115
148
|
createMetadataCollection,
|
|
116
149
|
deleteCollection,
|
|
117
150
|
deletePoints,
|
|
151
|
+
episodicRecent,
|
|
152
|
+
episodicRecord,
|
|
118
153
|
flush,
|
|
119
154
|
getCollection,
|
|
120
155
|
getEdges,
|
|
@@ -124,8 +159,13 @@ async function getNodeDegree(request) {
|
|
|
124
159
|
isEmpty,
|
|
125
160
|
listCollections,
|
|
126
161
|
multiQuerySearch,
|
|
162
|
+
proceduralLearn,
|
|
163
|
+
proceduralRecall,
|
|
127
164
|
query,
|
|
165
|
+
scrollCollection,
|
|
128
166
|
search,
|
|
167
|
+
semanticQuery,
|
|
168
|
+
semanticStore,
|
|
129
169
|
textSearch,
|
|
130
170
|
traverseGraph,
|
|
131
171
|
upsert,
|
package/dist/index.mjs
CHANGED
|
@@ -63,13 +63,40 @@ async function traverseGraph(request) {
|
|
|
63
63
|
async function getNodeDegree(request) {
|
|
64
64
|
return invoke("plugin:velesdb|get_node_degree", { request });
|
|
65
65
|
}
|
|
66
|
+
async function createGraphCollection(request) {
|
|
67
|
+
return invoke("plugin:velesdb|create_graph_collection", { request });
|
|
68
|
+
}
|
|
69
|
+
async function scrollCollection(request) {
|
|
70
|
+
return invoke("plugin:velesdb|scroll_collection", { request });
|
|
71
|
+
}
|
|
72
|
+
async function semanticStore(request) {
|
|
73
|
+
return invoke("plugin:velesdb|semantic_store", { request });
|
|
74
|
+
}
|
|
75
|
+
async function semanticQuery(request) {
|
|
76
|
+
return invoke("plugin:velesdb|semantic_query", { request });
|
|
77
|
+
}
|
|
78
|
+
async function episodicRecord(request) {
|
|
79
|
+
return invoke("plugin:velesdb|episodic_record", { request });
|
|
80
|
+
}
|
|
81
|
+
async function episodicRecent(request) {
|
|
82
|
+
return invoke("plugin:velesdb|episodic_recent", { request });
|
|
83
|
+
}
|
|
84
|
+
async function proceduralLearn(request) {
|
|
85
|
+
return invoke("plugin:velesdb|procedural_learn", { request });
|
|
86
|
+
}
|
|
87
|
+
async function proceduralRecall(request) {
|
|
88
|
+
return invoke("plugin:velesdb|procedural_recall", { request });
|
|
89
|
+
}
|
|
66
90
|
export {
|
|
67
91
|
addEdge,
|
|
68
92
|
batchSearch,
|
|
69
93
|
createCollection,
|
|
94
|
+
createGraphCollection,
|
|
70
95
|
createMetadataCollection,
|
|
71
96
|
deleteCollection,
|
|
72
97
|
deletePoints,
|
|
98
|
+
episodicRecent,
|
|
99
|
+
episodicRecord,
|
|
73
100
|
flush,
|
|
74
101
|
getCollection,
|
|
75
102
|
getEdges,
|
|
@@ -79,8 +106,13 @@ export {
|
|
|
79
106
|
isEmpty,
|
|
80
107
|
listCollections,
|
|
81
108
|
multiQuerySearch,
|
|
109
|
+
proceduralLearn,
|
|
110
|
+
proceduralRecall,
|
|
82
111
|
query,
|
|
112
|
+
scrollCollection,
|
|
83
113
|
search,
|
|
114
|
+
semanticQuery,
|
|
115
|
+
semanticStore,
|
|
84
116
|
textSearch,
|
|
85
117
|
traverseGraph,
|
|
86
118
|
upsert,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wiscale/tauri-plugin-velesdb",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "TypeScript bindings for the VelesDB Tauri plugin - Vector search in desktop apps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
39
|
"url": "https://github.com/cyberlife-coder/VelesDB.git",
|
|
40
|
-
"directory": "
|
|
40
|
+
"directory": "crates/tauri-plugin-velesdb/guest-js"
|
|
41
41
|
},
|
|
42
42
|
"bugs": {
|
|
43
43
|
"url": "https://github.com/cyberlife-coder/VelesDB/issues"
|