@soulcraft/brainy 0.9.21 → 0.9.23
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.
- package/README.md +3 -113
- package/dist/utils/version.d.ts +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](CONTRIBUTING.md)
|
|
9
|
-
[](https://www.npmjs.com/package/@soulcraft/brainy)
|
|
10
10
|
|
|
11
11
|
[//]: # ([](https://github.com/sodal-project/cartographer))
|
|
12
12
|
|
|
@@ -280,43 +280,6 @@ Brainy's pipeline is designed to handle streaming data efficiently:
|
|
|
280
280
|
- Automatic thread management based on environment capabilities
|
|
281
281
|
- Example: `executeTypedPipeline(augmentations, method, args, { mode: ExecutionMode.THREADED })`
|
|
282
282
|
|
|
283
|
-
### Build System
|
|
284
|
-
|
|
285
|
-
Brainy uses a modern build system that optimizes for both Node.js and browser environments:
|
|
286
|
-
|
|
287
|
-
1. **ES Modules**
|
|
288
|
-
- Built as ES modules for maximum compatibility
|
|
289
|
-
- Works in modern browsers and Node.js environments
|
|
290
|
-
- Separate optimized builds for browser and Node.js
|
|
291
|
-
|
|
292
|
-
2. **Environment-Specific Builds**
|
|
293
|
-
- **Node.js Build**: Optimized for server environments with full functionality
|
|
294
|
-
- **Browser Build**: Optimized for browser environments with reduced bundle size
|
|
295
|
-
- **CLI Build**: Separate build for command-line interface functionality
|
|
296
|
-
- Conditional exports in package.json for automatic environment detection
|
|
297
|
-
|
|
298
|
-
3. **Modular Architecture**
|
|
299
|
-
- Core functionality and CLI are built separately
|
|
300
|
-
- CLI (4MB) is only included when explicitly imported or used from command line
|
|
301
|
-
- Reduced bundle size for browser and Node.js applications
|
|
302
|
-
|
|
303
|
-
4. **Environment Detection**
|
|
304
|
-
- Automatically detects whether it's running in a browser or Node.js
|
|
305
|
-
- Loads appropriate dependencies and functionality based on the environment
|
|
306
|
-
- Provides consistent API across all environments
|
|
307
|
-
|
|
308
|
-
5. **TypeScript**
|
|
309
|
-
- Written in TypeScript for type safety and better developer experience
|
|
310
|
-
- Generates type definitions for TypeScript users
|
|
311
|
-
- Compiled to ES2020 for modern JavaScript environments
|
|
312
|
-
|
|
313
|
-
6. **Build Scripts**
|
|
314
|
-
- `npm run build`: Builds the core library without CLI
|
|
315
|
-
- `npm run build:browser`: Builds the browser-optimized version
|
|
316
|
-
- `npm run build:cli`: Builds the CLI version (only needed for CLI usage)
|
|
317
|
-
- `npm run prepare:cli`: Builds the CLI for command-line usage
|
|
318
|
-
- `npm run demo`: Builds both core library and browser versions and starts a demo server
|
|
319
|
-
- GitHub Actions workflow: Automatically deploys the demo directory to GitHub Pages when pushing to the main branch
|
|
320
283
|
|
|
321
284
|
### Running the Pipeline
|
|
322
285
|
|
|
@@ -453,10 +416,6 @@ brainy visualize
|
|
|
453
416
|
brainy visualize --root <id> --depth 3
|
|
454
417
|
```
|
|
455
418
|
|
|
456
|
-
### Publishing the CLI Package
|
|
457
|
-
|
|
458
|
-
If you need to publish the CLI package to npm, please refer to the [CLI Publishing Guide](docs/publishing-cli.md) for
|
|
459
|
-
detailed instructions.
|
|
460
419
|
|
|
461
420
|
### Using the CLI in Your Code
|
|
462
421
|
|
|
@@ -473,15 +432,6 @@ import '@soulcraft/brainy/cli'
|
|
|
473
432
|
This will only build and load the CLI when you explicitly import it, keeping your bundle size small when you don't need
|
|
474
433
|
the CLI.
|
|
475
434
|
|
|
476
|
-
### Development Usage
|
|
477
|
-
|
|
478
|
-
```bash
|
|
479
|
-
# Run the CLI directly from the source
|
|
480
|
-
npm run cli help
|
|
481
|
-
|
|
482
|
-
# Generate a random graph for testing
|
|
483
|
-
npm run cli generate-random-graph --noun-count 20 --verb-count 40
|
|
484
|
-
```
|
|
485
435
|
|
|
486
436
|
### Available Commands
|
|
487
437
|
|
|
@@ -1303,74 +1253,14 @@ comprehensive [Scaling Strategy](scalingStrategy.md) document.
|
|
|
1303
1253
|
|
|
1304
1254
|
- Node.js >= 24.0.0
|
|
1305
1255
|
|
|
1306
|
-
### Node.js 24 Optimizations
|
|
1307
|
-
|
|
1308
|
-
Brainy takes advantage of several optimizations available in Node.js 24:
|
|
1309
|
-
|
|
1310
|
-
1. **Improved Worker Threads Performance**: The multithreading system has been completely rewritten to leverage Node.js
|
|
1311
|
-
24's enhanced Worker Threads API, resulting in better performance for compute-intensive operations like embedding
|
|
1312
|
-
generation and vector similarity calculations.
|
|
1313
|
-
|
|
1314
|
-
2. **Worker Pool Management**: A sophisticated worker pool system reuses worker threads to minimize the overhead of
|
|
1315
|
-
creating and destroying threads, leading to more efficient resource utilization.
|
|
1316
|
-
|
|
1317
|
-
3. **Dynamic Module Imports**: Uses the new `node:` protocol prefix for importing core modules, which provides better
|
|
1318
|
-
performance and more reliable module resolution.
|
|
1319
|
-
|
|
1320
|
-
4. **ES Modules Optimizations**: Takes advantage of Node.js 24's improved ESM implementation for faster module loading
|
|
1321
|
-
and execution.
|
|
1322
|
-
|
|
1323
|
-
5. **Enhanced Error Handling**: Implements more robust error handling patterns available in Node.js 24 for better
|
|
1324
|
-
stability and debugging.
|
|
1325
|
-
|
|
1326
|
-
These optimizations are particularly beneficial for:
|
|
1327
|
-
|
|
1328
|
-
- Large-scale vector operations
|
|
1329
|
-
- Batch processing of embeddings
|
|
1330
|
-
- Real-time data processing pipelines
|
|
1331
|
-
- High-throughput search operations
|
|
1332
1256
|
|
|
1333
1257
|
## Contributing
|
|
1334
1258
|
|
|
1335
1259
|
For detailed contribution guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
1336
1260
|
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
### Reporting Issues
|
|
1340
|
-
|
|
1341
|
-
We use GitHub issues to track bugs and feature requests. Please use the provided issue templates when creating a new
|
|
1342
|
-
issue:
|
|
1343
|
-
|
|
1344
|
-
- [Bug Report Template](.github/ISSUE_TEMPLATE/bug_report.md)
|
|
1345
|
-
- [Feature Request Template](.github/ISSUE_TEMPLATE/feature_request.md)
|
|
1346
|
-
|
|
1347
|
-
### Code Style Guidelines
|
|
1261
|
+
For developer documentation, including building, testing, and publishing instructions, please see [DEVELOPERS.md](DEVELOPERS.md).
|
|
1348
1262
|
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
1. **No Semicolons**: All code in the project should avoid using semicolons wherever possible
|
|
1352
|
-
2. **Formatting**: The project uses Prettier for code formatting
|
|
1353
|
-
3. **Linting**: ESLint is configured with specific rules for the project
|
|
1354
|
-
4. **TypeScript Configuration**: Strict type checking enabled with ES2020 target
|
|
1355
|
-
5. **Commit Messages**: Use the imperative mood and keep the first line concise
|
|
1356
|
-
|
|
1357
|
-
### Development Workflow
|
|
1358
|
-
|
|
1359
|
-
1. Fork the repository
|
|
1360
|
-
2. Create a feature branch
|
|
1361
|
-
3. Make your changes
|
|
1362
|
-
4. Submit a pull request
|
|
1363
|
-
|
|
1364
|
-
### Badge Maintenance
|
|
1365
|
-
|
|
1366
|
-
The README badges are automatically updated during the build process:
|
|
1367
|
-
|
|
1368
|
-
1. **npm Version Badge**: The npm version badge is automatically updated to match the version in package.json when:
|
|
1369
|
-
- Running `npm run build` (via the prebuild script)
|
|
1370
|
-
- Running `npm version` commands (patch, minor, major)
|
|
1371
|
-
- Manually running `node scripts/generate-version.js`
|
|
1372
|
-
|
|
1373
|
-
This ensures that the badge always reflects the current version in package.json, even before publishing to npm.
|
|
1263
|
+
We have a [Code of Conduct](CODE_OF_CONDUCT.md) that all contributors are expected to follow.
|
|
1374
1264
|
|
|
1375
1265
|
## License
|
|
1376
1266
|
|
package/dist/utils/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.23",
|
|
4
4
|
"description": "A vector graph database using HNSW indexing with Origin Private File System storage",
|
|
5
5
|
"main": "dist/unified.js",
|
|
6
6
|
"module": "dist/unified.js",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"deploy:cloud:cloudflare": "cd cloud-wrapper && npm run build && npm run deploy:cloudflare",
|
|
51
51
|
"deploy:cloud": "echo 'Please use one of the following commands to deploy to a specific cloud provider:' && echo ' npm run deploy:cloud:aws' && echo ' npm run deploy:cloud:gcp' && echo ' npm run deploy:cloud:cloudflare'",
|
|
52
52
|
"postinstall": "echo 'Note: If you encounter dependency conflicts with TensorFlow.js packages, please use: npm install --legacy-peer-deps'",
|
|
53
|
-
"dry-run": "npm pack --dry-run"
|
|
53
|
+
"dry-run": "npm pack --dry-run",
|
|
54
|
+
"test-cli": "node scripts/test-cli-locally.js"
|
|
54
55
|
},
|
|
55
56
|
"keywords": [
|
|
56
57
|
"vector-database",
|