claude-flow 2.7.3 → 2.7.5

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.
@@ -407,10 +407,26 @@ async function detectMemoryMode(flags, subArgs) {
407
407
  return 'basic';
408
408
  }
409
409
 
410
- // Default: AUTO MODE (smart selection with JSON fallback)
411
- // Automatically use ReasoningBank if initialized, otherwise fall back to basic mode
410
+ // Default: AUTO MODE with SQLite preference
411
+ // Try to use ReasoningBank (SQLite) by default, initialize if needed
412
412
  const initialized = await isReasoningBankInitialized();
413
- return initialized ? 'reasoningbank' : 'basic';
413
+
414
+ if (initialized) {
415
+ return 'reasoningbank';
416
+ }
417
+
418
+ // Not initialized yet - try to auto-initialize on first use
419
+ try {
420
+ const { initializeReasoningBank } = await import('../../reasoningbank/reasoningbank-adapter.js');
421
+ await initializeReasoningBank();
422
+ printInfo('🗄️ Initialized SQLite backend (.swarm/memory.db)');
423
+ return 'reasoningbank';
424
+ } catch (error) {
425
+ // SQLite initialization failed - fall back to JSON
426
+ printWarning(`⚠️ SQLite unavailable, using JSON fallback`);
427
+ printWarning(` Reason: ${error.message}`);
428
+ return 'basic';
429
+ }
414
430
  }
415
431
 
416
432
  // NEW: Check if ReasoningBank is initialized