@soulcraft/brainy 0.9.5 → 0.9.6
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 +25 -12
- package/dist/brainy.js +428 -224
- package/dist/brainy.min.js +987 -987
- package/dist/unified.js +40 -31
- package/dist/unified.min.js +1 -1
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/workerUtils.d.ts +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -300,7 +300,7 @@ Brainy uses a modern build system that optimizes for both Node.js and browser en
|
|
|
300
300
|
- `npm run build:browser`: Builds the browser-optimized version
|
|
301
301
|
- `npm run build:all`: Builds both versions
|
|
302
302
|
- `npm run demo`: Builds all versions and starts a demo server
|
|
303
|
-
-
|
|
303
|
+
- GitHub Actions workflow: Automatically deploys the demo directory to GitHub Pages when pushing to the main branch
|
|
304
304
|
|
|
305
305
|
### Running the Pipeline
|
|
306
306
|
|
|
@@ -575,10 +575,10 @@ await db.deleteVerb(verbId)
|
|
|
575
575
|
### Embedding
|
|
576
576
|
|
|
577
577
|
```typescript
|
|
578
|
-
import {
|
|
579
|
-
BrainyData,
|
|
580
|
-
createTensorFlowEmbeddingFunction,
|
|
581
|
-
createThreadedEmbeddingFunction
|
|
578
|
+
import {
|
|
579
|
+
BrainyData,
|
|
580
|
+
createTensorFlowEmbeddingFunction,
|
|
581
|
+
createThreadedEmbeddingFunction
|
|
582
582
|
} from '@soulcraft/brainy'
|
|
583
583
|
|
|
584
584
|
// Use the standard TensorFlow Universal Sentence Encoder embedding function
|
|
@@ -599,7 +599,9 @@ await threadedDb.init()
|
|
|
599
599
|
const vector = await db.embed("Some text to convert to a vector")
|
|
600
600
|
```
|
|
601
601
|
|
|
602
|
-
The threaded embedding function runs in a separate thread (Web Worker in browsers, Worker Thread in Node.js) to improve
|
|
602
|
+
The threaded embedding function runs in a separate thread (Web Worker in browsers, Worker Thread in Node.js) to improve
|
|
603
|
+
performance, especially for CPU-intensive embedding operations. It automatically falls back to the main thread if
|
|
604
|
+
threading is not available in the current environment.
|
|
603
605
|
|
|
604
606
|
### Performance Tuning
|
|
605
607
|
|
|
@@ -1019,14 +1021,13 @@ the [Cloud Wrapper README](cloud-wrapper/README.md) for detailed configuration i
|
|
|
1019
1021
|
|
|
1020
1022
|
The repository includes a comprehensive demo that showcases Brainy's main features:
|
|
1021
1023
|
|
|
1022
|
-
- `
|
|
1024
|
+
- `demo/index.html` - A single demo page with animations demonstrating Brainy's features.
|
|
1023
1025
|
- **[Try the live demo](https://soulcraft-research.github.io/brainy/demo/index.html)** - Check out the
|
|
1024
1026
|
interactive demo on
|
|
1025
1027
|
GitHub Pages
|
|
1026
1028
|
- Or run it locally with `npm run demo` (see [demo instructions](README.demo.md) for details)
|
|
1027
|
-
- To deploy your own version to GitHub Pages,
|
|
1028
|
-
|
|
1029
|
-
`.github/workflows/deploy-demo.yml`
|
|
1029
|
+
- To deploy your own version to GitHub Pages, use the GitHub Actions workflow in `.github/workflows/deploy-demo.yml`,
|
|
1030
|
+
which automatically deploys when pushing to the main branch or can be manually triggered
|
|
1030
1031
|
- To use a custom domain (like www.soulcraft.com):
|
|
1031
1032
|
1. A CNAME file is already included in the demo directory
|
|
1032
1033
|
2. In your GitHub repository settings, go to Pages > Custom domain and enter your domain
|
|
@@ -1216,7 +1217,17 @@ const id = await db.addToBoth('Deep learning is a subset of machine learning', {
|
|
|
1216
1217
|
await db.shutDown()
|
|
1217
1218
|
```
|
|
1218
1219
|
|
|
1219
|
-
|
|
1220
|
+
---
|
|
1221
|
+
|
|
1222
|
+
## 📈 Scaling Strategy
|
|
1223
|
+
|
|
1224
|
+
Brainy is designed to handle datasets of various sizes, from small collections to large-scale deployments. For terabyte-scale data that can't fit entirely in memory, we provide several approaches:
|
|
1225
|
+
|
|
1226
|
+
- **Disk-Based HNSW**: Modified implementations using intelligent caching and partial loading
|
|
1227
|
+
- **Distributed HNSW**: Sharding and partitioning across multiple machines
|
|
1228
|
+
- **Hybrid Solutions**: Combining quantization techniques with multi-tier architectures
|
|
1229
|
+
|
|
1230
|
+
For detailed information on how to scale Brainy for large datasets, see our comprehensive [Scaling Strategy](scalingStrategy.md) document.
|
|
1220
1231
|
|
|
1221
1232
|
## Requirements
|
|
1222
1233
|
|
|
@@ -1230,7 +1241,9 @@ We have a [Code of Conduct](CODE_OF_CONDUCT.md) that all contributors are expect
|
|
|
1230
1241
|
|
|
1231
1242
|
### Reporting Issues
|
|
1232
1243
|
|
|
1233
|
-
We use GitHub issues to track bugs and feature requests. Please use the provided issue templates when creating a new
|
|
1244
|
+
We use GitHub issues to track bugs and feature requests. Please use the provided issue templates when creating a new
|
|
1245
|
+
issue:
|
|
1246
|
+
|
|
1234
1247
|
- [Bug Report Template](.github/ISSUE_TEMPLATE/bug_report.md)
|
|
1235
1248
|
- [Feature Request Template](.github/ISSUE_TEMPLATE/feature_request.md)
|
|
1236
1249
|
|