Commit graph

153 commits

Author SHA1 Message Date
fbfe1ba9b8 0.62.0 2025-08-11 13:52:09 -07:00
8c13dd0382 0.61.3 2025-08-11 13:37:05 -07:00
b958852426 0.61.2 2025-08-11 13:02:34 -07:00
f7484a9467 feat: Simplify architecture with Cortex orchestrator and clear augmentation tiers
## Major Architecture Improvements

### Cortex Refactoring
- Renamed AugmentationPipeline → Cortex for clarity
- Cortex is now the central orchestrator (not an augmentation)
- NeuralImport remains as the AI-powered SENSE augmentation
- Clean brain metaphor: BrainyData → Cortex → Augmentations

### Four-Tier Augmentation System
1. **Built-in** (Free, MIT): Neural Import, basic storage, search
2. **Community** (Free, npm): Community-created augmentations
3. **Premium** ($49-299/mo): AI Memory, Agent Coordinator, Enterprise connectors
4. **Brain Cloud** ($19-99/mo): Managed service with all features

### Zero Configuration Philosophy
- Everything works out of the box - no config needed
- Automatic model detection and loading
- Seamless integration between tiers
- Brain Cloud connects with one command: `brainy cloud`

### Documentation Updates
- Added PHILOSOPHY.md outlining design principles
- Created AUGMENTATION_ARCHITECTURE.md with tier system
- Added CLI_AUGMENTATION_GUIDE.md for augmentation management
- Updated README to "sell first" with concrete use cases
- Improved documentation organization in /docs

### Developer Experience
- Backward compatibility maintained with exports
- Clean, simple API surface
- Interactive-by-default approach
- Premium features integrate seamlessly

### Removed
- Deleted demo directory and deploy workflow (moved to website)
- Removed test wrapper scripts (bash 2>&1 bug workaround)

This refactor makes Brainy incredibly powerful yet easy to use, with everything automated and no configuration required. The Brain Cloud augmentations (AI memory, sync, coordination) integrate seamlessly as our killer features.
2025-08-11 09:40:37 -07:00
c59de5a48b Release v0.61.1 - Update repository and domain references 2025-08-10 16:45:33 -07:00
5e0c02e363 chore: Update repository references from soulcraft-research to soulcraftlabs
- Updated GitHub URLs to github.com/soulcraftlabs/brainy
- Updated git remote origin URL
- Updated all documentation references
2025-08-10 16:42:02 -07:00
8e48b58650 0.61.0 2025-08-10 16:25:23 -07:00
abc17397b1 feat: Remove dangerous getAllNouns/getAllVerbs methods, add safe pagination
BREAKING CHANGE: Removed getAllNouns() and getAllVerbs() from StorageAdapter interface
These methods could cause expensive full scans on cloud storage (S3/R2) leading to
high costs and performance issues. Replaced with safe paginated methods.

Changes:
- Remove getAllNouns/getAllVerbs from StorageAdapter interface and implementations
- Add internal optimization methods for intelligent preloading when safe
- Fix OPFS storage file naming consistency (.json extension)
- Fix S3 high-volume mode detection thresholds (was too aggressive)
- Fix TypeScript compilation errors with async methods
- Update all tests to use paginated methods

Performance:
- Add smart dataset size detection for automatic optimization
- Maintain all internal performance optimizations through safe preloading
- Only preload data in read-only mode or when dataset is small (<10k entities)

Fixes:
- Fix intelligent verb scoring tests metadata structure
- Fix S3 storage getVerbsBySource/Target/Type methods
- Fix memory usage in search operations using pagination

Docs:
- Add comprehensive storage architecture documentation
- Document known bash redirection issue
- Update README with architecture doc link

All affected tests passing
2025-08-10 16:25:12 -07:00
30fe350d54 0.60.0 2025-08-10 13:53:22 -07:00
6e85468879 fix: optimize package size and improve test reliability
Major improvements to build process, package optimization, and test infrastructure:

## Package Size Optimization (3.4MB → 2.2MB)
- Remove source maps from npm package (reduce size by 35%)
- Update package.json files field to exclude *.js.map and *.d.ts.map
- Enhanced .npmignore for better exclusion patterns
- Preserve all browser compatibility and universal shims

