Commit graph

54 commits

Author SHA1 Message Date
165def11a9 chore(release): 3.43.1 2025-10-14 10:44:10 -07:00
af376dcdfd chore(release): 3.41.1 2025-10-13 13:54:13 -07:00
b91e6fcd18 chore(release): 3.41.0 2025-10-13 13:16:48 -07:00
aada9cdcc9 chore(release): 3.40.3 2025-10-13 12:34:48 -07:00
853ea26477 chore(release): 3.40.2 2025-10-13 11:51:01 -07:00
76466f7f24 chore(release): 3.40.1 2025-10-13 11:25:30 -07:00
d62875dc6c chore(release): 3.40.0 2025-10-13 10:33:23 -07:00
e9718b0145 chore(release): 3.37.3 2025-10-10 17:49:50 -07:00
9fe790e0a7 chore(release): 3.37.2 2025-10-10 17:28:49 -07:00
bde27e68ab chore(release): 3.37.1 2025-10-10 16:54:27 -07:00
30063d440a chore(release): 3.37.0 2025-10-10 16:26:45 -07:00
ae1077b0fe chore(release): 3.36.1 2025-10-10 14:50:24 -07:00
8ba8336fca chore(release): 3.36.0 2025-10-10 14:28:48 -07:00
6037db3d85 chore(release): 3.35.0 2025-10-10 11:15:37 -07:00
51e468bc15 chore(release): 3.34.0 2025-10-09 18:33:37 -07:00
0d649b8a79 perf: pre-compute type embeddings at build time (zero runtime cost)
Major optimization - all type embeddings now built into package:

Build-time generation:
- Created scripts/buildTypeEmbeddings.ts to generate all type embeddings
- Generates embeddings for 31 NounTypes + 40 VerbTypes at build time
- Stores as base64-encoded binary data in embeddedTypeEmbeddings.ts
- Added check script to rebuild only when needed

Updated all consumers:
- NeuralEntityExtractor: loads pre-computed embeddings (instant)
- BrainyTypes: loads pre-computed embeddings (instant init)
- NaturalLanguageProcessor: loads pre-computed embeddings (instant init)

Build process:
- Added npm run build:types to generate embeddings
- Added npm run build:types:if-needed for conditional rebuild
- Integrated into main build pipeline
- Auto-rebuilds only when types or build script change

Benefits:
- Zero runtime cost - embeddings loaded instantly
- Survives all container restarts
- All 71 types always available (31 nouns + 40 verbs)
- ~100KB memory overhead for permanent performance gain
- Eliminates 5-10 second initialization delay

This completes the type embedding optimization started in v3.32.5
2025-10-09 18:08:57 -07:00
87eb60d527 perf: optimize concept extraction for production (15x faster)
Major performance improvement for large file imports:
- Neural entity extraction now only initializes requested types
- Reduces initialization from 31 types to 2-5 types for concept extraction
- Fixed apparent hang in Excel/PDF/Markdown imports with concept extraction

Technical changes:
- Modified NeuralEntityExtractor.initializeTypeEmbeddings() to accept requestedTypes parameter
- Updated extract() to pass options.types to initialization
- Re-enabled concept extraction by default in SmartExcelImporter
- Added enhanced GCS diagnostic logging for initialization troubleshooting

Performance impact:
- Small files (<100 rows): 5-20 seconds (was: appeared to hang)
- Medium files (100-500 rows): 20-100 seconds (was: timeout)
- Large files (500+ rows): Can be disabled if needed

Fixes critical production issue where brain.extractConcepts() caused timeouts
2025-10-09 17:52:28 -07:00
e52bcaf294 perf: implement smart count batching for 10x faster bulk operations
Add storage-type aware count batching that maintains reliability while
dramatically improving bulk operation performance (v3.32.3).

**Performance Impact:**
- Cloud storage: 1000 entities = 100 writes (was 1000) = 10x faster
- Local storage: Immediate persist (no batching needed)
- API use case: 2-10x faster for small batches

**How It Works:**
- Cloud storage (GCS, S3, R2): Batches 10 ops OR 5 seconds
- Local storage (File, Memory): Persists immediately
- Graceful shutdown: SIGTERM/SIGINT hooks flush pending counts

**Reliability:**
- Container restart: Same reliability as v3.32.2
- Graceful shutdown: Zero data loss
- Production ready: Backward compatible, zero config

**Changes:**
- baseStorageAdapter.ts: Smart batching with scheduleCountPersist()
- gcsStorage.ts: Cloud storage detection (isCloudStorage = true)
- s3CompatibleStorage.ts: Cloud storage detection
- brainy.ts: Graceful shutdown hooks (SIGTERM/SIGINT/beforeExit)
- package.json: Bump version to 3.32.3
- CHANGELOG.md: Document performance optimization

