@soulcraft/brainy 0.9.5 → 0.9.7
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 +32 -15
- 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 -4
package/README.md
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](CONTRIBUTING.md)
|
|
9
|
-
[](https://www.npmjs.com/package/@soulcraft/brainy)
|
|
10
|
+
|
|
11
|
+
[//]: # ([](https://github.com/sodal-project/cartographer))
|
|
10
12
|
|
|
11
13
|
**A powerful graph & vector data platform for AI applications across any environment**
|
|
12
14
|
|
|
@@ -300,7 +302,7 @@ Brainy uses a modern build system that optimizes for both Node.js and browser en
|
|
|
300
302
|
- `npm run build:browser`: Builds the browser-optimized version
|
|
301
303
|
- `npm run build:all`: Builds both versions
|
|
302
304
|
- `npm run demo`: Builds all versions and starts a demo server
|
|
303
|
-
-
|
|
305
|
+
- GitHub Actions workflow: Automatically deploys the demo directory to GitHub Pages when pushing to the main branch
|
|
304
306
|
|
|
305
307
|
### Running the Pipeline
|
|
306
308
|
|
|
@@ -575,10 +577,10 @@ await db.deleteVerb(verbId)
|
|
|
575
577
|
### Embedding
|
|
576
578
|
|
|
577
579
|
```typescript
|
|
578
|
-
import {
|
|
579
|
-
BrainyData,
|
|
580
|
-
createTensorFlowEmbeddingFunction,
|
|
581
|
-
createThreadedEmbeddingFunction
|
|
580
|
+
import {
|
|
581
|
+
BrainyData,
|
|
582
|
+
createTensorFlowEmbeddingFunction,
|
|
583
|
+
createThreadedEmbeddingFunction
|
|
582
584
|
} from '@soulcraft/brainy'
|
|
583
585
|
|
|
584
586
|
// Use the standard TensorFlow Universal Sentence Encoder embedding function
|
|
@@ -599,7 +601,9 @@ await threadedDb.init()
|
|
|
599
601
|
const vector = await db.embed("Some text to convert to a vector")
|
|
600
602
|
```
|
|
601
603
|
|
|
602
|
-
The threaded embedding function runs in a separate thread (Web Worker in browsers, Worker Thread in Node.js) to improve
|
|
604
|
+
The threaded embedding function runs in a separate thread (Web Worker in browsers, Worker Thread in Node.js) to improve
|
|
605
|
+
performance, especially for CPU-intensive embedding operations. It automatically falls back to the main thread if
|
|
606
|
+
threading is not available in the current environment.
|
|
603
607
|
|
|
604
608
|
### Performance Tuning
|
|
605
609
|
|
|
@@ -1019,14 +1023,14 @@ the [Cloud Wrapper README](cloud-wrapper/README.md) for detailed configuration i
|
|
|
1019
1023
|
|
|
1020
1024
|
The repository includes a comprehensive demo that showcases Brainy's main features:
|
|
1021
1025
|
|
|
1022
|
-
- `
|
|
1026
|
+
- `demo/index.html` - A single demo page with animations demonstrating Brainy's features.
|
|
1023
1027
|
- **[Try the live demo](https://soulcraft-research.github.io/brainy/demo/index.html)** - Check out the
|
|
1024
1028
|
interactive demo on
|
|
1025
1029
|
GitHub Pages
|
|
1026
1030
|
- 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
|
-
|
|
1031
|
+
- To deploy your own version to GitHub Pages, use the GitHub Actions workflow in
|
|
1032
|
+
`.github/workflows/deploy-demo.yml`,
|
|
1033
|
+
which automatically deploys when pushing to the main branch or can be manually triggered
|
|
1030
1034
|
- To use a custom domain (like www.soulcraft.com):
|
|
1031
1035
|
1. A CNAME file is already included in the demo directory
|
|
1032
1036
|
2. In your GitHub repository settings, go to Pages > Custom domain and enter your domain
|
|
@@ -1216,7 +1220,19 @@ const id = await db.addToBoth('Deep learning is a subset of machine learning', {
|
|
|
1216
1220
|
await db.shutDown()
|
|
1217
1221
|
```
|
|
1218
1222
|
|
|
1219
|
-
|
|
1223
|
+
---
|
|
1224
|
+
|
|
1225
|
+
## 📈 Scaling Strategy
|
|
1226
|
+
|
|
1227
|
+
Brainy is designed to handle datasets of various sizes, from small collections to large-scale deployments. For
|
|
1228
|
+
terabyte-scale data that can't fit entirely in memory, we provide several approaches:
|
|
1229
|
+
|
|
1230
|
+
- **Disk-Based HNSW**: Modified implementations using intelligent caching and partial loading
|
|
1231
|
+
- **Distributed HNSW**: Sharding and partitioning across multiple machines
|
|
1232
|
+
- **Hybrid Solutions**: Combining quantization techniques with multi-tier architectures
|
|
1233
|
+
|
|
1234
|
+
For detailed information on how to scale Brainy for large datasets, see our
|
|
1235
|
+
comprehensive [Scaling Strategy](scalingStrategy.md) document.
|
|
1220
1236
|
|
|
1221
1237
|
## Requirements
|
|
1222
1238
|
|
|
@@ -1230,7 +1246,9 @@ We have a [Code of Conduct](CODE_OF_CONDUCT.md) that all contributors are expect
|
|
|
1230
1246
|
|
|
1231
1247
|
### Reporting Issues
|
|
1232
1248
|
|
|
1233
|
-
We use GitHub issues to track bugs and feature requests. Please use the provided issue templates when creating a new
|
|
1249
|
+
We use GitHub issues to track bugs and feature requests. Please use the provided issue templates when creating a new
|
|
1250
|
+
issue:
|
|
1251
|
+
|
|
1234
1252
|
- [Bug Report Template](.github/ISSUE_TEMPLATE/bug_report.md)
|
|
1235
1253
|
- [Feature Request Template](.github/ISSUE_TEMPLATE/feature_request.md)
|
|
1236
1254
|
|
|
@@ -1249,8 +1267,7 @@ Brainy follows a specific code style to maintain consistency throughout the code
|
|
|
1249
1267
|
1. Fork the repository
|
|
1250
1268
|
2. Create a feature branch
|
|
1251
1269
|
3. Make your changes
|
|
1252
|
-
4.
|
|
1253
|
-
5. Submit a pull request
|
|
1270
|
+
4. Submit a pull request
|
|
1254
1271
|
|
|
1255
1272
|
## License
|
|
1256
1273
|
|