## Test Infrastructure Fixes
- Increase test timeouts to 120s for TensorFlow operations
- Improve memory management with garbage collection hooks
- Add proper cleanup between tests to prevent file accumulation
- Configure single-fork test execution to reduce memory usage
- Fix test parameter issues in intelligent verb scoring tests

## Bug Fixes
- Fix lock directory creation in FileSystemStorage
- Remove deprecated node-fetch import from api-integration tests
- Fix addVerb() and db.add() parameter usage throughout test suite
- Ensure proper vector dimensions (384) in all test vectors
- Add directory existence checks before lock file operations

## Build & Development
- Update vitest configuration for better concurrency and reliability
- Add comprehensive test cleanup in setup.ts
- Preserve all browser JavaScript functionality and universal compatibility layer

The package now meets size requirements while maintaining full functionality
for both browser and Node.js environments.
2025-08-10 13:52:01 -07:00
9019672ff0 Release v0.59.3
- Fixed issue with mysterious "2" appearing in test commands
- Cleaned up prototyping changes from brain-cloud/MCP experiments
- Tests passing (with some timeouts on long-running tests)
- Build successful

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-10 12:49:58 -07:00
edb9774005 0.59.2 2025-08-10 11:59:53 -07:00
a1621cc5c6 fix: use native fetch instead of node-fetch dependency
- Removed unnecessary node-fetch import from bin/brainy.js
- Removed node-fetch import from brainy-mcp-server.js
- Native fetch available since Node 18, brainy requires Node 24.4.0+
- Reduces dependencies by 6 packages
- Avoids indirect deprecation warning from boolean package
- No impact on browser compatibility (CLI is Node-only, core library unaffected)

Architecture notes:
- Brain Cloud integration remains as augmentation option
- Users can choose: local (free), Brain Cloud (9/mo), or self-host
- Clean separation maintained: brainy (MIT) vs Brain Cloud (proprietary)
- TODO: Consider extracting Brain Cloud specific URLs to config
2025-08-10 11:32:59 -07:00
664bef2eae fix: add missing node-fetch dependency for brainy cloud command
- Added node-fetch to dependencies (was only in devDependencies)
- Fixes 'Cannot find package node-fetch' error when running brainy cloud
- Bumped version to 0.59.1
- Note: boolean deprecation warning comes from @huggingface/transformers deep dependency, cannot be fixed directly
2025-08-10 11:21:05 -07:00
936fb19402 Release v0.59.0 - Brain Cloud integration with MCP and CLI 2025-08-09 18:27:30 -07:00
90baeeb4a3 feat: Brain Cloud integration with MCP server and CLI commands
- Add brainy connect command for one-click Brain Cloud setup
- Create MCP server for AI memory persistence
- Add cloud management commands (export, status, dashboard)
- Automatic customer ID detection and configuration
- Natural language instructions for AI assistants
- Support for multi-agent coordination
- Complete Brain Cloud integration for solving AI Amnesia
2025-08-09 18:27:21 -07:00
af7a1e1cbc 0.58.1 2025-08-09 14:36:16 -07:00
682e152b98 feat: redesign Brainy CLI for intuitive UX and add Brain Jar support
- Refactor CLI to use direct commands instead of nested structure
- Add Brain Jar AI coordination commands with premium/free modes
- Update Cortex class with enhanced Brain Jar functionality
- Fix TypeScript compilation by removing exclusion of cortex directory
- Improve user experience with beautiful branded output
- Add comprehensive help system and backward compatibility

Major UX improvements:
- brainy init, add, search (direct commands)
- brainy install brain-jar (simple installation)
- brainy brain-jar start/dashboard/status (rich subcommands)
- brainy chat (interactive mode)
- brainy config set/get/list (configuration management)

This redesign makes Brainy significantly more user-friendly while
maintaining all existing functionality and adding powerful new
AI coordination capabilities.
2025-08-08 18:05:12 -07:00
93804be354 feat: add universal adapters for browser compatibility
- Create universal adapters for cross-platform support (browser/Node/serverless)
- Replace Node.js-specific imports with universal implementations
- Add OPFS support for browser persistent storage
- Maintain same BrainyData interface across all environments
- Enable real Brainy usage in browser console UI
- Keep package size optimized (no bloat)

Universal adapters in /src/universal/:
- uuid.ts: Cross-platform UUID generation
- crypto.ts: Browser/Node crypto operations
- fs.ts: OPFS/FileSystem/Memory storage adapter
- path.ts: Universal path operations
- events.ts: EventEmitter compatibility layer

