@soulcraft/brainy 0.62.3 → 1.0.0-rc.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/README.md +3 -3
- package/bin/brainy.js +903 -1153
- package/dist/augmentationPipeline.d.ts +60 -0
- package/dist/augmentationPipeline.js +94 -0
- package/dist/augmentations/{cortexSense.d.ts → neuralImport.d.ts} +14 -11
- package/dist/augmentations/{cortexSense.js → neuralImport.js} +14 -11
- package/dist/brainyData.d.ts +199 -18
- package/dist/brainyData.js +601 -18
- package/dist/chat/BrainyChat.d.ts +113 -0
- package/dist/chat/BrainyChat.js +368 -0
- package/dist/chat/ChatCLI.d.ts +61 -0
- package/dist/chat/ChatCLI.js +351 -0
- package/dist/connectors/interfaces/IConnector.d.ts +3 -3
- package/dist/connectors/interfaces/IConnector.js +1 -1
- package/dist/cortex/neuralImport.js +1 -3
- package/dist/index.d.ts +4 -6
- package/dist/index.js +6 -7
- package/dist/pipeline.d.ts +15 -271
- package/dist/pipeline.js +25 -586
- package/dist/shared/default-augmentations.d.ts +3 -3
- package/dist/shared/default-augmentations.js +10 -10
- package/package.json +3 -1
- package/dist/chat/brainyChat.d.ts +0 -42
- package/dist/chat/brainyChat.js +0 -340
- package/dist/cortex/cliWrapper.d.ts +0 -32
- package/dist/cortex/cliWrapper.js +0 -209
- package/dist/cortex/cortex-legacy.d.ts +0 -264
- package/dist/cortex/cortex-legacy.js +0 -2463
- package/dist/cortex/cortex.d.ts +0 -264
- package/dist/cortex/cortex.js +0 -2463
- package/dist/cortex/serviceIntegration.d.ts +0 -156
- package/dist/cortex/serviceIntegration.js +0 -384
- package/dist/sequentialPipeline.d.ts +0 -113
- package/dist/sequentialPipeline.js +0 -417
- package/dist/utils/modelLoader.d.ts +0 -12
- package/dist/utils/modelLoader.js +0 -88
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
* @deprecated AugmentationPipeline - Use Cortex instead
|
|
11
11
|
*/
|
|
12
12
|
import { BrainyAugmentations, IAugmentation, IWebSocketSupport, AugmentationResponse, AugmentationType } from './types/augmentations.js';
|
|
13
|
+
/**
|
|
14
|
+
* Type definitions for the augmentation registry
|
|
15
|
+
*/
|
|
16
|
+
type AugmentationRegistry = {
|
|
17
|
+
sense: BrainyAugmentations.ISenseAugmentation[];
|
|
18
|
+
conduit: BrainyAugmentations.IConduitAugmentation[];
|
|
19
|
+
cognition: BrainyAugmentations.ICognitionAugmentation[];
|
|
20
|
+
memory: BrainyAugmentations.IMemoryAugmentation[];
|
|
21
|
+
perception: BrainyAugmentations.IPerceptionAugmentation[];
|
|
22
|
+
dialog: BrainyAugmentations.IDialogAugmentation[];
|
|
23
|
+
activation: BrainyAugmentations.IActivationAugmentation[];
|
|
24
|
+
webSocket: IWebSocketSupport[];
|
|
25
|
+
};
|
|
13
26
|
/**
|
|
14
27
|
* Execution mode for the pipeline
|
|
15
28
|
*/
|
|
@@ -205,7 +218,54 @@ export declare class Cortex {
|
|
|
205
218
|
* @returns A promise that resolves with the results from all augmentations
|
|
206
219
|
*/
|
|
207
220
|
private executeTypedPipeline;
|
|
221
|
+
/**
|
|
222
|
+
* Enable an augmentation by name
|
|
223
|
+
*
|
|
224
|
+
* @param name The name of the augmentation to enable
|
|
225
|
+
* @returns True if augmentation was found and enabled
|
|
226
|
+
*/
|
|
227
|
+
enableAugmentation(name: string): boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Disable an augmentation by name
|
|
230
|
+
*
|
|
231
|
+
* @param name The name of the augmentation to disable
|
|
232
|
+
* @returns True if augmentation was found and disabled
|
|
233
|
+
*/
|
|
234
|
+
disableAugmentation(name: string): boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Check if an augmentation is enabled
|
|
237
|
+
*
|
|
238
|
+
* @param name The name of the augmentation to check
|
|
239
|
+
* @returns True if augmentation is found and enabled, false otherwise
|
|
240
|
+
*/
|
|
241
|
+
isAugmentationEnabled(name: string): boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Get all augmentations with their enabled status
|
|
244
|
+
*
|
|
245
|
+
* @returns Array of augmentations with name, type, and enabled status
|
|
246
|
+
*/
|
|
247
|
+
listAugmentationsWithStatus(): Array<{
|
|
248
|
+
name: string;
|
|
249
|
+
type: keyof AugmentationRegistry;
|
|
250
|
+
enabled: boolean;
|
|
251
|
+
description: string;
|
|
252
|
+
}>;
|
|
253
|
+
/**
|
|
254
|
+
* Enable all augmentations of a specific type
|
|
255
|
+
*
|
|
256
|
+
* @param type The type of augmentations to enable
|
|
257
|
+
* @returns Number of augmentations enabled
|
|
258
|
+
*/
|
|
259
|
+
enableAugmentationType(type: keyof AugmentationRegistry): number;
|
|
260
|
+
/**
|
|
261
|
+
* Disable all augmentations of a specific type
|
|
262
|
+
*
|
|
263
|
+
* @param type The type of augmentations to disable
|
|
264
|
+
* @returns Number of augmentations disabled
|
|
265
|
+
*/
|
|
266
|
+
disableAugmentationType(type: keyof AugmentationRegistry): number;
|
|
208
267
|
}
|
|
209
268
|
export declare const cortex: Cortex;
|
|
210
269
|
export declare const AugmentationPipeline: typeof Cortex;
|
|
211
270
|
export declare const augmentationPipeline: Cortex;
|
|
271
|
+
export {};
|
|
@@ -471,6 +471,100 @@ export class Cortex {
|
|
|
471
471
|
return results;
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
+
/**
|
|
475
|
+
* Enable an augmentation by name
|
|
476
|
+
*
|
|
477
|
+
* @param name The name of the augmentation to enable
|
|
478
|
+
* @returns True if augmentation was found and enabled
|
|
479
|
+
*/
|
|
480
|
+
enableAugmentation(name) {
|
|
481
|
+
for (const type of Object.keys(this.registry)) {
|
|
482
|
+
const augmentation = this.registry[type].find(aug => aug.name === name);
|
|
483
|
+
if (augmentation) {
|
|
484
|
+
augmentation.enabled = true;
|
|
485
|
+
return true;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Disable an augmentation by name
|
|
492
|
+
*
|
|
493
|
+
* @param name The name of the augmentation to disable
|
|
494
|
+
* @returns True if augmentation was found and disabled
|
|
495
|
+
*/
|
|
496
|
+
disableAugmentation(name) {
|
|
497
|
+
for (const type of Object.keys(this.registry)) {
|
|
498
|
+
const augmentation = this.registry[type].find(aug => aug.name === name);
|
|
499
|
+
if (augmentation) {
|
|
500
|
+
augmentation.enabled = false;
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
return false;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Check if an augmentation is enabled
|
|
508
|
+
*
|
|
509
|
+
* @param name The name of the augmentation to check
|
|
510
|
+
* @returns True if augmentation is found and enabled, false otherwise
|
|
511
|
+
*/
|
|
512
|
+
isAugmentationEnabled(name) {
|
|
513
|
+
for (const type of Object.keys(this.registry)) {
|
|
514
|
+
const augmentation = this.registry[type].find(aug => aug.name === name);
|
|
515
|
+
if (augmentation) {
|
|
516
|
+
return augmentation.enabled;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return false;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Get all augmentations with their enabled status
|
|
523
|
+
*
|
|
524
|
+
* @returns Array of augmentations with name, type, and enabled status
|
|
525
|
+
*/
|
|
526
|
+
listAugmentationsWithStatus() {
|
|
527
|
+
const result = [];
|
|
528
|
+
for (const [type, augmentations] of Object.entries(this.registry)) {
|
|
529
|
+
for (const aug of augmentations) {
|
|
530
|
+
result.push({
|
|
531
|
+
name: aug.name,
|
|
532
|
+
type: type,
|
|
533
|
+
enabled: aug.enabled,
|
|
534
|
+
description: aug.description
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return result;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Enable all augmentations of a specific type
|
|
542
|
+
*
|
|
543
|
+
* @param type The type of augmentations to enable
|
|
544
|
+
* @returns Number of augmentations enabled
|
|
545
|
+
*/
|
|
546
|
+
enableAugmentationType(type) {
|
|
547
|
+
let count = 0;
|
|
548
|
+
for (const aug of this.registry[type]) {
|
|
549
|
+
aug.enabled = true;
|
|
550
|
+
count++;
|
|
551
|
+
}
|
|
552
|
+
return count;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Disable all augmentations of a specific type
|
|
556
|
+
*
|
|
557
|
+
* @param type The type of augmentations to disable
|
|
558
|
+
* @returns Number of augmentations disabled
|
|
559
|
+
*/
|
|
560
|
+
disableAugmentationType(type) {
|
|
561
|
+
let count = 0;
|
|
562
|
+
for (const aug of this.registry[type]) {
|
|
563
|
+
aug.enabled = false;
|
|
564
|
+
count++;
|
|
565
|
+
}
|
|
566
|
+
return count;
|
|
567
|
+
}
|
|
474
568
|
}
|
|
475
569
|
// Create and export a default instance of the cortex
|
|
476
570
|
export const cortex = new Cortex();
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Neural Import Augmentation - AI-Powered Data Understanding
|
|
3
3
|
*
|
|
4
|
-
* 🧠
|
|
5
|
-
* ⚛️
|
|
4
|
+
* 🧠 Built-in AI augmentation for intelligent data processing
|
|
5
|
+
* ⚛️ Always free, always included, always enabled
|
|
6
|
+
*
|
|
7
|
+
* This is the default AI-powered augmentation that comes with every Brainy installation.
|
|
8
|
+
* It provides intelligent data understanding, entity detection, and relationship analysis.
|
|
6
9
|
*/
|
|
7
10
|
import { ISenseAugmentation, AugmentationResponse } from '../types/augmentations.js';
|
|
8
11
|
import { BrainyData } from '../brainyData.js';
|
|
9
|
-
export interface
|
|
12
|
+
export interface NeuralAnalysisResult {
|
|
10
13
|
detectedEntities: DetectedEntity[];
|
|
11
14
|
detectedRelationships: DetectedRelationship[];
|
|
12
15
|
confidence: number;
|
|
13
|
-
insights:
|
|
16
|
+
insights: NeuralInsight[];
|
|
14
17
|
}
|
|
15
18
|
export interface DetectedEntity {
|
|
16
19
|
originalData: any;
|
|
@@ -33,14 +36,14 @@ export interface DetectedRelationship {
|
|
|
33
36
|
context: string;
|
|
34
37
|
metadata?: Record<string, any>;
|
|
35
38
|
}
|
|
36
|
-
export interface
|
|
39
|
+
export interface NeuralInsight {
|
|
37
40
|
type: 'hierarchy' | 'cluster' | 'pattern' | 'anomaly' | 'opportunity';
|
|
38
41
|
description: string;
|
|
39
42
|
confidence: number;
|
|
40
43
|
affectedEntities: string[];
|
|
41
44
|
recommendation?: string;
|
|
42
45
|
}
|
|
43
|
-
export interface
|
|
46
|
+
export interface NeuralImportConfig {
|
|
44
47
|
confidenceThreshold: number;
|
|
45
48
|
enableWeights: boolean;
|
|
46
49
|
skipDuplicates: boolean;
|
|
@@ -49,13 +52,13 @@ export interface CortexSenseConfig {
|
|
|
49
52
|
/**
|
|
50
53
|
* Neural Import SENSE Augmentation - The Brain's Perceptual System
|
|
51
54
|
*/
|
|
52
|
-
export declare class
|
|
55
|
+
export declare class NeuralImportAugmentation implements ISenseAugmentation {
|
|
53
56
|
readonly name: string;
|
|
54
57
|
readonly description: string;
|
|
55
58
|
enabled: boolean;
|
|
56
59
|
private brainy;
|
|
57
60
|
private config;
|
|
58
|
-
constructor(brainy: BrainyData, config?: Partial<
|
|
61
|
+
constructor(brainy: BrainyData, config?: Partial<NeuralImportConfig>);
|
|
59
62
|
initialize(): Promise<void>;
|
|
60
63
|
shutDown(): Promise<void>;
|
|
61
64
|
getStatus(): Promise<'active' | 'inactive' | 'error'>;
|
|
@@ -117,7 +120,7 @@ export declare class CortexSenseAugmentation implements ISenseAugmentation {
|
|
|
117
120
|
/**
|
|
118
121
|
* Get the full neural analysis result (custom method for Cortex integration)
|
|
119
122
|
*/
|
|
120
|
-
getNeuralAnalysis(rawData: Buffer | string, dataType: string): Promise<
|
|
123
|
+
getNeuralAnalysis(rawData: Buffer | string, dataType: string): Promise<NeuralAnalysisResult>;
|
|
121
124
|
/**
|
|
122
125
|
* Parse raw data based on type
|
|
123
126
|
*/
|
|
@@ -165,7 +168,7 @@ export declare class CortexSenseAugmentation implements ISenseAugmentation {
|
|
|
165
168
|
/**
|
|
166
169
|
* Generate Neural Insights - The Intelligence Layer
|
|
167
170
|
*/
|
|
168
|
-
private
|
|
171
|
+
private generateNeuralInsights;
|
|
169
172
|
/**
|
|
170
173
|
* Helper methods for the neural system
|
|
171
174
|
*/
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Neural Import Augmentation - AI-Powered Data Understanding
|
|
3
3
|
*
|
|
4
|
-
* 🧠
|
|
5
|
-
* ⚛️
|
|
4
|
+
* 🧠 Built-in AI augmentation for intelligent data processing
|
|
5
|
+
* ⚛️ Always free, always included, always enabled
|
|
6
|
+
*
|
|
7
|
+
* This is the default AI-powered augmentation that comes with every Brainy installation.
|
|
8
|
+
* It provides intelligent data understanding, entity detection, and relationship analysis.
|
|
6
9
|
*/
|
|
7
10
|
import { NounType, VerbType } from '../types/graphTypes.js';
|
|
8
11
|
import * as fs from '../universal/fs.js';
|
|
@@ -10,10 +13,10 @@ import * as path from '../universal/path.js';
|
|
|
10
13
|
/**
|
|
11
14
|
* Neural Import SENSE Augmentation - The Brain's Perceptual System
|
|
12
15
|
*/
|
|
13
|
-
export class
|
|
16
|
+
export class NeuralImportAugmentation {
|
|
14
17
|
constructor(brainy, config = {}) {
|
|
15
|
-
this.name = '
|
|
16
|
-
this.description = 'AI-powered
|
|
18
|
+
this.name = 'neural-import';
|
|
19
|
+
this.description = 'Built-in AI-powered data understanding and entity detection';
|
|
17
20
|
this.enabled = true;
|
|
18
21
|
this.brainy = brainy;
|
|
19
22
|
this.config = {
|
|
@@ -25,7 +28,7 @@ export class CortexSenseAugmentation {
|
|
|
25
28
|
}
|
|
26
29
|
async initialize() {
|
|
27
30
|
// Initialize the cortex analysis system
|
|
28
|
-
console.log('🧠
|
|
31
|
+
console.log('🧠 Neural Import augmentation initialized');
|
|
29
32
|
}
|
|
30
33
|
async shutDown() {
|
|
31
34
|
console.log('🧠 Neural Import SENSE augmentation shut down');
|
|
@@ -307,7 +310,7 @@ export class CortexSenseAugmentation {
|
|
|
307
310
|
// Phase 2: Neural Relationship Detection
|
|
308
311
|
const detectedRelationships = await this.detectRelationshipsWithNeuralAnalysis(detectedEntities, parsedData, config);
|
|
309
312
|
// Phase 3: Neural Insights Generation
|
|
310
|
-
const insights = await this.
|
|
313
|
+
const insights = await this.generateNeuralInsights(detectedEntities, detectedRelationships);
|
|
311
314
|
// Phase 4: Confidence Scoring
|
|
312
315
|
const overallConfidence = this.calculateOverallConfidence(detectedEntities, detectedRelationships);
|
|
313
316
|
return {
|
|
@@ -516,7 +519,7 @@ export class CortexSenseAugmentation {
|
|
|
516
519
|
/**
|
|
517
520
|
* Generate Neural Insights - The Intelligence Layer
|
|
518
521
|
*/
|
|
519
|
-
async
|
|
522
|
+
async generateNeuralInsights(entities, relationships) {
|
|
520
523
|
const insights = [];
|
|
521
524
|
// Detect hierarchies
|
|
522
525
|
const hierarchies = this.detectHierarchies(relationships);
|
|
@@ -646,7 +649,7 @@ export class CortexSenseAugmentation {
|
|
|
646
649
|
return (entityConfidence + relationshipConfidence) / 2;
|
|
647
650
|
}
|
|
648
651
|
async storeNeuralAnalysis(analysis) {
|
|
649
|
-
// Store the full analysis result for later retrieval by
|
|
652
|
+
// Store the full analysis result for later retrieval by Neural Import or other systems
|
|
650
653
|
// This could be stored in the brainy instance metadata or a separate analysis store
|
|
651
654
|
}
|
|
652
655
|
getDataTypeFromPath(filePath) {
|
|
@@ -744,4 +747,4 @@ export class CortexSenseAugmentation {
|
|
|
744
747
|
return recommendations;
|
|
745
748
|
}
|
|
746
749
|
}
|
|
747
|
-
//# sourceMappingURL=
|
|
750
|
+
//# sourceMappingURL=neuralImport.js.map
|
package/dist/brainyData.d.ts
CHANGED
|
@@ -532,18 +532,31 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
532
532
|
*/
|
|
533
533
|
connectToRemoteServer(serverUrl: string, protocols?: string | string[]): Promise<WebSocketConnection>;
|
|
534
534
|
/**
|
|
535
|
-
* Add
|
|
536
|
-
*
|
|
535
|
+
* Add data to the database with intelligent processing
|
|
536
|
+
*
|
|
537
537
|
* @param vectorOrData Vector or data to add
|
|
538
|
-
* @param metadata Optional metadata to associate with the
|
|
539
|
-
* @param options Additional options
|
|
540
|
-
* @returns The ID of the added
|
|
538
|
+
* @param metadata Optional metadata to associate with the data
|
|
539
|
+
* @param options Additional options for processing
|
|
540
|
+
* @returns The ID of the added data
|
|
541
|
+
*
|
|
542
|
+
* @example
|
|
543
|
+
* // Auto mode - intelligently decides processing
|
|
544
|
+
* await brainy.add("Customer feedback: Great product!")
|
|
545
|
+
*
|
|
546
|
+
* @example
|
|
547
|
+
* // Explicit literal mode for sensitive data
|
|
548
|
+
* await brainy.add("API_KEY=secret123", null, { process: 'literal' })
|
|
549
|
+
*
|
|
550
|
+
* @example
|
|
551
|
+
* // Force neural processing
|
|
552
|
+
* await brainy.add("John works at Acme Corp", null, { process: 'neural' })
|
|
541
553
|
*/
|
|
542
554
|
add(vectorOrData: Vector | any, metadata?: T, options?: {
|
|
543
555
|
forceEmbed?: boolean;
|
|
544
556
|
addToRemote?: boolean;
|
|
545
557
|
id?: string;
|
|
546
558
|
service?: string;
|
|
559
|
+
process?: 'auto' | 'literal' | 'neural';
|
|
547
560
|
}): Promise<string>;
|
|
548
561
|
/**
|
|
549
562
|
* Add a text item to the database with automatic embedding
|
|
@@ -766,6 +779,9 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
766
779
|
*/
|
|
767
780
|
delete(id: string, options?: {
|
|
768
781
|
service?: string;
|
|
782
|
+
soft?: boolean;
|
|
783
|
+
cascade?: boolean;
|
|
784
|
+
force?: boolean;
|
|
769
785
|
}): Promise<boolean>;
|
|
770
786
|
/**
|
|
771
787
|
* Update metadata for a vector
|
|
@@ -808,17 +824,7 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
808
824
|
*
|
|
809
825
|
* @throws Error if source or target nouns don't exist and autoCreateMissingNouns is false or auto-creation fails
|
|
810
826
|
*/
|
|
811
|
-
|
|
812
|
-
type?: string;
|
|
813
|
-
weight?: number;
|
|
814
|
-
metadata?: any;
|
|
815
|
-
forceEmbed?: boolean;
|
|
816
|
-
id?: string;
|
|
817
|
-
autoCreateMissingNouns?: boolean;
|
|
818
|
-
missingNounMetadata?: any;
|
|
819
|
-
service?: string;
|
|
820
|
-
writeOnlyMode?: boolean;
|
|
821
|
-
}): Promise<string>;
|
|
827
|
+
private _addVerbInternal;
|
|
822
828
|
/**
|
|
823
829
|
* Get a verb by ID
|
|
824
830
|
* This is a direct storage operation that works in write-only mode when allowDirectReads is enabled
|
|
@@ -929,6 +935,11 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
929
935
|
* @private
|
|
930
936
|
*/
|
|
931
937
|
private adaptCacheConfiguration;
|
|
938
|
+
/**
|
|
939
|
+
* @deprecated Use add() instead - it's smart by default now
|
|
940
|
+
* @hidden
|
|
941
|
+
*/
|
|
942
|
+
addSmart(vectorOrData: Vector | any, metadata?: T, options?: any): Promise<string>;
|
|
932
943
|
/**
|
|
933
944
|
* Get the number of nouns in the database (excluding verbs)
|
|
934
945
|
* This is used for statistics reporting to match the expected behavior in tests
|
|
@@ -1309,7 +1320,7 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
1309
1320
|
*/
|
|
1310
1321
|
loadEnvironment(): Promise<void>;
|
|
1311
1322
|
/**
|
|
1312
|
-
* Set a configuration value
|
|
1323
|
+
* Set a configuration value with optional encryption
|
|
1313
1324
|
* @param key Configuration key
|
|
1314
1325
|
* @param value Configuration value
|
|
1315
1326
|
* @param options Options including encryption
|
|
@@ -1318,11 +1329,132 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
1318
1329
|
encrypt?: boolean;
|
|
1319
1330
|
}): Promise<void>;
|
|
1320
1331
|
/**
|
|
1321
|
-
* Get a configuration value
|
|
1332
|
+
* Get a configuration value with automatic decryption
|
|
1322
1333
|
* @param key Configuration key
|
|
1323
1334
|
* @returns Configuration value or undefined
|
|
1324
1335
|
*/
|
|
1325
1336
|
getConfig(key: string): Promise<any>;
|
|
1337
|
+
/**
|
|
1338
|
+
* Encrypt data using universal crypto utilities
|
|
1339
|
+
*/
|
|
1340
|
+
encryptData(data: string): Promise<string>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Decrypt data using universal crypto utilities
|
|
1343
|
+
*/
|
|
1344
|
+
decryptData(encryptedData: string): Promise<string>;
|
|
1345
|
+
/**
|
|
1346
|
+
* Neural Import - Smart bulk data import with semantic type detection
|
|
1347
|
+
* Uses transformer embeddings to automatically detect and classify data types
|
|
1348
|
+
* @param data Array of data items or single item to import
|
|
1349
|
+
* @param options Import options including type hints and processing mode
|
|
1350
|
+
* @returns Array of created IDs
|
|
1351
|
+
*/
|
|
1352
|
+
import(data: any[] | any, options?: {
|
|
1353
|
+
typeHint?: NounType;
|
|
1354
|
+
autoDetect?: boolean;
|
|
1355
|
+
batchSize?: number;
|
|
1356
|
+
process?: 'auto' | 'guided' | 'explicit' | 'literal';
|
|
1357
|
+
}): Promise<string[]>;
|
|
1358
|
+
/**
|
|
1359
|
+
* Add Noun - Explicit noun creation with strongly-typed NounType
|
|
1360
|
+
* For when you know exactly what type of noun you're creating
|
|
1361
|
+
* @param data The noun data
|
|
1362
|
+
* @param nounType The explicit noun type from NounType enum
|
|
1363
|
+
* @param metadata Additional metadata
|
|
1364
|
+
* @returns Created noun ID
|
|
1365
|
+
*/
|
|
1366
|
+
addNoun(data: any, nounType: NounType, metadata?: any): Promise<string>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Add Verb - Unified relationship creation between nouns
|
|
1369
|
+
* Creates typed relationships with proper vector embeddings from metadata
|
|
1370
|
+
* @param sourceId Source noun ID
|
|
1371
|
+
* @param targetId Target noun ID
|
|
1372
|
+
* @param verbType Relationship type from VerbType enum
|
|
1373
|
+
* @param metadata Additional metadata for the relationship (will be embedded for searchability)
|
|
1374
|
+
* @param weight Relationship weight/strength (0-1, default: 0.5)
|
|
1375
|
+
* @returns Created verb ID
|
|
1376
|
+
*/
|
|
1377
|
+
addVerb(sourceId: string, targetId: string, verbType: VerbType, metadata?: any, weight?: number): Promise<string>;
|
|
1378
|
+
/**
|
|
1379
|
+
* Auto-detect whether to use neural processing for data
|
|
1380
|
+
* @private
|
|
1381
|
+
*/
|
|
1382
|
+
private shouldAutoProcessNeurally;
|
|
1383
|
+
/**
|
|
1384
|
+
* Detect noun type using semantic analysis
|
|
1385
|
+
* @private
|
|
1386
|
+
*/
|
|
1387
|
+
private detectNounType;
|
|
1388
|
+
/**
|
|
1389
|
+
* Get Noun with Connected Verbs - Retrieve noun and all its relationships
|
|
1390
|
+
* Provides complete traversal view of a noun and its connections using existing searchVerbs
|
|
1391
|
+
* @param nounId The noun ID to retrieve
|
|
1392
|
+
* @param options Traversal options
|
|
1393
|
+
* @returns Noun data with connected verbs and related nouns
|
|
1394
|
+
*/
|
|
1395
|
+
getNounWithVerbs(nounId: string, options?: {
|
|
1396
|
+
includeIncoming?: boolean;
|
|
1397
|
+
includeOutgoing?: boolean;
|
|
1398
|
+
verbLimit?: number;
|
|
1399
|
+
verbTypes?: string[];
|
|
1400
|
+
}): Promise<{
|
|
1401
|
+
noun: {
|
|
1402
|
+
id: string;
|
|
1403
|
+
data: any;
|
|
1404
|
+
metadata: any;
|
|
1405
|
+
nounType?: NounType;
|
|
1406
|
+
};
|
|
1407
|
+
incomingVerbs: any[];
|
|
1408
|
+
outgoingVerbs: any[];
|
|
1409
|
+
totalConnections: number;
|
|
1410
|
+
} | null>;
|
|
1411
|
+
/**
|
|
1412
|
+
* Update - Smart noun update with automatic index synchronization
|
|
1413
|
+
* Updates both data and metadata while maintaining search index integrity
|
|
1414
|
+
* @param id The noun ID to update
|
|
1415
|
+
* @param data New data (optional - if not provided, only metadata is updated)
|
|
1416
|
+
* @param metadata New metadata (merged with existing)
|
|
1417
|
+
* @param options Update options
|
|
1418
|
+
* @returns Success boolean
|
|
1419
|
+
*/
|
|
1420
|
+
update(id: string, data?: any, metadata?: any, options?: {
|
|
1421
|
+
merge?: boolean;
|
|
1422
|
+
reindex?: boolean;
|
|
1423
|
+
cascade?: boolean;
|
|
1424
|
+
}): Promise<boolean>;
|
|
1425
|
+
/**
|
|
1426
|
+
* Preload Transformer Model - Essential for container deployments
|
|
1427
|
+
* Downloads and caches models during initialization to avoid runtime delays
|
|
1428
|
+
* @param options Preload options
|
|
1429
|
+
* @returns Success boolean and model info
|
|
1430
|
+
*/
|
|
1431
|
+
static preloadModel(options?: {
|
|
1432
|
+
model?: string;
|
|
1433
|
+
cacheDir?: string;
|
|
1434
|
+
device?: string;
|
|
1435
|
+
force?: boolean;
|
|
1436
|
+
}): Promise<{
|
|
1437
|
+
success: boolean;
|
|
1438
|
+
modelPath: string;
|
|
1439
|
+
modelSize: number;
|
|
1440
|
+
device: string;
|
|
1441
|
+
}>;
|
|
1442
|
+
/**
|
|
1443
|
+
* Warmup - Initialize BrainyData with preloaded models (container-optimized)
|
|
1444
|
+
* For production deployments where models should be ready immediately
|
|
1445
|
+
* @param config BrainyData configuration
|
|
1446
|
+
* @param options Warmup options
|
|
1447
|
+
*/
|
|
1448
|
+
static warmup(config?: BrainyDataConfig, options?: {
|
|
1449
|
+
preloadModel?: boolean;
|
|
1450
|
+
modelOptions?: Parameters<typeof BrainyData.preloadModel>[0];
|
|
1451
|
+
testEmbedding?: boolean;
|
|
1452
|
+
}): Promise<BrainyData>;
|
|
1453
|
+
/**
|
|
1454
|
+
* Get model size for deployment info
|
|
1455
|
+
* @private
|
|
1456
|
+
*/
|
|
1457
|
+
private static getModelSize;
|
|
1326
1458
|
/**
|
|
1327
1459
|
* Coordinate storage migration across distributed services
|
|
1328
1460
|
* @param options Migration options
|
|
@@ -1342,5 +1474,54 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
1342
1474
|
* Exposed for Cortex reindex command
|
|
1343
1475
|
*/
|
|
1344
1476
|
rebuildMetadataIndex(): Promise<void>;
|
|
1477
|
+
/**
|
|
1478
|
+
* Enable an augmentation by name
|
|
1479
|
+
* Universal control for built-in, community, and premium augmentations
|
|
1480
|
+
*
|
|
1481
|
+
* @param name The name of the augmentation to enable
|
|
1482
|
+
* @returns True if augmentation was found and enabled
|
|
1483
|
+
*/
|
|
1484
|
+
enableAugmentation(name: string): boolean;
|
|
1485
|
+
/**
|
|
1486
|
+
* Disable an augmentation by name
|
|
1487
|
+
* Universal control for built-in, community, and premium augmentations
|
|
1488
|
+
*
|
|
1489
|
+
* @param name The name of the augmentation to disable
|
|
1490
|
+
* @returns True if augmentation was found and disabled
|
|
1491
|
+
*/
|
|
1492
|
+
disableAugmentation(name: string): boolean;
|
|
1493
|
+
/**
|
|
1494
|
+
* Check if an augmentation is enabled
|
|
1495
|
+
*
|
|
1496
|
+
* @param name The name of the augmentation to check
|
|
1497
|
+
* @returns True if augmentation is found and enabled, false otherwise
|
|
1498
|
+
*/
|
|
1499
|
+
isAugmentationEnabled(name: string): boolean;
|
|
1500
|
+
/**
|
|
1501
|
+
* Get all augmentations with their enabled status
|
|
1502
|
+
* Shows built-in, community, and premium augmentations
|
|
1503
|
+
*
|
|
1504
|
+
* @returns Array of augmentations with name, type, and enabled status
|
|
1505
|
+
*/
|
|
1506
|
+
listAugmentations(): Array<{
|
|
1507
|
+
name: string;
|
|
1508
|
+
type: string;
|
|
1509
|
+
enabled: boolean;
|
|
1510
|
+
description: string;
|
|
1511
|
+
}>;
|
|
1512
|
+
/**
|
|
1513
|
+
* Enable all augmentations of a specific type
|
|
1514
|
+
*
|
|
1515
|
+
* @param type The type of augmentations to enable (sense, conduit, cognition, etc.)
|
|
1516
|
+
* @returns Number of augmentations enabled
|
|
1517
|
+
*/
|
|
1518
|
+
enableAugmentationType(type: 'sense' | 'conduit' | 'cognition' | 'memory' | 'perception' | 'dialog' | 'activation' | 'webSocket'): number;
|
|
1519
|
+
/**
|
|
1520
|
+
* Disable all augmentations of a specific type
|
|
1521
|
+
*
|
|
1522
|
+
* @param type The type of augmentations to disable (sense, conduit, cognition, etc.)
|
|
1523
|
+
* @returns Number of augmentations disabled
|
|
1524
|
+
*/
|
|
1525
|
+
disableAugmentationType(type: 'sense' | 'conduit' | 'cognition' | 'memory' | 'perception' | 'dialog' | 'activation' | 'webSocket'): number;
|
|
1345
1526
|
}
|
|
1346
1527
|
export { euclideanDistance, cosineDistance, manhattanDistance, dotProductDistance } from './utils/index.js';
|