Commit graph

81 commits

Author SHA1 Message Date
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
2a1db55a1d chore(release): 0.45.0 [skip ci] 2025-08-05 17:29:17 -07:00
3b1716fcdf chore(release): 0.44.0 [skip ci] 2025-08-05 16:22:14 -07:00
e44d9e39f9 chore(release): 0.43.0 [skip ci] 2025-08-05 16:10:18 -07:00
79c9bf1183 chore(release): 0.41.0 [skip ci] 2025-08-05 07:29:40 -07:00
0798de52e6 fix(security): resolve critical vulnerability in form-data dependency
- Add npm overrides to force form-data version 4.0.4 or higher
- Fixes GitHub security advisory GHSA-fjxv-7rqg-78g4
- Vulnerability was in transitive dependency via TensorFlow.js
- No functionality changes, all tests passing
2025-08-05 07:28:10 -07:00
415e823004 chore(release): 0.40.0 [skip ci] 2025-08-04 20:01:30 -07:00
649e452ff9 chore(release): 0.39.0 [skip ci] 2025-08-04 14:56:27 -07:00
91cf1785d9 chore(release): 0.38.0 [skip ci] 2025-08-04 12:20:06 -07:00
2cf04b239f chore(release): 0.37.0 [skip ci] 2025-08-03 17:34:36 -07:00
6d516df781 chore(release): 0.36.0 [skip ci] 2025-08-03 10:48:41 -07:00
3892399bab chore(release): 0.35.0 [skip ci] 2025-08-02 16:08:14 -07:00
5f9e807952 **feat(docs): add comprehensive architecture documentation for Brainy**
- **Documentation Additions**:
  - Created `brainy_architecture_diagram.md` to detail Brainy's architecture using diagrams and structured descriptions:
    - Added overviews of the system, core architecture, and augmentation pipeline.
    - Defined data models, graph structures, storage architecture, and performance optimizations.
    - Explained vector search engine design, HNSW index structure, and usage flow examples.
  - Developed `brainy_architecture_visual.md` to complement the architecture with visual aids in Mermaid.js:
    - Provided detailed flowcharts, mind maps, and sequence diagrams for system components and data flow.

- **Purpose**:
  - Provide in-depth technical insights into Brainy's architecture for developers and stakeholders.
  - Enhance understanding of the system's core design principles with easy-to-follow diagrams and examples.
2025-08-02 16:05:48 -07:00
af81eab5f3 chore(release): 0.34.0 [skip ci] 2025-08-01 18:32:24 -07:00
90cbccb1da chore(release): 0.33.0 [skip ci] 2025-08-01 08:57:54 -07:00
81d32e0662 chore(release): 0.32.0 [skip ci] 2025-07-31 17:58:11 -07:00
34e8cb4b19 chore(release): 0.31.0 [skip ci] 2025-07-31 14:28:04 -07:00
927dc94edb chore(release): 0.30.0 [skip ci] 2025-07-31 14:04:52 -07:00
d5f53d93ff chore(release): 0.29.0 [skip ci] 2025-07-31 14:03:15 -07:00
7ea47be868 chore(release): 0.28.0 [skip ci] 2025-07-31 13:39:07 -07:00
04842d866c chore(release): 0.27.1 [skip ci] 2025-07-31 13:22:45 -07:00
fda949aed2 chore(versioning): switch to standard-version for automated changelog generation
This change implements standard-version for versioning and changelog management:
- Adds standard-version as a dev dependency
- Updates package.json scripts to use standard-version
- Creates .versionrc.json configuration file
- Updates CHANGELOG.md with instructions for conventional commits
- Removes obsolete manual changelog update script
2025-07-31 13:15:04 -07:00
6cb26379a5 Merge remote-tracking branch 'origin/main' 2025-07-31 07:35:21 -07:00
195951e039 **chore(dependencies): remove unused dependencies**
Remove `@modelcontextprotocol/server-sequential-thinking` and its nested dependencies from `devDependencies` in `package-lock.json` as they are no longer required for the project. This reduces the overall package size and improves maintenance.
2025-07-30 14:39:13 -07:00
3c431251f8 0.27.0 2025-07-30 13:32:54 -07:00
0f2075ede4 0.26.0 2025-07-30 11:38:40 -07:00
b8847812c9 0.25.0 2025-07-28 16:25:48 -07:00
afeeb5ff28 0.24.0 2025-07-28 16:25:47 -07:00
4bb62fa386 0.23.0 2025-07-28 16:25:46 -07:00
e6d567abad 0.22.0 2025-07-28 16:25:45 -07:00
7ede52dc35 0.21.0 2025-07-28 16:25:44 -07:00
ca8774c5e1 0.20.0 2025-07-28 16:25:41 -07:00
c770b5f90e 0.19.0 2025-07-28 16:25:20 -07:00
94c88e128c **docs: remove outdated statistics-related documentation and add standards**
- **Removed Files**:
  - Deleted outdated statistics documentation files (`statistics.md`, `statistics-flush-solution.md`, `statistics-summary.md`) to clean up the repository and avoid confusion.