Fixes container restart bugs while making bulk imports production-scale ready.
No breaking changes, no migration required.
2025-10-09 17:35:01 -07:00
27764b8b9f chore(release): 3.32.2 2025-10-09 17:15:09 -07:00
12b8abc787 fix: resolve 5 critical import bugs for production scale
- Bug #1: Smart deduplication auto-disable for large imports (>100 entities)
- Bug #2: Batch relationship creation using relateMany() (10-30x faster)
- Bug #3: File locking in MetadataIndexManager prevents race conditions
- Bug #4: Fix documentation API field inconsistencies
- Bug #5: Promise resolution timeout (automatically fixed by Bug #2)
- Enhanced error handling for corrupted metadata files

Production-ready for 500+ entity imports with 1500+ relationships.

Files modified:
- src/utils/metadataIndex.ts - Added in-memory locking system
- src/import/ImportCoordinator.ts - Batch relationships + smart deduplication
- src/storage/adapters/fileSystemStorage.ts - Enhanced SyntaxError handling
- docs/guides/import-anything.md - Corrected API field names
2025-10-09 13:56:45 -07:00
e1bd61a726 chore(release): 3.30.2 2025-10-09 13:18:24 -07:00
cb67e88f1e chore(release): 3.30.1 2025-10-09 13:10:48 -07:00
1966c39f24 fix: move metadata routing to base class, fix GCS/S3 system key crashes
Critical fix for GCS/S3 native storage adapters crashing on metadata index keys.

Problem:
- GCS and S3 adapters crashed with "Invalid UUID format" errors
- System keys like __metadata_field_index__status are NOT UUIDs
- Adapters incorrectly tried to shard all metadata keys as UUIDs

Solution:
- Move sharding/routing logic from adapters to BaseStorage class
- Add analyzeKey() method to detect system keys vs entity UUIDs
- System keys route to _system/ directory (no sharding)
- Entity UUIDs route to sharded directories (256 shards)
- All adapters now implement 4 primitive operations:
  * writeObjectToPath(path, data)
  * readObjectFromPath(path)
  * deleteObjectFromPath(path)
  * listObjectsUnderPath(prefix)

Benefits:
- Impossible for future adapters to repeat this mistake
- Zero breaking changes, full backward compatibility
- No data migration required
- Cleaner architecture with better separation of concerns

Updated adapters: GcsStorage, S3CompatibleStorage, OPFSStorage,
FileSystemStorage, MemoryStorage

Added: docs/architecture/data-storage-architecture.md
Updated: README.md with architecture docs link
2025-10-09 13:10:06 -07:00
13303c20c2 chore(release): 3.30.0 2025-10-09 11:41:13 -07:00
58daf09403 feat: remove legacy ImportManager, standardize getStats() API
- Removed ImportManager class and exports (use brain.import() instead)
- Fixed all documentation: getStatistics() → getStats()
- Updated 41 files across codebase for consistency
- Removed ImportManager section from API docs
- Added v3.30.0 migration guide to CHANGELOG

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 11:40:31 -07:00
68c989e4f7 chore(release): 3.29.1 2025-10-09 11:09:11 -07:00
6453ba271f chore(release): 3.29.0 2025-10-09 10:42:26 -07:00
d693adcbc6 chore(release): 3.28.0 2025-10-08 16:56:14 -07:00
0035701f4a chore(release): 3.27.1 2025-10-08 14:49:50 -07:00
17898104e0 chore(release): 3.27.0 2025-10-08 14:10:55 -07:00
8a9cf1bd51 chore(release): 3.26.0 2025-10-08 13:33:39 -07:00
6d50fe4054 chore(release): 3.25.2 2025-10-07 17:02:10 -07:00
544c9f8a5e chore(release): 3.25.1 2025-10-07 13:55:23 -07:00
df13c196be chore(release): 3.25.0 2025-10-07 11:56:11 -07:00
9ebe95c6cc chore(release): 3.24.0 2025-10-07 10:43:14 -07:00
75ae282861 refactor: streamline core API surface 2025-10-04 08:52:06 -07:00
0d54da1471 chore(release): 3.22.0 2025-10-01 16:52:03 -07:00
aaf8e0f411 chore(release): 3.21.0 2025-10-01 15:13:07 -07:00
2f9d5121c1 feat: add progress tracking, entity caching, and relationship confidence
### Progress Tracking
- Add unified BrainyProgress<T> interface for all long-running operations
- Implement ProgressTracker with automatic time estimation
- Add throughput calculation (items/second)
- Add formatProgress() and formatDuration() utilities

### Entity Extraction Caching
- Implement LRU cache with TTL expiration (default: 7 days)
- Support file mtime and content hash-based invalidation
- Provide 10-100x speedup on repeated entity extraction
- Add comprehensive cache statistics and management

### Relationship Confidence Scoring
- Add multi-factor confidence scoring (proximity, patterns, structure)
- Track evidence (source text, position, detection method, reasoning)
- Filter relationships by confidence threshold
- Extend Relation interface with optional confidence/evidence fields

### Documentation
- Add comprehensive example: examples/directory-import-with-caching.ts
- Update README with new features section
- Update CHANGELOG with detailed release notes

### Performance
- Cache hit rate: Expected >80% for typical workloads
- Cache speedup: 10-100x faster on cache hits
- Memory overhead: <20% increase with default settings
- Scoring speed: <1ms per relationship