This enables 'write once, run anywhere' for Brainy while maintaining
the exact same API. No breaking changes to existing code.
2025-08-08 15:22:38 -07:00
6e8869ecb7 0.58.0 2025-08-08 07:14:29 -07:00
ce9e0e2927 0.57.1 2025-08-08 06:13:21 -07:00
bd39b71fbf feat: v0.57.0 - rename CLI to brainy and Neural Import to Cortex
BREAKING CHANGES:
- CLI command renamed from 'cortex' to 'brainy'
- Neural Import renamed to Cortex augmentation
- Class CortexSenseAugmentation (was NeuralImportSenseAugmentation)

Benefits:
- npx @soulcraft/brainy now works automatically
- Better conceptual clarity: Cortex = AI intelligence layer
- Cleaner architecture: CLI = brainy, AI = Cortex, DB = BrainyData
2025-08-07 20:13:02 -07:00
27ce6c242d feat: release v0.56.0 - Cortex CLI complete implementation & TypeScript fixes
- Complete Cortex CLI command center with all features
- Fix all TypeScript compilation errors for clean build
- Add Neural Import as default SENSE augmentation (awaiting full integration)
- Update CHANGELOG with comprehensive v0.56.0 notes
- Add cortex.d.ts type definitions
- Fix error handling for unknown error types
- Fix emoji and color properties in terminal output
- Published to npm and created GitHub release
2025-08-07 19:59:19 -07:00
d5386a3643 feat: add Cortex CLI, augmentation system, and enterprise features
Major enhancements to Brainy vector + graph database:

Core Features (FREE):
- Cortex CLI: Complete command center for database management
- Neural Import: AI-powered data understanding and entity extraction
- Augmentation Pipeline: 8-stage extensible processing system
- Brainy Chat: Natural language interface to query data
- Performance monitoring and health diagnostics
- Backup/restore with compression and encryption
- Webhook system for enterprise integrations

Infrastructure:
- Clean separation of core (open source) and premium features
- Lazy-loaded augmentations with zero performance impact
- Comprehensive documentation for all new features
- Full TypeScript support with proper interfaces

Performance:
- Zero impact on core operations (proven with benchmarks)
- 2-3% performance improvement from better caching
- Package size remains at 643KB (no bloat)

Security:
- Removed sensitive files from Git history
- Added .gitignore rules for PDFs and private files
- Premium features in separate private repository

Premium Features (separate repository):
- Quantum Vault connectors (Notion, Salesforce, Slack, Asana)
- Licensing system for premium augmentations
- Revenue projections and business model

This commit maintains 100% backward compatibility while adding
powerful enterprise features as progressive enhancements.
2025-08-07 19:33:03 -07:00
ce677f441d chore: simplify build for v0.55.0 release
- Temporarily remove Cortex CLI dependencies to fix build
- Keep core coordination methods in BrainyData
- Cortex CLI will be added in v0.56 as separate package
2025-08-07 13:55:42 -07:00
0c51504706 0.55.0 2025-08-07 13:53:21 -07:00
89d6d1e8ce feat: add Cortex - complete CLI command center for configuration and coordination
- New CLI tool for managing Brainy databases
- Encrypted configuration management (replaces .env files)
- Distributed storage migration coordination
- Advanced MongoDB-style query interface
- Backup/restore, health checks, statistics
- Interactive shell mode
- One-line integration: await brainy.loadEnvironment()
- Full documentation and migration guides
- Node.js only (browser safe with environment detection)

BREAKING CHANGE: Package size increased ~250KB due to CLI dependencies
2025-08-07 13:53:17 -07:00
45f68b7311 0.54.7 2025-08-07 12:41:09 -07:00
56330ff55f 0.54.6 2025-08-07 12:14:27 -07:00
befa1c2c8d 0.54.5 2025-08-07 11:46:11 -07:00
6648149e90 0.54.4 2025-08-07 11:07:14 -07:00
18c1fa8937 fix(critical): enable metadata indexing in write-only mode + force buffering activation
🚨 CRITICAL FIXES:

1. METADATA INDEXING IN WRITE-ONLY MODE:
   - Was: if (\!this.writeOnly) - DISABLED metadata indexing for bluesky/github packages\!
   - Now: if (\!this.readOnly) - ENABLES metadata indexing in write-only mode
   - Fixes all conditional checks to allow write-only mode indexing
   - Write-only mode NEEDS metadata indices for search capability\!

