@soulcraft/brainy 0.57.1 → 0.58.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 CHANGED
@@ -99,6 +99,8 @@ const answer = await chat.ask("What patterns do you see in customer behavior?")
99
99
  // → AI-powered insights from your knowledge graph!
100
100
  ```
101
101
 
102
+ <sub>**How it works:** Combines vector embeddings for semantic understanding • Graph relationships for connection patterns • Metadata filtering for structured analysis • Optional LLM for natural language insights</sub>
103
+
102
104
  **One line. Zero complexity. Optional LLM for genius-level responses.**
103
105
  [📖 **Learn More About Brainy Chat**](BRAINY-CHAT.md)
104
106
 
@@ -3236,8 +3236,9 @@ export class BrainyData {
3236
3236
  if (options.forceRefresh && this.storage && !this.frozen) {
3237
3237
  await this.storage.flushStatisticsToStorage();
3238
3238
  }
3239
- // Get statistics from storage
3240
- const stats = await this.storage.getStatistics();
3239
+ // Get statistics from storage (including throttling metrics if available)
3240
+ const stats = await this.storage.getStatisticsWithThrottling?.() ||
3241
+ await this.storage.getStatistics();
3241
3242
  // If statistics are available, use them
3242
3243
  if (stats) {
3243
3244
  // Initialize result
@@ -3329,6 +3330,10 @@ export class BrainyData {
3329
3330
  // Add enhanced statistics from collector
3330
3331
  const collectorStats = this.statisticsCollector.getStatistics();
3331
3332
  Object.assign(result, collectorStats);
3333
+ // Preserve throttling metrics from storage if available
3334
+ if (stats.throttlingMetrics) {
3335
+ result.throttlingMetrics = stats.throttlingMetrics;
3336
+ }
3332
3337
  // Update storage sizes if needed (only periodically for performance)
3333
3338
  await this.updateStorageSizesIfNeeded();
3334
3339
  }