BREAKING CHANGES: None - all features are backward compatible and opt-in
2025-10-01 15:12:54 -07:00
a5805e08c8 chore(release): 3.20.5 2025-10-01 13:53:20 -07:00
791fac54cd refactor: remove deprecated BrainyData class completely
Removes all traces of BrainyData to prevent user confusion:
- Renamed brainyDataInterface.ts to brainyInterface.ts for clarity
- Updated all imports and type references across 5 files
- Removed BrainyData compiled artifacts (handled by clean build)
- Added deprecation notice to CHANGELOG with migration guide

BrainyData was never part of official Brainy 3.0 API but existed as
legacy compiled artifacts. Users mistakenly imported it thinking neural
API was missing, when it exists in modern Brainy class.

All users should migrate to: new Brainy() with await brain.init()
Neural API available via: brain.neural().visualize() etc.

Resolves confusion reported by Brain Studio team.
2025-09-30 16:04:00 -07:00
e78e88f8d5 chore(release): 3.20.2 2025-09-30 12:55:50 -07:00
bc5aa37dd0 fix: CLI syntax error and add conversation remove command
- Fixed bin/brainy.js to import compiled TypeScript CLI
- Added conversation remove command to clean up MCP setup
- Fixed tsconfig.json to include CLI in compilation
- Fixed package.json import in CLI using readFileSync
- Fixed storage config structure in conversation setup

Fixes the 'Unexpected identifier as' syntax error when running
brainy conversation setup globally.

Version: 3.19.1
2025-09-29 15:58:25 -07:00
ced639cab1 feat: add infinite agent memory with MCP integration
Implement comprehensive conversation management system enabling AI agents
like Claude Code to maintain infinite context and history. Provides semantic
search, smart context retrieval, and automatic artifact linking using Brainy's
existing Triple Intelligence infrastructure.

Core Features:
- ConversationManager API for message storage and retrieval
- MCP protocol integration with 6 tools for Claude Code
- Context ranking using semantic, temporal, and graph scoring
- Neural clustering for theme discovery and deduplication
- Virtual filesystem integration for code artifact linking
- CLI commands for setup and management

Zero new infrastructure required - uses existing Brainy features:
- Storage via brain.add() with NounType.Message
- Relationships via brain.relate() with VerbType.Precedes
- Search via brain.find() with Triple Intelligence
- Clustering via brain.neural()
- Artifacts via brain.vfs()

One-command setup: brainy conversation setup

Version: 3.19.0
2025-09-29 15:37:11 -07:00
cfd74adcb3 feat: fix critical storage and VFS sharding bugs for production scale
- Fix FileSystemStorage sharding: getAllShardedFiles() for proper directory traversal
- Fix getNode() metadata: was filtering out metadata causing VFS entity failures
- Add production-scale streaming pagination for millions of entities
- Optimize sharding threshold from 1000 to 100 files for better performance
- Fix VFS readdir() and tree operations for complete directory structure support
- Add verb count tracking and persistence for performance optimizations

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 17:01:56 -07:00
0e972525b6 fix: complete VFS root directory and Contains relationship fixes
- Fix root directory metadata to always have vfsType: 'directory'
- Add compatibility layer for malformed entity metadata
- Ensure Contains relationships are maintained for all file operations
- Fix resolvePath() special case for root directory
- Add comprehensive documentation for VFS troubleshooting
- Document proper usage of standard NounType and VerbType enums

Resolves critical VFS bugs reported by brain-cloud team
2025-09-26 15:45:13 -07:00
4c208ef78d release: version 3.0.1
Brainy 3.0 Production Release - World's first Triple Intelligence database

- Complete API redesign with add(), find(), update(), delete(), relate()
- Unified vector, graph, and document search in one API
- Zero-config validation system with production-ready type safety
- Advanced neural clustering with comprehensive algorithms
- Built-in augmentation system (cache, display, metrics)
- 100+ comprehensive tests covering all APIs and edge cases

BREAKING CHANGES: All 2.x APIs replaced with new 3.0 syntax
2025-09-15 11:11:52 -07:00
62c6491872 chore(release): 2.14.0 2025-09-02 10:01:48 -07:00
184d5dcf34 feat: implement clean embedding architecture with Q8/FP32 precision control
- Unified embedding system with single EmbeddingManager
- Q8 model support with 75% smaller footprint (23MB vs 90MB)
- Intelligent precision auto-selection based on environment
- Clean cached embeddings with TTL and memory management
- Zero-config setup with smart defaults
- Complete storage structure documentation
- Removed legacy worker and hybrid managers
- Streamlined model configuration and precision management
2025-09-02 10:00:52 -07:00
5f862bad98 feat: implement zero-config system with Node.js 22 compatibility
- Add comprehensive zero-config preset system (production, development, minimal)
- Implement intelligent auto-configuration for models and storage
- Add Node.js version enforcement for ONNX Runtime stability
- Force single-threaded ONNX operations to prevent V8 HandleScope crashes
- Create extensible configuration architecture
- Add 14 distributed system presets for enterprise deployments
- Include detailed documentation and migration guides

BREAKING CHANGE: Now requires Node.js 22.x LTS for optimal stability
2025-08-29 15:39:07 -07:00