2. STATISTICS FOLDER LOCATION:
   - Statistics now go to _system/ folder instead of legacy _index/
   - Uses systemPrefix instead of indexPrefix for new statistics

3. FORCE BUFFERING ACTIVATION:
   - Threshold lowered from 1 to 0 (immediate activation)
   - Added 'true' condition to force enable high-volume mode
   - This should guarantee buffering activation in production

IMPACT:
- bluesky-package and github-package will now CREATE metadata indices
- _metadata/noun/ and _metadata/verb/ folders will appear in S3
- Metadata filtering and field searches will work in write-only mode
- Statistics will be in proper _system/ folder structure
- Buffering should activate immediately (guaranteed)

This fixes the missing S3 folder structure and search capabilities.
2025-08-07 10:11:40 -07:00
b989e72be4 fix(emergency): drastically lower high-volume mode activation thresholds
EMERGENCY FIX for bluesky-package socket exhaustion despite v0.54.1

🚨 CRITICAL CHANGES:
- Activation threshold: 100 → 1 pending operation (configurable)
- Add socket utilization trigger: >10% usage activates buffering
- Add environment variables:
  - BRAINY_BUFFER_THRESHOLD=1 (when to start buffering)
  - BRAINY_FORCE_BUFFERING=true (force enable)
- Add comprehensive logging with emojis for visibility:
  - '🚨 HIGH-VOLUME MODE ACTIVATED 🚨' when buffering starts
  - '🚀 BATCH FLUSH: N items → 1 bulk S3 operation' for batch writes
  - '📈 BUFFER GROWTH: N items buffered' every 100 additions

PROBLEM: v0.54.1 buffering not activating with 7,500 pending requests
SOLUTION: Activate buffering at first sign of load (1+ pending operations)

This should immediately activate buffering in bluesky-package production.
2025-08-07 09:51:22 -07:00
a0d736472c fix: implement high-volume optimizations to prevent socket exhaustion
- Add request coalescing to reduce S3 API calls by up to 90%
- Implement write buffering with automatic batch flushing
- Add operation deduplication to eliminate redundant requests
- Introduce high-volume mode that automatically activates under load
- Batch S3 operations to reduce from 16,000+ individual to ~160 batch operations
- Maintain zero-configuration approach with automatic adaptation

This fix addresses the socket exhaustion issue in bluesky-package where
16,000+ pending requests were overwhelming the system. The new buffering
and coalescing systems reduce S3 operations by 100x while maintaining
data consistency.
2025-08-07 09:09:43 -07:00
30fe943146 chore(release): 0.54.0 [skip ci]
feat: automatic adaptive performance optimization
- Zero-configuration socket management (100-2000 dynamic scaling)
- Intelligent backpressure with circuit breaker
- Self-healing and auto-recovery from overload
- Real-time performance monitoring
- Automatic batch size optimization
- Prevents socket exhaustion in high-volume scenarios
2025-08-07 08:50:42 -07:00
9842af2fe3 feat: add automatic adaptive performance optimization for high-volume scenarios
- Implement AdaptiveSocketManager for zero-config socket pool scaling
- Add AdaptiveBackpressure for intelligent flow control with circuit breaker
- Create PerformanceMonitor for real-time metrics and auto-optimization
- Automatically adapt to load patterns without manual configuration
- Self-healing system that learns from usage patterns
- Dynamically adjust batch sizes based on system resources
- Automatic recovery from socket exhaustion scenarios
- No configuration required - system adapts automatically

