@soulcraft/cor 3.0.0 → 3.0.2
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 -11
- package/dist/graph/NativeGraphAdjacencyIndex.js +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -24,12 +24,13 @@
|
|
|
24
24
|
<a href="#feature-tour">Features</a> ·
|
|
25
25
|
<a href="#one-box-hundreds-of-brains--or-one-brain-at-billion-scale">Scale</a> ·
|
|
26
26
|
<a href="#measured-not-promised">Benchmarks</a> ·
|
|
27
|
+
<a href="#licensing-that-never-breaks-your-app">Licensing</a> ·
|
|
27
28
|
<a href="#learn-more">Docs</a>
|
|
28
29
|
</p>
|
|
29
30
|
|
|
30
31
|
---
|
|
31
32
|
|
|
32
|
-
[Brainy](https://github.com/soulcraftlabs/brainy) is the open-source knowledge database — vectors, relationships, metadata, and full-text in one MIT-licensed engine. Cor swaps compiled Rust in under every hot path. **No code changes. No configuration.**
|
|
33
|
+
[Brainy](https://github.com/soulcraftlabs/brainy) is the open-source knowledge database — vectors, relationships, metadata, and full-text in one MIT-licensed engine. Cor swaps compiled Rust in under every hot path. **No code changes. No configuration.** Install it and brainy (≥ 8.0.9) auto-detects it — loudly: activation prints `Providers: 10/10 native`, a missing license warns by name, and a broken install makes `init()` throw rather than quietly run slow. **Remove it and everything keeps working** on the same files, at open-source speed. That's the contract in both directions.
|
|
33
34
|
|
|
34
35
|
| Brainy runs it as | Cor replaces it with | You get |
|
|
35
36
|
|---|---|---|
|
|
@@ -48,28 +49,41 @@ npm install @soulcraft/cor # or: bun add @soulcraft/cor
|
|
|
48
49
|
```
|
|
49
50
|
|
|
50
51
|
```typescript
|
|
51
|
-
import { Brainy, NounType } from '@soulcraft/brainy'
|
|
52
|
+
import { Brainy, NounType, VerbType } from '@soulcraft/brainy'
|
|
52
53
|
|
|
53
54
|
const brain = new Brainy({ storage: { type: 'filesystem', path: './data' } })
|
|
54
|
-
await brain.init() // cor
|
|
55
|
+
await brain.init() // cor auto-detected (brainy ≥ 8.0.9) — look for "Providers: 10/10 native"
|
|
55
56
|
|
|
56
|
-
await brain.add({
|
|
57
|
+
const cor = await brain.add({
|
|
58
|
+
data: 'Cor swaps compiled Rust in under every Brainy hot path',
|
|
59
|
+
type: NounType.Concept,
|
|
60
|
+
subtype: 'library',
|
|
61
|
+
metadata: { layer: 'native', year: 2026 },
|
|
62
|
+
})
|
|
63
|
+
const brainy = await brain.add({
|
|
64
|
+
data: 'Brainy is the open-source knowledge database',
|
|
65
|
+
type: NounType.Concept,
|
|
66
|
+
subtype: 'library',
|
|
67
|
+
metadata: { layer: 'engine', year: 2026 },
|
|
68
|
+
})
|
|
69
|
+
await brain.relate({ from: cor, to: brainy, type: VerbType.DependsOn, subtype: 'runtime' })
|
|
57
70
|
|
|
58
71
|
const hits = await brain.find({
|
|
59
|
-
query: '
|
|
60
|
-
where: {
|
|
61
|
-
connected: {
|
|
62
|
-
})
|
|
72
|
+
query: 'native acceleration', // vector — what it means
|
|
73
|
+
where: { layer: 'native' }, // metadata — pushed INTO the walk
|
|
74
|
+
connected: { to: brainy }, // graph — what it touches
|
|
75
|
+
}) // one call, three indexes, fused
|
|
63
76
|
```
|
|
64
77
|
|
|
65
|
-
**
|
|
78
|
+
**Get a license & activate** — under 1M entities, skip this: brainy alone is free and genuinely enough. Beyond that, pick a tier at **[soulcraft.com/pricing](https://soulcraft.com/pricing?focus=cor)** (pricing follows the size of your brain — from $49/mo), then:
|
|
66
79
|
|
|
67
80
|
```bash
|
|
68
|
-
npx @soulcraft/cor login # browser sign-in, like `gh auth login`
|
|
81
|
+
npx @soulcraft/cor login # browser sign-in, like `gh auth login` —
|
|
82
|
+
# walks you through checkout too if you don't have a key yet
|
|
69
83
|
# or, for servers / CI: export COR_LICENSE_KEY=sc_cor_...
|
|
70
84
|
```
|
|
71
85
|
|
|
72
|
-
Keys verify **offline** in Rust — no network call at startup, no license server to run.
|
|
86
|
+
Keys verify **offline** in Rust — no network call at startup, no license server to run. And a missing or expired key never breaks anything: cor steps aside and you're on open-source brainy, same files.
|
|
73
87
|
|
|
74
88
|
## Exact filters inside the vector walk
|
|
75
89
|
|
|
@@ -931,6 +931,12 @@ export class GraphAdjacencyIndex {
|
|
|
931
931
|
this.flushTimer = setInterval(async () => {
|
|
932
932
|
await this.flush();
|
|
933
933
|
}, this.config.flushInterval);
|
|
934
|
+
// Never keep a bare process alive for housekeeping: durability rides the
|
|
935
|
+
// mmap'd LSM log at write time — this timer only paces background flushes.
|
|
936
|
+
// Without unref, any script that exits without reaching close() hangs
|
|
937
|
+
// forever. Same pattern as the cache + resource-manager timers.
|
|
938
|
+
if (this.flushTimer.unref)
|
|
939
|
+
this.flushTimer.unref();
|
|
934
940
|
}
|
|
935
941
|
calculateMemoryUsage() {
|
|
936
942
|
const stats = this.native.getStats();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/cor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Native Rust acceleration for Brainy \u2014 SIMD distance, vector quantization, zero-copy mmap, native embeddings. Free tier for storage, Pro license for compute acceleration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@napi-rs/cli": "^3.0.0",
|
|
85
|
-
"@soulcraft/brainy": "8.0.
|
|
85
|
+
"@soulcraft/brainy": "8.0.11",
|
|
86
86
|
"@types/node": "^22.0.0",
|
|
87
87
|
"pg": "^8.21.0",
|
|
88
88
|
"tsx": "^4.21.0",
|