@soulcraft/brainy 2.15.0 → 3.0.1
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/CHANGELOG.md +18 -0
- package/README.md +249 -152
- package/dist/api/ConfigAPI.d.ts +67 -0
- package/dist/api/ConfigAPI.js +166 -0
- package/dist/api/DataAPI.d.ts +123 -0
- package/dist/api/DataAPI.js +391 -0
- package/dist/api/SecurityAPI.d.ts +50 -0
- package/dist/api/SecurityAPI.js +139 -0
- package/dist/api/UniversalImportAPI.d.ts +134 -0
- package/dist/api/UniversalImportAPI.js +615 -0
- package/dist/augmentationManager.js +12 -7
- package/dist/augmentationPipeline.d.ts +0 -61
- package/dist/augmentationPipeline.js +0 -87
- package/dist/augmentationRegistry.d.ts +1 -1
- package/dist/augmentationRegistry.js +1 -1
- package/dist/augmentations/apiServerAugmentation.d.ts +27 -1
- package/dist/augmentations/apiServerAugmentation.js +288 -7
- package/dist/augmentations/auditLogAugmentation.d.ts +109 -0
- package/dist/augmentations/auditLogAugmentation.js +358 -0
- package/dist/augmentations/batchProcessingAugmentation.d.ts +3 -2
- package/dist/augmentations/batchProcessingAugmentation.js +123 -22
- package/dist/augmentations/brainyAugmentation.d.ts +87 -8
- package/dist/augmentations/brainyAugmentation.js +159 -2
- package/dist/augmentations/cacheAugmentation.d.ts +6 -5
- package/dist/augmentations/cacheAugmentation.js +113 -17
- package/dist/augmentations/conduitAugmentations.d.ts +2 -2
- package/dist/augmentations/conduitAugmentations.js +2 -2
- package/dist/augmentations/configResolver.d.ts +122 -0
- package/dist/augmentations/configResolver.js +440 -0
- package/dist/augmentations/connectionPoolAugmentation.d.ts +3 -1
- package/dist/augmentations/connectionPoolAugmentation.js +37 -12
- package/dist/augmentations/defaultAugmentations.d.ts +9 -11
- package/dist/augmentations/defaultAugmentations.js +4 -11
- package/dist/augmentations/discovery/catalogDiscovery.d.ts +142 -0
- package/dist/augmentations/discovery/catalogDiscovery.js +249 -0
- package/dist/augmentations/discovery/localDiscovery.d.ts +84 -0
- package/dist/augmentations/discovery/localDiscovery.js +246 -0
- package/dist/augmentations/discovery/runtimeLoader.d.ts +97 -0
- package/dist/augmentations/discovery/runtimeLoader.js +337 -0
- package/dist/augmentations/discovery.d.ts +152 -0
- package/dist/augmentations/discovery.js +441 -0
- package/dist/augmentations/display/intelligentComputation.d.ts +1 -1
- package/dist/augmentations/display/intelligentComputation.js +4 -4
- package/dist/augmentations/entityRegistryAugmentation.d.ts +3 -1
- package/dist/augmentations/entityRegistryAugmentation.js +5 -1
- package/dist/augmentations/indexAugmentation.d.ts +3 -3
- package/dist/augmentations/indexAugmentation.js +2 -2
- package/dist/augmentations/intelligentVerbScoringAugmentation.d.ts +22 -6
- package/dist/augmentations/intelligentVerbScoringAugmentation.js +106 -23
- package/dist/augmentations/manifest.d.ts +176 -0
- package/dist/augmentations/manifest.js +8 -0
- package/dist/augmentations/marketplace/AugmentationMarketplace.d.ts +168 -0
- package/dist/augmentations/marketplace/AugmentationMarketplace.js +329 -0
- package/dist/augmentations/marketplace/cli.d.ts +47 -0
- package/dist/augmentations/marketplace/cli.js +265 -0
- package/dist/augmentations/metricsAugmentation.d.ts +3 -3
- package/dist/augmentations/metricsAugmentation.js +2 -2
- package/dist/augmentations/monitoringAugmentation.d.ts +3 -3
- package/dist/augmentations/monitoringAugmentation.js +2 -2
- package/dist/augmentations/neuralImport.d.ts +1 -1
- package/dist/augmentations/rateLimitAugmentation.d.ts +82 -0
- package/dist/augmentations/rateLimitAugmentation.js +321 -0
- package/dist/augmentations/requestDeduplicatorAugmentation.d.ts +2 -2
- package/dist/augmentations/requestDeduplicatorAugmentation.js +1 -1
- package/dist/augmentations/storageAugmentation.d.ts +1 -1
- package/dist/augmentations/storageAugmentation.js +2 -2
- package/dist/augmentations/storageAugmentations.d.ts +37 -8
- package/dist/augmentations/storageAugmentations.js +204 -15
- package/dist/augmentations/synapseAugmentation.d.ts +1 -1
- package/dist/augmentations/synapseAugmentation.js +35 -16
- package/dist/augmentations/typeMatching/intelligentTypeMatcher.d.ts +39 -59
- package/dist/augmentations/typeMatching/intelligentTypeMatcher.js +103 -389
- package/dist/augmentations/universalDisplayAugmentation.d.ts +2 -2
- package/dist/augmentations/universalDisplayAugmentation.js +2 -2
- package/dist/brainy-unified.d.ts +106 -0
- package/dist/brainy-unified.js +327 -0
- package/dist/brainy.d.ts +273 -0
- package/dist/brainy.js +1181 -0
- package/dist/brainyData.d.ts +29 -72
- package/dist/brainyData.js +350 -304
- package/dist/brainyDataV3.d.ts +186 -0
- package/dist/brainyDataV3.js +337 -0
- package/dist/browserFramework.d.ts +6 -6
- package/dist/browserFramework.js +11 -8
- package/dist/browserFramework.minimal.d.ts +5 -5
- package/dist/browserFramework.minimal.js +11 -8
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +3 -3
- package/dist/config/modelAutoConfig.d.ts +6 -7
- package/dist/config/modelAutoConfig.js +17 -76
- package/dist/cortex/backupRestore.d.ts +2 -2
- package/dist/cortex/backupRestore.js +85 -27
- package/dist/cortex/healthCheck.d.ts +2 -2
- package/dist/cortex/neuralImport.d.ts +2 -2
- package/dist/cortex/neuralImport.js +18 -13
- package/dist/cortex/performanceMonitor.d.ts +2 -2
- package/dist/critical/model-guardian.d.ts +4 -0
- package/dist/critical/model-guardian.js +31 -11
- package/dist/demo.d.ts +4 -4
- package/dist/demo.js +7 -7
- package/dist/distributed/cacheSync.d.ts +112 -0
- package/dist/distributed/cacheSync.js +265 -0
- package/dist/distributed/coordinator.d.ts +193 -0
- package/dist/distributed/coordinator.js +548 -0
- package/dist/distributed/httpTransport.d.ts +120 -0
- package/dist/distributed/httpTransport.js +446 -0
- package/dist/distributed/index.d.ts +8 -0
- package/dist/distributed/index.js +5 -0
- package/dist/distributed/networkTransport.d.ts +132 -0
- package/dist/distributed/networkTransport.js +633 -0
- package/dist/distributed/queryPlanner.d.ts +104 -0
- package/dist/distributed/queryPlanner.js +327 -0
- package/dist/distributed/readWriteSeparation.d.ts +134 -0
- package/dist/distributed/readWriteSeparation.js +350 -0
- package/dist/distributed/shardManager.d.ts +114 -0
- package/dist/distributed/shardManager.js +357 -0
- package/dist/distributed/shardMigration.d.ts +110 -0
- package/dist/distributed/shardMigration.js +289 -0
- package/dist/distributed/storageDiscovery.d.ts +160 -0
- package/dist/distributed/storageDiscovery.js +551 -0
- package/dist/embeddings/EmbeddingManager.d.ts +0 -4
- package/dist/embeddings/EmbeddingManager.js +21 -26
- package/dist/errors/brainyError.d.ts +5 -1
- package/dist/errors/brainyError.js +12 -0
- package/dist/examples/basicUsage.js +3 -3
- package/dist/graph/graphAdjacencyIndex.d.ts +96 -0
- package/dist/graph/graphAdjacencyIndex.js +288 -0
- package/dist/graph/pathfinding.js +4 -2
- package/dist/hnsw/scaledHNSWSystem.js +11 -2
- package/dist/importManager.js +6 -3
- package/dist/index.d.ts +12 -21
- package/dist/index.js +14 -22
- package/dist/mcp/brainyMCPAdapter.d.ts +4 -4
- package/dist/mcp/brainyMCPAdapter.js +5 -5
- package/dist/mcp/brainyMCPService.d.ts +3 -3
- package/dist/mcp/brainyMCPService.js +3 -11
- package/dist/mcp/mcpAugmentationToolset.js +20 -30
- package/dist/neural/embeddedPatterns.d.ts +1 -1
- package/dist/neural/embeddedPatterns.js +2 -2
- package/dist/neural/entityExtractor.d.ts +65 -0
- package/dist/neural/entityExtractor.js +316 -0
- package/dist/neural/improvedNeuralAPI.js +90 -79
- package/dist/neural/naturalLanguageProcessor.d.ts +155 -10
- package/dist/neural/naturalLanguageProcessor.js +941 -66
- package/dist/neural/naturalLanguageProcessorStatic.d.ts +2 -2
- package/dist/neural/naturalLanguageProcessorStatic.js +3 -3
- package/dist/neural/neuralAPI.js +8 -2
- package/dist/neural/patternLibrary.d.ts +57 -3
- package/dist/neural/patternLibrary.js +348 -13
- package/dist/neural/staticPatternMatcher.d.ts +2 -2
- package/dist/neural/staticPatternMatcher.js +2 -2
- package/dist/shared/default-augmentations.d.ts +3 -3
- package/dist/shared/default-augmentations.js +5 -5
- package/dist/storage/adapters/fileSystemStorage.d.ts +4 -0
- package/dist/storage/adapters/fileSystemStorage.js +54 -1
- package/dist/storage/adapters/memoryStorage.js +13 -8
- package/dist/storage/backwardCompatibility.d.ts +10 -78
- package/dist/storage/backwardCompatibility.js +17 -132
- package/dist/storage/baseStorage.d.ts +6 -0
- package/dist/storage/baseStorage.js +17 -0
- package/dist/storage/cacheManager.js +2 -2
- package/dist/storage/readOnlyOptimizations.js +8 -3
- package/dist/streaming/pipeline.d.ts +154 -0
- package/dist/streaming/pipeline.js +551 -0
- package/dist/triple/TripleIntelligence.d.ts +25 -110
- package/dist/triple/TripleIntelligence.js +4 -574
- package/dist/triple/TripleIntelligenceSystem.d.ts +159 -0
- package/dist/triple/TripleIntelligenceSystem.js +519 -0
- package/dist/types/apiTypes.d.ts +278 -0
- package/dist/types/apiTypes.js +33 -0
- package/dist/types/brainy.types.d.ts +308 -0
- package/dist/types/brainy.types.js +8 -0
- package/dist/types/brainyDataInterface.d.ts +3 -3
- package/dist/types/brainyDataInterface.js +2 -2
- package/dist/types/graphTypes.js +2 -2
- package/dist/utils/cacheAutoConfig.d.ts +3 -3
- package/dist/utils/embedding.js +8 -14
- package/dist/utils/enhancedLogger.d.ts +104 -0
- package/dist/utils/enhancedLogger.js +232 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/intelligentTypeMapper.d.ts +60 -0
- package/dist/utils/intelligentTypeMapper.js +349 -0
- package/dist/utils/metadataIndex.d.ts +118 -1
- package/dist/utils/metadataIndex.js +539 -16
- package/dist/utils/paramValidation.d.ts +39 -0
- package/dist/utils/paramValidation.js +192 -0
- package/dist/utils/rateLimiter.d.ts +160 -0
- package/dist/utils/rateLimiter.js +271 -0
- package/dist/utils/statistics.d.ts +4 -4
- package/dist/utils/statistics.js +3 -3
- package/dist/utils/structuredLogger.d.ts +146 -0
- package/dist/utils/structuredLogger.js +394 -0
- package/dist/utils/textEncoding.js +2 -1
- package/dist/utils/typeValidation.d.ts +34 -0
- package/dist/utils/typeValidation.js +247 -0
- package/package.json +14 -6
- package/scripts/download-models.cjs +6 -15
- package/dist/augmentations/walAugmentation.d.ts +0 -111
- package/dist/augmentations/walAugmentation.js +0 -519
- package/dist/chat/BrainyChat.d.ts +0 -121
- package/dist/chat/BrainyChat.js +0 -396
- package/dist/chat/ChatCLI.d.ts +0 -61
- package/dist/chat/ChatCLI.js +0 -351
package/dist/brainyData.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { DistanceFunction, GraphVerb, EmbeddingFunction, HNSWConfig, SearchResul
|
|
|
8
8
|
import { MetadataIndexConfig } from './utils/metadataIndex.js';
|
|
9
9
|
import { CleanupConfig } from './utils/periodicCleanup.js';
|
|
10
10
|
import { NounType, VerbType } from './types/graphTypes.js';
|
|
11
|
-
import { WebSocketConnection } from './types/augmentations.js';
|
|
12
11
|
import { BrainyDataInterface } from './types/brainyDataInterface.js';
|
|
13
12
|
import { DistributedConfig } from './types/distributedTypes.js';
|
|
14
13
|
import { SearchCacheConfig } from './utils/searchCache.js';
|
|
@@ -451,6 +450,15 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
451
450
|
private partitioner;
|
|
452
451
|
private operationalMode;
|
|
453
452
|
private domainDetector;
|
|
453
|
+
private networkTransport;
|
|
454
|
+
private coordinator;
|
|
455
|
+
private shardManager;
|
|
456
|
+
private cacheSync;
|
|
457
|
+
private readWriteSeparation;
|
|
458
|
+
private httpTransport;
|
|
459
|
+
private storageDiscovery;
|
|
460
|
+
private queryPlanner;
|
|
461
|
+
private shardMigrationManager;
|
|
454
462
|
private get cache();
|
|
455
463
|
private get index();
|
|
456
464
|
private get metadataIndex();
|
|
@@ -613,26 +621,31 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
613
621
|
*/
|
|
614
622
|
private handleDistributedConfigUpdate;
|
|
615
623
|
/**
|
|
616
|
-
*
|
|
617
|
-
*
|
|
624
|
+
* Initialize NEW distributed components for Brainy 3.0
|
|
625
|
+
* This enables true multi-node operation with consensus and sharding
|
|
618
626
|
*/
|
|
619
|
-
|
|
627
|
+
private initializeDistributedComponents;
|
|
620
628
|
/**
|
|
621
|
-
*
|
|
622
|
-
* @param serverUrl WebSocket URL of the remote Brainy server
|
|
623
|
-
* @param protocols Optional WebSocket protocols to use
|
|
624
|
-
* @returns The connection object
|
|
629
|
+
* Execute a query on local shards
|
|
625
630
|
*/
|
|
626
|
-
|
|
631
|
+
private executeLocalQuery;
|
|
627
632
|
/**
|
|
628
|
-
*
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
*
|
|
633
|
-
|
|
633
|
+
* Set up distributed operation handlers
|
|
634
|
+
*/
|
|
635
|
+
private setupDistributedOperations;
|
|
636
|
+
/**
|
|
637
|
+
* Local add operation (without distribution)
|
|
638
|
+
*/
|
|
639
|
+
private localAdd;
|
|
640
|
+
/**
|
|
641
|
+
* Local find operation (potentially for a specific shard)
|
|
634
642
|
*/
|
|
635
|
-
private
|
|
643
|
+
private localFind;
|
|
644
|
+
/**
|
|
645
|
+
* Get distributed health status
|
|
646
|
+
* @returns Health status if distributed mode is enabled
|
|
647
|
+
*/
|
|
648
|
+
getHealthStatus(): any;
|
|
636
649
|
/**
|
|
637
650
|
* Add multiple vectors or data items to the database
|
|
638
651
|
* @param items Array of items to add
|
|
@@ -655,20 +668,6 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
655
668
|
concurrency?: number;
|
|
656
669
|
batchSize?: number;
|
|
657
670
|
}): Promise<string[]>;
|
|
658
|
-
/**
|
|
659
|
-
* Add multiple vectors or data items to both local and remote databases
|
|
660
|
-
* @param items Array of items to add (with required types)
|
|
661
|
-
* @param options Additional options
|
|
662
|
-
* @returns Array of IDs for the added items
|
|
663
|
-
*/
|
|
664
|
-
addBatchToBoth(items: Array<{
|
|
665
|
-
vectorOrData: Vector | any;
|
|
666
|
-
nounType: NounType | string;
|
|
667
|
-
metadata?: T;
|
|
668
|
-
}>, options?: {
|
|
669
|
-
forceEmbed?: boolean;
|
|
670
|
-
concurrency?: number;
|
|
671
|
-
}): Promise<string[]>;
|
|
672
671
|
/**
|
|
673
672
|
* Filter search results by service
|
|
674
673
|
* @param results Search results to filter
|
|
@@ -1272,48 +1271,6 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
1272
1271
|
searchMode?: 'local' | 'remote' | 'combined';
|
|
1273
1272
|
metadata?: any;
|
|
1274
1273
|
}): Promise<SearchResult<T>[]>;
|
|
1275
|
-
/**
|
|
1276
|
-
* Search a remote Brainy server for similar vectors
|
|
1277
|
-
* @param queryVectorOrData Query vector or data to search for
|
|
1278
|
-
* @param k Number of results to return
|
|
1279
|
-
* @param options Additional options
|
|
1280
|
-
* @returns Array of search results
|
|
1281
|
-
*/
|
|
1282
|
-
searchRemote(queryVectorOrData: Vector | any, k?: number, options?: {
|
|
1283
|
-
forceEmbed?: boolean;
|
|
1284
|
-
nounTypes?: string[];
|
|
1285
|
-
includeVerbs?: boolean;
|
|
1286
|
-
storeResults?: boolean;
|
|
1287
|
-
service?: string;
|
|
1288
|
-
searchField?: string;
|
|
1289
|
-
offset?: number;
|
|
1290
|
-
}): Promise<SearchResult<T>[]>;
|
|
1291
|
-
/**
|
|
1292
|
-
* Search both local and remote Brainy instances, combining the results
|
|
1293
|
-
* @param queryVectorOrData Query vector or data to search for
|
|
1294
|
-
* @param k Number of results to return
|
|
1295
|
-
* @param options Additional options
|
|
1296
|
-
* @returns Array of search results
|
|
1297
|
-
*/
|
|
1298
|
-
searchCombined(queryVectorOrData: Vector | any, k?: number, options?: {
|
|
1299
|
-
forceEmbed?: boolean;
|
|
1300
|
-
nounTypes?: string[];
|
|
1301
|
-
includeVerbs?: boolean;
|
|
1302
|
-
localFirst?: boolean;
|
|
1303
|
-
service?: string;
|
|
1304
|
-
searchField?: string;
|
|
1305
|
-
offset?: number;
|
|
1306
|
-
}): Promise<SearchResult<T>[]>;
|
|
1307
|
-
/**
|
|
1308
|
-
* Check if the instance is connected to a remote server
|
|
1309
|
-
* @returns True if connected to a remote server, false otherwise
|
|
1310
|
-
*/
|
|
1311
|
-
isConnectedToRemoteServer(): boolean;
|
|
1312
|
-
/**
|
|
1313
|
-
* Disconnect from the remote server
|
|
1314
|
-
* @returns True if successfully disconnected, false if not connected
|
|
1315
|
-
*/
|
|
1316
|
-
disconnectFromRemoteServer(): Promise<boolean>;
|
|
1317
1274
|
/**
|
|
1318
1275
|
* Ensure the database is initialized
|
|
1319
1276
|
*/
|