brainy/examples
David Snelling 46c6af3f21 feat: implement always-adaptive caching with getCacheStats monitoring
Replaces lazy mode concept with always-adaptive caching strategy:

- Rename getLazyModeStats() → getCacheStats() with enhanced metrics
- Change lazyModeEnabled boolean → cachingStrategy enum ('preloaded' | 'on-demand')
- Update preloading threshold from 30% to 80% for better cache utilization
- Add comprehensive production monitoring and diagnostics
- Add memory detection for containers (Docker/K8s cgroups v1/v2)
- Add adaptive memory sizing from 2GB to 128GB+ systems

Breaking changes: None (backward compatible, deprecated lazy option ignored)

New APIs:
- getCacheStats(): Comprehensive cache performance statistics
- cachingStrategy field: Transparent strategy reporting
- Enhanced fairness metrics and memory pressure monitoring

Documentation:
- Add migration guide for v3.36.0
- Add operations/capacity-planning.md for enterprise deployments
- Update all examples and troubleshooting guides
- Rename monitor-lazy-mode.ts → monitor-cache-performance.ts
2025-10-10 14:09:30 -07:00
..
tests feat: remove legacy ImportManager, standardize getStats() API 2025-10-09 11:40:31 -07:00
api-server-example.ts fix: update all imports and references from BrainyData to Brainy 2025-09-30 17:09:15 -07:00
augmentations-zero-config.ts fix: update all imports and references from BrainyData to Brainy 2025-09-30 17:09:15 -07:00
bluesky-distributed-setup.js feat: add distributed architecture with sharding and coordination 2025-09-22 15:45:35 -07:00
brainy-backup.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
complete-import-demo.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
demo.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
directory-import-with-caching.ts feat: add progress tracking, entity caching, and relationship confidence 2025-10-01 15:12:54 -07:00
import-excel-pdf-csv.ts feat: add intelligent import for CSV, Excel, and PDF files 2025-10-01 16:51:03 -07:00
monitor-cache-performance.ts feat: implement always-adaptive caching with getCacheStats monitoring 2025-10-10 14:09:30 -07:00
quick-import-test.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
README.md feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
smart-import-example.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
test-deduplication.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
test-excel-import.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
unified-import-example.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00

Brainy Examples

This directory contains example code and test scripts for Brainy.

Structure

  • demo.ts - Basic demonstration of Brainy's core features
  • tests/ - Various test scripts demonstrating different aspects of Brainy
    • Performance tests
    • Memory tests
    • Storage adapter tests
    • API functionality tests
    • CLI tests

Running Examples

Basic Demo

npm run build
node dist/examples/demo.js

Test Scripts

The scripts in tests/ are standalone Node.js scripts that can be run directly:

node examples/tests/test-simple.js
node examples/tests/test-core-functionality.js

Note

These are examples and test scripts for reference. For production use, see the main documentation in the project root.