@soulcraft/brainy 0.24.0 → 0.25.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 +22 -16
- package/dist/brainy.js +4574 -4691
- package/dist/brainy.min.js +750 -750
- package/dist/brainyData.d.ts +83 -0
- package/dist/coreTypes.d.ts +11 -0
- package/dist/storage/adapters/fileSystemStorage.d.ts +78 -29
- package/dist/storage/adapters/fileSystemStorage.d.ts.map +1 -1
- package/dist/storage/adapters/memoryStorage.d.ts.map +1 -1
- package/dist/storage/fileSystemStorage.d.ts +2 -15
- package/dist/storage/fileSystemStorage.d.ts.map +1 -1
- package/dist/storage/opfsStorage.d.ts +3 -66
- package/dist/storage/opfsStorage.d.ts.map +1 -1
- package/dist/storage/s3CompatibleStorage.d.ts +2 -14
- package/dist/storage/s3CompatibleStorage.d.ts.map +1 -1
- package/dist/testing/prettyReporter.d.ts +23 -0
- package/dist/testing/prettySummaryReporter.d.ts +22 -0
- package/dist/types/tensorflowTypes.d.ts +0 -8
- package/dist/types/tensorflowTypes.d.ts.map +1 -1
- package/dist/unified.d.ts +4 -0
- package/dist/unified.js +834 -280
- package/dist/unified.min.js +528 -528
- package/dist/utils/embedding.d.ts +7 -0
- package/dist/utils/embedding.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +99 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/textEncoding.d.ts +0 -7
- package/dist/utils/textEncoding.d.ts.map +1 -1
- package/dist/utils/version.d.ts +1 -1
- package/package.json +14 -3
- package/dist/augmentations/conduitAugmentations.js +0 -1158
- package/dist/augmentations/conduitAugmentations.js.map +0 -1
- package/dist/augmentations/memoryAugmentations.js +0 -255
- package/dist/augmentations/memoryAugmentations.js.map +0 -1
- package/dist/augmentations/serverSearchAugmentations.js +0 -531
- package/dist/augmentations/serverSearchAugmentations.js.map +0 -1
- package/dist/examples/basicUsage.js +0 -128
- package/dist/examples/basicUsage.js.map +0 -1
- package/dist/hnsw/hnswIndex.js +0 -550
- package/dist/hnsw/hnswIndex.js.map +0 -1
- package/dist/hnsw/hnswIndexOptimized.js +0 -441
- package/dist/hnsw/hnswIndexOptimized.js.map +0 -1
- package/dist/mcp/brainyMCPAdapter.js +0 -142
- package/dist/mcp/brainyMCPAdapter.js.map +0 -1
- package/dist/mcp/brainyMCPService.js +0 -248
- package/dist/mcp/brainyMCPService.js.map +0 -1
- package/dist/mcp/index.js +0 -17
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/mcpAugmentationToolset.js +0 -180
- package/dist/mcp/mcpAugmentationToolset.js.map +0 -1
- package/dist/storage/adapters/baseStorageAdapter.js +0 -233
- package/dist/storage/adapters/baseStorageAdapter.js.map +0 -1
- package/dist/storage/adapters/fileSystemStorage.js +0 -568
- package/dist/storage/adapters/fileSystemStorage.js.map +0 -1
- package/dist/storage/adapters/memoryStorage.js +0 -300
- package/dist/storage/adapters/memoryStorage.js.map +0 -1
- package/dist/storage/adapters/opfsStorage.js +0 -778
- package/dist/storage/adapters/opfsStorage.js.map +0 -1
- package/dist/storage/adapters/s3CompatibleStorage.js +0 -1021
- package/dist/storage/adapters/s3CompatibleStorage.js.map +0 -1
- package/dist/storage/baseStorage.js +0 -126
- package/dist/storage/baseStorage.js.map +0 -1
- package/dist/storage/storageFactory.js +0 -183
- package/dist/storage/storageFactory.js.map +0 -1
- package/dist/types/augmentations.js +0 -16
- package/dist/types/augmentations.js.map +0 -1
- package/dist/types/brainyDataInterface.js +0 -8
- package/dist/types/brainyDataInterface.js.map +0 -1
- package/dist/types/fileSystemTypes.js +0 -8
- package/dist/types/fileSystemTypes.js.map +0 -1
- package/dist/types/graphTypes.js +0 -36
- package/dist/types/graphTypes.js.map +0 -1
- package/dist/types/mcpTypes.js +0 -22
- package/dist/types/mcpTypes.js.map +0 -1
- package/dist/types/pipelineTypes.js +0 -7
- package/dist/types/pipelineTypes.js.map +0 -1
- package/dist/types/tensorflowTypes.js +0 -6
- package/dist/types/tensorflowTypes.js.map +0 -1
- package/dist/utils/distance.js +0 -239
- package/dist/utils/distance.js.map +0 -1
- package/dist/utils/embedding.js +0 -622
- package/dist/utils/embedding.js.map +0 -1
- package/dist/utils/environment.js +0 -75
- package/dist/utils/environment.js.map +0 -1
- package/dist/utils/index.js +0 -5
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/statistics.js +0 -25
- package/dist/utils/statistics.js.map +0 -1
- package/dist/utils/tensorflowUtils.js +0 -25
- package/dist/utils/tensorflowUtils.js.map +0 -1
- package/dist/utils/textEncoding.js +0 -281
- package/dist/utils/textEncoding.js.map +0 -1
- package/dist/utils/workerUtils.js +0 -458
- package/dist/utils/workerUtils.js.map +0 -1
package/README.md
CHANGED
|
@@ -494,7 +494,7 @@ const restoreResult = await db.restore(backupData, {clearExisting: true})
|
|
|
494
494
|
|
|
495
495
|
### Database Statistics
|
|
496
496
|
|
|
497
|
-
Brainy provides a way to get statistics about the current state of the database
|
|
497
|
+
Brainy provides a way to get statistics about the current state of the database. For detailed information about the statistics system, including implementation details, scalability improvements, and usage examples, see our [Statistics Guide](STATISTICS.md).
|
|
498
498
|
|
|
499
499
|
```typescript
|
|
500
500
|
import {BrainyData, getStatistics} from '@soulcraft/brainy'
|
|
@@ -503,22 +503,12 @@ import {BrainyData, getStatistics} from '@soulcraft/brainy'
|
|
|
503
503
|
const db = new BrainyData()
|
|
504
504
|
await db.init()
|
|
505
505
|
|
|
506
|
-
// Get statistics using the
|
|
507
|
-
const stats = await getStatistics(
|
|
506
|
+
// Get statistics using the instance method
|
|
507
|
+
const stats = await db.getStatistics()
|
|
508
508
|
console.log(stats)
|
|
509
|
-
// Output: { nounCount: 0, verbCount: 0, metadataCount: 0, hnswIndexSize: 0 }
|
|
510
|
-
|
|
511
|
-
// Or using the instance method
|
|
512
|
-
const instanceStats = await db.getStatistics()
|
|
509
|
+
// Output: { nounCount: 0, verbCount: 0, metadataCount: 0, hnswIndexSize: 0, serviceBreakdown: {...} }
|
|
513
510
|
```
|
|
514
511
|
|
|
515
|
-
The statistics include:
|
|
516
|
-
|
|
517
|
-
- `nounCount`: Number of nouns (entities) in the database
|
|
518
|
-
- `verbCount`: Number of verbs (relationships) in the database
|
|
519
|
-
- `metadataCount`: Number of metadata entries
|
|
520
|
-
- `hnswIndexSize`: Size of the HNSW index
|
|
521
|
-
|
|
522
512
|
### Working with Nouns (Entities)
|
|
523
513
|
|
|
524
514
|
```typescript
|
|
@@ -1317,8 +1307,24 @@ terabyte-scale data that can't fit entirely in memory, we provide several approa
|
|
|
1317
1307
|
- **Distributed HNSW**: Sharding and partitioning across multiple machines
|
|
1318
1308
|
- **Hybrid Solutions**: Combining quantization techniques with multi-tier architectures
|
|
1319
1309
|
|
|
1320
|
-
For detailed information on how to scale Brainy for large datasets, see our
|
|
1321
|
-
|
|
1310
|
+
For detailed information on how to scale Brainy for large datasets, vector dimension standardization, threading implementation, storage testing, and other technical topics, see our comprehensive [Technical Guides](TECHNICAL_GUIDES.md).
|
|
1311
|
+
|
|
1312
|
+
## Testing
|
|
1313
|
+
|
|
1314
|
+
Brainy uses Vitest for testing. For detailed information about testing in Brainy, including test configuration, scripts, reporting tools, and best practices, see our [Testing Guide](TESTING.md).
|
|
1315
|
+
|
|
1316
|
+
Here are some common test commands:
|
|
1317
|
+
|
|
1318
|
+
```bash
|
|
1319
|
+
# Run all tests
|
|
1320
|
+
npm test
|
|
1321
|
+
|
|
1322
|
+
# Run tests with comprehensive reporting
|
|
1323
|
+
npm run test:report
|
|
1324
|
+
|
|
1325
|
+
# Run tests with coverage
|
|
1326
|
+
npm run test:coverage
|
|
1327
|
+
```
|
|
1322
1328
|
|
|
1323
1329
|
## Contributing
|
|
1324
1330
|
|