This addresses socket exhaustion issues reported by bluesky-package
by providing automatic, adaptive resource management that scales
based on actual load patterns.
2025-08-07 08:37:15 -07:00
e237e81700 0.53.0 2025-08-07 08:00:52 -07:00
73c821db0f chore(release): 0.52.0 [skip ci] 2025-08-07 06:17:33 -07:00
bb09706d96 feat: add automatic high-volume handling for S3 storage adapter
- Configure AWS SDK with 500 max sockets (up from default 50)
- Add intelligent backpressure with pending operation tracking
- Implement dynamic batch sizing based on memory pressure
- Auto-reduce operations when heap usage exceeds 80%
- Gradually recover throughput when system stabilizes
- Track and respond to consecutive error patterns
- Fix S3 mock to not add ID to metadata objects
- Add backpressure to metadata save operations
- All changes are transparent - no configuration required
2025-08-07 06:11:45 -07:00
54e7e56712 chore: remove unused rollup dependencies
- Remove all @rollup/* plugin dependencies and rollup itself
- Project now uses simple TypeScript compilation (tsc) only
- Update model bundle timestamp
2025-08-07 05:40:41 -07:00
83a08c748f chore: bump version to 0.51.2 2025-08-06 16:41:10 -07:00
acf7652cd0 chore: bump version to 0.51.1 2025-08-06 16:39:01 -07:00
80060a17a9 chore: bump version to 0.51.0 2025-08-06 16:28:52 -07:00
bd75228117 chore: bump version to 0.50.0 2025-08-06 16:08:55 -07:00
348755ad8f 0.49.0 2025-08-06 15:06:14 -07:00
6f8df1297f chore(release): 0.48.0 [skip ci] 2025-08-05 20:02:32 -07:00
cff9ae8215 feat: add GPU acceleration for embeddings with smart device auto-detection
Add comprehensive GPU support for embedding generation while maintaining optimized CPU processing for distance calculations:

- Add device option to TransformerEmbeddingOptions (auto, cpu, webgpu, cuda, gpu)
- Implement smart auto-detection of best available GPU (WebGPU for browsers, CUDA for Node.js)
- Add automatic CPU fallback if GPU initialization fails
- Fix misleading GPU acceleration claims in distance functions and HNSW search
- Update documentation to accurately reflect GPU usage (embeddings only)
- Add comprehensive example demonstrating GPU acceleration usage
- Maintain full backward compatibility with existing code

Performance improvements: 3-5x faster embedding generation when GPU is available, while keeping faster CPU processing for 384-dim vector distance calculations.
2025-08-05 20:00:04 -07:00
c8bb113f7f chore(release): 0.47.0 [skip ci] 2025-08-05 19:48:43 -07:00
f898f0ce7b feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime
BREAKING CHANGE: Complete migration from TensorFlow.js to Transformers.js for embedding generation

This is a major architectural change that replaces TensorFlow.js (USE model) with Transformers.js (all-MiniLM-L6-v2) for significantly improved performance and reduced complexity.

Key Changes:
- Replace TensorFlow.js Universal Sentence Encoder with Transformers.js all-MiniLM-L6-v2
- Reduce model size from 525MB to 87MB (83% reduction)
- Reduce embedding dimensions from 512 to 384 (faster distance calculations)
- Remove TensorFlow.js Float32Array patching (caused ONNX conflicts)
- Implement smart bundled model detection for offline operation
- Add explicit model download script for Docker deployments
- Remove complex environment variables in favor of simple configuration
- Update all distance functions to use optimized pure JavaScript
- Remove TensorFlow-specific utilities and type definitions

Performance Improvements:
- Model loading: 5x faster (87MB vs 525MB)
- Memory usage: 75% reduction (~200-400MB vs ~1.5GB)
- Distance calculations: Faster pure JS vs GPU overhead for small vectors
- Cold start performance: Significantly improved

Files Changed:
- Updated package.json: New dependencies, simplified scripts
- Rewrote src/utils/embedding.ts: Complete Transformers.js implementation
- Updated src/utils/distance.ts: Optimized JavaScript distance functions
- Simplified src/setup.ts: Removed TensorFlow-specific patching
- Simplified src/utils/textEncoding.ts: Only Node.js TextEncoder/Decoder patches
- Deleted src/utils/robustModelLoader.ts: TensorFlow-specific loader
- Deleted src/types/tensorflowTypes.ts: TensorFlow type definitions
- Added scripts/download-models.cjs: Docker-compatible model downloader
- Added comprehensive documentation: README.md, OFFLINE_MODELS.md, analysis docs

Testing:
- All 19 tests passing
- Removed test mocking in favor of real implementation testing
- Updated test environment for Transformers.js compatibility
- Performance tests validate improved efficiency

This migration resolves production issues with Docker egress limitations and provides a more robust, performant foundation for vector operations.
2025-08-05 19:29:59 -07:00
c488c9ee60 chore(release): 0.46.0 [skip ci] 2025-08-05 18:12:50 -07:00