- **Added Standards**:
  - Introduced `DOCUMENTATION_STANDARDS.md` to outline naming conventions and troubleshooting practices for more consistent and maintainable project documentation.

- **Tests**:
  - Added a new test file `edge-cases.test.ts` to verify handling of edge cases, ensuring robust behavior against boundary values and invalid inputs.

**Purpose**: Cleans up deprecated documentation while introducing concrete standards for maintaining and updating documentation. Enhances test coverage for unusual or boundary inputs, improving overall system resilience.
2025-07-28 16:00:05 -07:00
7f082df6a3 **test(api): add integration tests for API endpoints and core functionality**
- **Integration Tests**:
  - Introduced `api-integration.test.ts` to validate API functionality:
    - Verifies text insertion, vector embedding generation, and search operations.
    - Confirms HNSW index correctness for vector similarity search.
    - Ensures no dimensional mismatches in embeddings.

- **Test Server**:
  - Added test server utilizing Express for endpoint simulation (`/insert` and `/search/text`).

- **Dependencies**:
  - Introduced `express` and `node-fetch` as new dependencies for testing purposes.

- **Vitest Fix**:
  - Updated `vitest.config.ts` to resolve the `process.memoryUsage` error by setting `logHeapUsage: false`.

- **Package Updates**:
  - Modified `package-lock.json` to include newly added dependencies and updates.

**Purpose**: Guarantees the stability of core API endpoints and vector-related functionality, ensuring reliable behavior for end-to-end scenarios.
2025-07-28 10:04:45 -07:00
5d607068a8 0.18.0 2025-07-23 12:39:39 -07:00
95142d32fa 0.17.0 2025-07-22 16:04:34 -07:00
2ec3e4ea23 0.16.0 2025-07-22 10:43:34 -07:00
69a3c8504a 0.15.0 2025-07-21 14:00:40 -07:00
8e58c8d1cc 0.14.0 2025-07-18 12:01:38 -07:00
b16b9caccb 0.13.0 2025-07-18 10:41:24 -07:00
491d1c1b89 0.12.0 2025-07-16 13:51:37 -07:00
77edae17c7 **chore: update dependencies in package-lock.json**
- **Added Dependencies**:
  - Introduced `@vitest/coverage-v8` for enhanced test coverage reporting.
  - Added various dev dependencies such as `@ampproject/remapping`, `@babel/parser`, `@babel/types`, and `ast-v8-to-istanbul` to support improved source mapping and code coverage analysis.
  - Included modules such as `html-escaper`, `path-scurry`, and `istanbul-lib-coverage` to align with updated testing and utility requirements.

- **Purpose**:
  - This update ensures compatibility with modern testing tools, facilitates advanced debugging, and supports enhanced test coverage capabilities. It also updates metadata for package resolutions.
2025-07-16 11:40:24 -07:00
d7150dbc30 **chore: streamline documentation, refine shims, and update dependencies**
- **Documentation Updates**:
  - Simplified server functionality details in `README.md`, removing cloud-specific deployment sections and focusing on core features for broader usability.

- **Shim Enhancements**:
  - Improved `util` shim in `rollup.config.js` to include `TextEncoder`/`TextDecoder` support and enhanced `types` checks (e.g., `isFloat32Array`, `isUint8Array`).

- **Dependency Updates**:
  - Added new dev dependencies (`@vitest/ui`, `jsdom`, `happy-dom`).
  - Updated `package-lock.json` with additional dependency resolutions and metadata for better compatibility and maintainability.

This commit aligns documentation with current project focus, enhances cross-platform support via refined shims, and ensures updated dependencies for development and testing environments.
2025-07-15 11:53:26 -07:00
c68515dc92 0.11.0 2025-07-11 12:15:28 -07:00
f0db5b471f **feat(tests): add tests for TextEncoder, TensorFlow.js, and fallback mechanisms**
- Introduced `test-fallback-function.js` and `test-fallback-simple.js` to validate `executeInThread` fallback functionality with both named and anonymous compute-intensive functions.
- Added `test-tensorflow-textencoder.js` for TensorFlow.js and TextEncoder tests in a Node.js environment.
- Created `test-tensorflow-textencoder.html` for browser-based TensorFlow.js and TextEncoder tests.
- Implemented cross-environment test support in `cli-package/src/test-tensorflow-textencoder.ts` for CLI functionality.
- Enhanced `src/utils/embedding.ts`, `textEncoding.ts`, and `brainy-wrapper.js` to include updated global `TextEncoder` and `TextDecoder` utilities for compatibility and worker improvements.
- Standardized and expanded utility methods in `PlatformNode` for broader support, including `isFloat32Array` and `isTypedArray` checks.
- Updated Node.js requirement to `>= 24.4.0` across documentation and configuration files for compatibility improvements.

This update introduces comprehensive testing for fallback mechanisms, TensorFlow.js, and TextEncoder across multiple environments, ensuring robustness and compatibility.
2025-07-11 11:11:56 -07:00