@soulcraft/brainy 0.23.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.
Files changed (93) hide show
  1. package/README.md +22 -16
  2. package/dist/brainy.js +4574 -4691
  3. package/dist/brainy.min.js +750 -750
  4. package/dist/brainyData.d.ts +86 -10
  5. package/dist/coreTypes.d.ts +11 -0
  6. package/dist/storage/adapters/fileSystemStorage.d.ts +78 -29
  7. package/dist/storage/adapters/fileSystemStorage.d.ts.map +1 -1
  8. package/dist/storage/adapters/memoryStorage.d.ts.map +1 -1
  9. package/dist/storage/fileSystemStorage.d.ts +2 -15
  10. package/dist/storage/fileSystemStorage.d.ts.map +1 -1
  11. package/dist/storage/opfsStorage.d.ts +3 -66
  12. package/dist/storage/opfsStorage.d.ts.map +1 -1
  13. package/dist/storage/s3CompatibleStorage.d.ts +2 -14
  14. package/dist/storage/s3CompatibleStorage.d.ts.map +1 -1
  15. package/dist/testing/prettyReporter.d.ts +23 -0
  16. package/dist/testing/prettySummaryReporter.d.ts +22 -0
  17. package/dist/types/tensorflowTypes.d.ts +0 -8
  18. package/dist/types/tensorflowTypes.d.ts.map +1 -1
  19. package/dist/unified.d.ts +4 -0
  20. package/dist/unified.js +846 -297
  21. package/dist/unified.min.js +528 -528
  22. package/dist/utils/embedding.d.ts +7 -0
  23. package/dist/utils/embedding.d.ts.map +1 -1
  24. package/dist/utils/logger.d.ts +99 -0
  25. package/dist/utils/logger.d.ts.map +1 -0
  26. package/dist/utils/textEncoding.d.ts +0 -7
  27. package/dist/utils/textEncoding.d.ts.map +1 -1
  28. package/dist/utils/version.d.ts +1 -1
  29. package/package.json +14 -3
  30. package/dist/augmentations/conduitAugmentations.js +0 -1158
  31. package/dist/augmentations/conduitAugmentations.js.map +0 -1
  32. package/dist/augmentations/memoryAugmentations.js +0 -255
  33. package/dist/augmentations/memoryAugmentations.js.map +0 -1
  34. package/dist/augmentations/serverSearchAugmentations.js +0 -531
  35. package/dist/augmentations/serverSearchAugmentations.js.map +0 -1
  36. package/dist/examples/basicUsage.js +0 -128
  37. package/dist/examples/basicUsage.js.map +0 -1
  38. package/dist/hnsw/hnswIndex.js +0 -550
  39. package/dist/hnsw/hnswIndex.js.map +0 -1
  40. package/dist/hnsw/hnswIndexOptimized.js +0 -441
  41. package/dist/hnsw/hnswIndexOptimized.js.map +0 -1
  42. package/dist/mcp/brainyMCPAdapter.js +0 -142
  43. package/dist/mcp/brainyMCPAdapter.js.map +0 -1
  44. package/dist/mcp/brainyMCPService.js +0 -248
  45. package/dist/mcp/brainyMCPService.js.map +0 -1
  46. package/dist/mcp/index.js +0 -17
  47. package/dist/mcp/index.js.map +0 -1
  48. package/dist/mcp/mcpAugmentationToolset.js +0 -180
  49. package/dist/mcp/mcpAugmentationToolset.js.map +0 -1
  50. package/dist/storage/adapters/baseStorageAdapter.js +0 -233
  51. package/dist/storage/adapters/baseStorageAdapter.js.map +0 -1
  52. package/dist/storage/adapters/fileSystemStorage.js +0 -568
  53. package/dist/storage/adapters/fileSystemStorage.js.map +0 -1
  54. package/dist/storage/adapters/memoryStorage.js +0 -300
  55. package/dist/storage/adapters/memoryStorage.js.map +0 -1
  56. package/dist/storage/adapters/opfsStorage.js +0 -778
  57. package/dist/storage/adapters/opfsStorage.js.map +0 -1
  58. package/dist/storage/adapters/s3CompatibleStorage.js +0 -1021
  59. package/dist/storage/adapters/s3CompatibleStorage.js.map +0 -1
  60. package/dist/storage/baseStorage.js +0 -126
  61. package/dist/storage/baseStorage.js.map +0 -1
  62. package/dist/storage/storageFactory.js +0 -183
  63. package/dist/storage/storageFactory.js.map +0 -1
  64. package/dist/types/augmentations.js +0 -16
  65. package/dist/types/augmentations.js.map +0 -1
  66. package/dist/types/brainyDataInterface.js +0 -8
  67. package/dist/types/brainyDataInterface.js.map +0 -1
  68. package/dist/types/fileSystemTypes.js +0 -8
  69. package/dist/types/fileSystemTypes.js.map +0 -1
  70. package/dist/types/graphTypes.js +0 -36
  71. package/dist/types/graphTypes.js.map +0 -1
  72. package/dist/types/mcpTypes.js +0 -22
  73. package/dist/types/mcpTypes.js.map +0 -1
  74. package/dist/types/pipelineTypes.js +0 -7
  75. package/dist/types/pipelineTypes.js.map +0 -1
  76. package/dist/types/tensorflowTypes.js +0 -6
  77. package/dist/types/tensorflowTypes.js.map +0 -1
  78. package/dist/utils/distance.js +0 -239
  79. package/dist/utils/distance.js.map +0 -1
  80. package/dist/utils/embedding.js +0 -622
  81. package/dist/utils/embedding.js.map +0 -1
  82. package/dist/utils/environment.js +0 -75
  83. package/dist/utils/environment.js.map +0 -1
  84. package/dist/utils/index.js +0 -5
  85. package/dist/utils/index.js.map +0 -1
  86. package/dist/utils/statistics.js +0 -25
  87. package/dist/utils/statistics.js.map +0 -1
  88. package/dist/utils/tensorflowUtils.js +0 -25
  89. package/dist/utils/tensorflowUtils.js.map +0 -1
  90. package/dist/utils/textEncoding.js +0 -281
  91. package/dist/utils/textEncoding.js.map +0 -1
  92. package/dist/utils/workerUtils.js +0 -458
  93. 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 standalone function
507
- const stats = await getStatistics(db)
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
- comprehensive [Scaling Strategy](scalingStrategy.md) document.
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