@weavelogic/knowledge-graph-agent 0.3.0 → 0.4.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 +290 -3
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/_virtual/index8.js +2 -2
- package/dist/_virtual/index9.js +2 -2
- package/dist/audit/config.d.ts +150 -0
- package/dist/audit/config.d.ts.map +1 -0
- package/dist/audit/config.js +111 -0
- package/dist/audit/config.js.map +1 -0
- package/dist/audit/index.d.ts +38 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/services/audit-chain.d.ts +276 -0
- package/dist/audit/services/audit-chain.d.ts.map +1 -0
- package/dist/audit/services/audit-chain.js +502 -0
- package/dist/audit/services/audit-chain.js.map +1 -0
- package/dist/audit/services/index.d.ts +11 -0
- package/dist/audit/services/index.d.ts.map +1 -0
- package/dist/audit/services/syndication.d.ts +334 -0
- package/dist/audit/services/syndication.d.ts.map +1 -0
- package/dist/audit/services/syndication.js +589 -0
- package/dist/audit/services/syndication.js.map +1 -0
- package/dist/audit/types.d.ts +453 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/cli/commands/audit.d.ts +21 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +621 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/vector.d.ts +14 -0
- package/dist/cli/commands/vector.d.ts.map +1 -0
- package/dist/cli/commands/vector.js +429 -0
- package/dist/cli/commands/vector.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +12 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +471 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +26 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/database/schemas/index.d.ts +85 -0
- package/dist/database/schemas/index.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/audit/checkpoint.d.ts +58 -0
- package/dist/mcp-server/tools/audit/checkpoint.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/checkpoint.js +73 -0
- package/dist/mcp-server/tools/audit/checkpoint.js.map +1 -0
- package/dist/mcp-server/tools/audit/index.d.ts +53 -0
- package/dist/mcp-server/tools/audit/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/index.js +12 -0
- package/dist/mcp-server/tools/audit/index.js.map +1 -0
- package/dist/mcp-server/tools/audit/query.d.ts +58 -0
- package/dist/mcp-server/tools/audit/query.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/query.js +125 -0
- package/dist/mcp-server/tools/audit/query.js.map +1 -0
- package/dist/mcp-server/tools/audit/sync.d.ts +58 -0
- package/dist/mcp-server/tools/audit/sync.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/sync.js +126 -0
- package/dist/mcp-server/tools/audit/sync.js.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +3 -0
- package/dist/mcp-server/tools/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/registry.js +90 -0
- package/dist/mcp-server/tools/registry.js.map +1 -1
- package/dist/mcp-server/tools/vector/index.d.ts +12 -0
- package/dist/mcp-server/tools/vector/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/index.js +12 -0
- package/dist/mcp-server/tools/vector/index.js.map +1 -0
- package/dist/mcp-server/tools/vector/search.d.ts +41 -0
- package/dist/mcp-server/tools/vector/search.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/search.js +224 -0
- package/dist/mcp-server/tools/vector/search.js.map +1 -0
- package/dist/mcp-server/tools/vector/trajectory.d.ts +39 -0
- package/dist/mcp-server/tools/vector/trajectory.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/trajectory.js +170 -0
- package/dist/mcp-server/tools/vector/trajectory.js.map +1 -0
- package/dist/mcp-server/tools/vector/upsert.d.ts +44 -0
- package/dist/mcp-server/tools/vector/upsert.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/upsert.js +175 -0
- package/dist/mcp-server/tools/vector/upsert.js.map +1 -0
- package/dist/mcp-server/tools/workflow/index.d.ts +29 -0
- package/dist/mcp-server/tools/workflow/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/index.js +12 -0
- package/dist/mcp-server/tools/workflow/index.js.map +1 -0
- package/dist/mcp-server/tools/workflow/list.d.ts +41 -0
- package/dist/mcp-server/tools/workflow/list.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/list.js +195 -0
- package/dist/mcp-server/tools/workflow/list.js.map +1 -0
- package/dist/mcp-server/tools/workflow/start.d.ts +40 -0
- package/dist/mcp-server/tools/workflow/start.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/start.js +165 -0
- package/dist/mcp-server/tools/workflow/start.js.map +1 -0
- package/dist/mcp-server/tools/workflow/status.d.ts +38 -0
- package/dist/mcp-server/tools/workflow/status.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/status.js +97 -0
- package/dist/mcp-server/tools/workflow/status.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/index.js +1 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
- package/dist/vector/config.d.ts +300 -0
- package/dist/vector/config.d.ts.map +1 -0
- package/dist/vector/config.js +124 -0
- package/dist/vector/config.js.map +1 -0
- package/dist/vector/index.d.ts +50 -0
- package/dist/vector/index.d.ts.map +1 -0
- package/dist/vector/services/index.d.ts +13 -0
- package/dist/vector/services/index.d.ts.map +1 -0
- package/dist/vector/services/trajectory-tracker.d.ts +405 -0
- package/dist/vector/services/trajectory-tracker.d.ts.map +1 -0
- package/dist/vector/services/trajectory-tracker.js +445 -0
- package/dist/vector/services/trajectory-tracker.js.map +1 -0
- package/dist/vector/services/vector-store.d.ts +339 -0
- package/dist/vector/services/vector-store.d.ts.map +1 -0
- package/dist/vector/services/vector-store.js +748 -0
- package/dist/vector/services/vector-store.js.map +1 -0
- package/dist/vector/types.d.ts +677 -0
- package/dist/vector/types.d.ts.map +1 -0
- package/dist/workflow/adapters/goap-adapter.d.ts +196 -0
- package/dist/workflow/adapters/goap-adapter.d.ts.map +1 -0
- package/dist/workflow/adapters/goap-adapter.js +706 -0
- package/dist/workflow/adapters/goap-adapter.js.map +1 -0
- package/dist/workflow/adapters/index.d.ts +10 -0
- package/dist/workflow/adapters/index.d.ts.map +1 -0
- package/dist/workflow/config.d.ts +135 -0
- package/dist/workflow/config.d.ts.map +1 -0
- package/dist/workflow/config.js +92 -0
- package/dist/workflow/config.js.map +1 -0
- package/dist/workflow/handlers/index.d.ts +9 -0
- package/dist/workflow/handlers/index.d.ts.map +1 -0
- package/dist/workflow/handlers/webhook-handlers.d.ts +397 -0
- package/dist/workflow/handlers/webhook-handlers.d.ts.map +1 -0
- package/dist/workflow/handlers/webhook-handlers.js +454 -0
- package/dist/workflow/handlers/webhook-handlers.js.map +1 -0
- package/dist/workflow/index.d.ts +42 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/services/index.d.ts +9 -0
- package/dist/workflow/services/index.d.ts.map +1 -0
- package/dist/workflow/services/workflow-service.d.ts +318 -0
- package/dist/workflow/services/workflow-service.d.ts.map +1 -0
- package/dist/workflow/services/workflow-service.js +577 -0
- package/dist/workflow/services/workflow-service.js.map +1 -0
- package/dist/workflow/types.d.ts +470 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/workflows/realtime-collab.d.ts +245 -0
- package/dist/workflow/workflows/realtime-collab.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Vector Store
|
|
3
|
+
*
|
|
4
|
+
* Provides vector storage with HNSW indexing and hybrid search
|
|
5
|
+
* combining vector similarity with graph queries.
|
|
6
|
+
*
|
|
7
|
+
* Designed to integrate with RuVector patterns while working
|
|
8
|
+
* with the existing SQLite database as a fallback.
|
|
9
|
+
*
|
|
10
|
+
* @module vector/services/vector-store
|
|
11
|
+
*/
|
|
12
|
+
import type { VectorEntry, SearchResult, HybridSearchQuery, HybridSearchResult, BatchInsertOperation, BatchInsertResult, VectorIndexStats, IVectorStore, VectorStoreEventListener } from '../types.js';
|
|
13
|
+
import type { RuVectorConfig } from '../config.js';
|
|
14
|
+
/**
|
|
15
|
+
* Enhanced Vector Store class
|
|
16
|
+
*
|
|
17
|
+
* Provides:
|
|
18
|
+
* - HNSW-based approximate nearest neighbor search
|
|
19
|
+
* - Hybrid search combining vectors and graph queries
|
|
20
|
+
* - Batch operations for efficient bulk inserts
|
|
21
|
+
* - Integration with existing knowledge graph
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const store = createVectorStore({
|
|
26
|
+
* index: { dimensions: 1536, distanceMetric: 'cosine' }
|
|
27
|
+
* });
|
|
28
|
+
* await store.initialize();
|
|
29
|
+
*
|
|
30
|
+
* await store.insert({
|
|
31
|
+
* id: 'doc-1',
|
|
32
|
+
* vector: embeddings,
|
|
33
|
+
* metadata: { title: 'Document 1' }
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* const results = await store.search({
|
|
37
|
+
* vector: queryEmbedding,
|
|
38
|
+
* k: 10
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare class EnhancedVectorStore implements IVectorStore {
|
|
43
|
+
/** Store configuration */
|
|
44
|
+
private config;
|
|
45
|
+
/** In-memory node storage */
|
|
46
|
+
private nodes;
|
|
47
|
+
/** Entry point node ID for HNSW search */
|
|
48
|
+
private entryPoint;
|
|
49
|
+
/** Maximum level in the current index */
|
|
50
|
+
private maxLevel;
|
|
51
|
+
/** Level generation multiplier (1/ln(M)) */
|
|
52
|
+
private levelMultiplier;
|
|
53
|
+
/** Initialization state */
|
|
54
|
+
private isInitialized;
|
|
55
|
+
/** Event listeners */
|
|
56
|
+
private eventListeners;
|
|
57
|
+
/**
|
|
58
|
+
* Create a new EnhancedVectorStore
|
|
59
|
+
*
|
|
60
|
+
* @param config - Optional configuration overrides
|
|
61
|
+
*/
|
|
62
|
+
constructor(config?: Partial<RuVectorConfig>);
|
|
63
|
+
/**
|
|
64
|
+
* Initialize the vector store
|
|
65
|
+
*
|
|
66
|
+
* Sets up the storage backend and prepares the index for operations.
|
|
67
|
+
* Must be called before any other operations.
|
|
68
|
+
*
|
|
69
|
+
* @throws Error if initialization fails
|
|
70
|
+
*/
|
|
71
|
+
initialize(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Calculate distance between two vectors
|
|
74
|
+
*
|
|
75
|
+
* @param a - First vector
|
|
76
|
+
* @param b - Second vector
|
|
77
|
+
* @returns Distance value (lower = more similar for most metrics)
|
|
78
|
+
* @throws Error if vectors have different dimensions
|
|
79
|
+
*/
|
|
80
|
+
private calculateDistance;
|
|
81
|
+
/**
|
|
82
|
+
* Calculate cosine distance (1 - cosine similarity)
|
|
83
|
+
*
|
|
84
|
+
* @param a - First vector
|
|
85
|
+
* @param b - Second vector
|
|
86
|
+
* @returns Cosine distance (0 = identical, 2 = opposite)
|
|
87
|
+
*/
|
|
88
|
+
private cosineDistance;
|
|
89
|
+
/**
|
|
90
|
+
* Calculate Euclidean (L2) distance
|
|
91
|
+
*
|
|
92
|
+
* @param a - First vector
|
|
93
|
+
* @param b - Second vector
|
|
94
|
+
* @returns Euclidean distance
|
|
95
|
+
*/
|
|
96
|
+
private euclideanDistance;
|
|
97
|
+
/**
|
|
98
|
+
* Calculate negative dot product distance
|
|
99
|
+
*
|
|
100
|
+
* Higher dot product means more similar, so we negate for distance.
|
|
101
|
+
*
|
|
102
|
+
* @param a - First vector
|
|
103
|
+
* @param b - Second vector
|
|
104
|
+
* @returns Negative dot product
|
|
105
|
+
*/
|
|
106
|
+
private dotProductDistance;
|
|
107
|
+
/**
|
|
108
|
+
* Calculate Manhattan (L1) distance
|
|
109
|
+
*
|
|
110
|
+
* @param a - First vector
|
|
111
|
+
* @param b - Second vector
|
|
112
|
+
* @returns Manhattan distance
|
|
113
|
+
*/
|
|
114
|
+
private manhattanDistance;
|
|
115
|
+
/**
|
|
116
|
+
* Generate random level for new node (HNSW algorithm)
|
|
117
|
+
*
|
|
118
|
+
* Uses exponential distribution to generate levels.
|
|
119
|
+
* Most nodes will be at level 0, with exponentially fewer at higher levels.
|
|
120
|
+
*
|
|
121
|
+
* @returns Generated level (0 or higher)
|
|
122
|
+
*/
|
|
123
|
+
private generateLevel;
|
|
124
|
+
/**
|
|
125
|
+
* Insert a vector into the index
|
|
126
|
+
*
|
|
127
|
+
* Implements the HNSW insertion algorithm:
|
|
128
|
+
* 1. Generate random level for the new node
|
|
129
|
+
* 2. If first node, make it the entry point
|
|
130
|
+
* 3. Otherwise, traverse from entry point to find insertion position
|
|
131
|
+
* 4. Connect to nearest neighbors at each level
|
|
132
|
+
*
|
|
133
|
+
* @param entry - Vector entry to insert
|
|
134
|
+
* @throws Error if not initialized or dimensions mismatch
|
|
135
|
+
*/
|
|
136
|
+
insert(entry: {
|
|
137
|
+
id: string;
|
|
138
|
+
vector: number[];
|
|
139
|
+
metadata?: Record<string, unknown>;
|
|
140
|
+
}): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Greedy search to find nearest neighbor at a level
|
|
143
|
+
*
|
|
144
|
+
* Traverses the graph at the specified level, always moving
|
|
145
|
+
* toward the nearest neighbor until no improvement is found.
|
|
146
|
+
*
|
|
147
|
+
* @param query - Query vector
|
|
148
|
+
* @param startId - Starting node ID
|
|
149
|
+
* @param level - Level to search at
|
|
150
|
+
* @returns ID of nearest node found
|
|
151
|
+
*/
|
|
152
|
+
private greedySearch;
|
|
153
|
+
/**
|
|
154
|
+
* Search a layer for nearest neighbors
|
|
155
|
+
*
|
|
156
|
+
* Implements beam search at a specific level using a priority queue.
|
|
157
|
+
*
|
|
158
|
+
* @param query - Query vector
|
|
159
|
+
* @param startId - Starting node ID
|
|
160
|
+
* @param ef - Size of dynamic candidate list
|
|
161
|
+
* @param level - Level to search at
|
|
162
|
+
* @returns Array of nearest neighbors with distances
|
|
163
|
+
*/
|
|
164
|
+
private searchLayer;
|
|
165
|
+
/**
|
|
166
|
+
* Prune neighbors to keep only the best M
|
|
167
|
+
*
|
|
168
|
+
* Uses a simple distance-based pruning strategy.
|
|
169
|
+
*
|
|
170
|
+
* @param nodeVector - Vector of the node being pruned
|
|
171
|
+
* @param neighborIds - Current neighbor IDs
|
|
172
|
+
* @param m - Maximum neighbors to keep
|
|
173
|
+
* @returns Pruned list of neighbor IDs
|
|
174
|
+
*/
|
|
175
|
+
private pruneNeighbors;
|
|
176
|
+
/**
|
|
177
|
+
* Search for similar vectors
|
|
178
|
+
*
|
|
179
|
+
* Implements HNSW search algorithm:
|
|
180
|
+
* 1. Start from entry point at top level
|
|
181
|
+
* 2. Greedy search down to level 1
|
|
182
|
+
* 3. Beam search at level 0 with efSearch candidates
|
|
183
|
+
* 4. Return top-k results
|
|
184
|
+
*
|
|
185
|
+
* @param query - Search query with vector and options
|
|
186
|
+
* @returns Array of search results sorted by similarity
|
|
187
|
+
*/
|
|
188
|
+
search(query: {
|
|
189
|
+
vector: number[];
|
|
190
|
+
k?: number;
|
|
191
|
+
filter?: Record<string, unknown>;
|
|
192
|
+
minScore?: number;
|
|
193
|
+
}): Promise<SearchResult[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Convert distance to similarity score
|
|
196
|
+
*
|
|
197
|
+
* @param distance - Distance value
|
|
198
|
+
* @returns Similarity score between 0 and 1
|
|
199
|
+
*/
|
|
200
|
+
private distanceToScore;
|
|
201
|
+
/**
|
|
202
|
+
* Hybrid search combining vectors and graph queries
|
|
203
|
+
*
|
|
204
|
+
* Performs vector similarity search and optionally enriches
|
|
205
|
+
* results with data from graph queries (Cypher).
|
|
206
|
+
*
|
|
207
|
+
* @param query - Hybrid search query
|
|
208
|
+
* @returns Array of hybrid search results
|
|
209
|
+
*/
|
|
210
|
+
hybridSearch(query: HybridSearchQuery): Promise<HybridSearchResult[]>;
|
|
211
|
+
/**
|
|
212
|
+
* Batch insert vectors
|
|
213
|
+
*
|
|
214
|
+
* Efficiently inserts multiple vectors in a single operation.
|
|
215
|
+
* Supports progress callbacks and duplicate handling.
|
|
216
|
+
*
|
|
217
|
+
* @param operation - Batch insert operation configuration
|
|
218
|
+
* @returns Result with counts of inserted, skipped, and errors
|
|
219
|
+
*/
|
|
220
|
+
batchInsert(operation: BatchInsertOperation): Promise<BatchInsertResult>;
|
|
221
|
+
/**
|
|
222
|
+
* Get a vector by ID
|
|
223
|
+
*
|
|
224
|
+
* @param id - Vector ID to retrieve
|
|
225
|
+
* @returns Vector entry or null if not found
|
|
226
|
+
*/
|
|
227
|
+
get(id: string): Promise<VectorEntry | null>;
|
|
228
|
+
/**
|
|
229
|
+
* Delete a vector by ID
|
|
230
|
+
*
|
|
231
|
+
* Removes the vector from the index and updates neighbor connections.
|
|
232
|
+
*
|
|
233
|
+
* @param id - Vector ID to delete
|
|
234
|
+
* @returns True if deleted, false if not found
|
|
235
|
+
*/
|
|
236
|
+
delete(id: string): Promise<boolean>;
|
|
237
|
+
/**
|
|
238
|
+
* Get index statistics
|
|
239
|
+
*
|
|
240
|
+
* @returns Current statistics about the vector index
|
|
241
|
+
*/
|
|
242
|
+
getStats(): VectorIndexStats;
|
|
243
|
+
/**
|
|
244
|
+
* Estimate memory usage in bytes
|
|
245
|
+
*
|
|
246
|
+
* Provides rough estimate of memory consumption.
|
|
247
|
+
*
|
|
248
|
+
* @returns Estimated memory usage in bytes
|
|
249
|
+
*/
|
|
250
|
+
private estimateMemoryUsage;
|
|
251
|
+
/**
|
|
252
|
+
* Calculate average number of connections per node
|
|
253
|
+
*
|
|
254
|
+
* @returns Average connection count
|
|
255
|
+
*/
|
|
256
|
+
private calculateAverageConnections;
|
|
257
|
+
/**
|
|
258
|
+
* Clear all vectors
|
|
259
|
+
*
|
|
260
|
+
* Removes all vectors from the index and resets state.
|
|
261
|
+
*/
|
|
262
|
+
clear(): Promise<void>;
|
|
263
|
+
/**
|
|
264
|
+
* Get configuration
|
|
265
|
+
*
|
|
266
|
+
* @returns Copy of current configuration
|
|
267
|
+
*/
|
|
268
|
+
getConfig(): RuVectorConfig;
|
|
269
|
+
/**
|
|
270
|
+
* Check if store is initialized
|
|
271
|
+
*
|
|
272
|
+
* @returns True if initialized
|
|
273
|
+
*/
|
|
274
|
+
isReady(): boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Get total vector count
|
|
277
|
+
*
|
|
278
|
+
* @returns Number of vectors in the store
|
|
279
|
+
*/
|
|
280
|
+
size(): number;
|
|
281
|
+
/**
|
|
282
|
+
* Check if a vector exists
|
|
283
|
+
*
|
|
284
|
+
* @param id - Vector ID to check
|
|
285
|
+
* @returns True if exists
|
|
286
|
+
*/
|
|
287
|
+
has(id: string): boolean;
|
|
288
|
+
/**
|
|
289
|
+
* Get all vector IDs
|
|
290
|
+
*
|
|
291
|
+
* @returns Array of all vector IDs
|
|
292
|
+
*/
|
|
293
|
+
getAllIds(): string[];
|
|
294
|
+
/**
|
|
295
|
+
* Add event listener
|
|
296
|
+
*
|
|
297
|
+
* @param event - Event type to listen for
|
|
298
|
+
* @param listener - Callback function
|
|
299
|
+
*/
|
|
300
|
+
on(event: string, listener: VectorStoreEventListener): void;
|
|
301
|
+
/**
|
|
302
|
+
* Remove event listener
|
|
303
|
+
*
|
|
304
|
+
* @param event - Event type
|
|
305
|
+
* @param listener - Callback function to remove
|
|
306
|
+
*/
|
|
307
|
+
off(event: string, listener: VectorStoreEventListener): void;
|
|
308
|
+
/**
|
|
309
|
+
* Emit an event to all registered listeners
|
|
310
|
+
*
|
|
311
|
+
* @param event - Event to emit
|
|
312
|
+
*/
|
|
313
|
+
private emitEvent;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Create an enhanced vector store instance
|
|
317
|
+
*
|
|
318
|
+
* Factory function for creating vector stores with optional configuration.
|
|
319
|
+
*
|
|
320
|
+
* @param config - Optional configuration overrides
|
|
321
|
+
* @returns New EnhancedVectorStore instance
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* ```typescript
|
|
325
|
+
* // Default configuration
|
|
326
|
+
* const store = createVectorStore();
|
|
327
|
+
*
|
|
328
|
+
* // Custom configuration
|
|
329
|
+
* const customStore = createVectorStore({
|
|
330
|
+
* index: {
|
|
331
|
+
* dimensions: 768,
|
|
332
|
+
* distanceMetric: 'euclidean',
|
|
333
|
+
* },
|
|
334
|
+
* cache: { enabled: true, maxSize: 5000 },
|
|
335
|
+
* });
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
338
|
+
export declare function createVectorStore(config?: Partial<RuVectorConfig>): EnhancedVectorStore;
|
|
339
|
+
//# sourceMappingURL=vector-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-store.d.ts","sourceRoot":"","sources":["../../../src/vector/services/vector-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EAEZ,wBAAwB,EACzB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAgCnD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IACtD,0BAA0B;IAC1B,OAAO,CAAC,MAAM,CAAiB;IAE/B,6BAA6B;IAC7B,OAAO,CAAC,KAAK,CAA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