@soulcraft/cortex 1.3.1 → 1.4.0
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/dist/plugin.d.ts +4 -2
- package/dist/plugin.js +17 -2
- package/native/{brainy-native.linux-x64-gnu.node → brainy-native.node} +0 -0
- package/package.json +1 -1
- package/native/brainy-native.darwin-arm64.node +0 -0
- package/native/brainy-native.darwin-x64.node +0 -0
- package/native/brainy-native.linux-arm64-gnu.node +0 -0
- package/native/brainy-native.win32-x64-msvc.node +0 -0
package/dist/plugin.d.ts
CHANGED
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
* 3. metadataIndex — Native Rust query/mutation engine (licensed)
|
|
14
14
|
* 4. graphIndex — Native 4 LSM-trees with verb tracking (licensed)
|
|
15
15
|
* 5. embeddings — Candle ML native engine (CPU/CUDA/Metal) (licensed)
|
|
16
|
-
* 6.
|
|
17
|
-
* 7.
|
|
16
|
+
* 6. embedBatch — Native batch embedding (single forward pass) (licensed)
|
|
17
|
+
* 7. entityIdMapper — Native UUID ↔ integer mapping (licensed)
|
|
18
|
+
* 8. roaring — CRoaring bitmap bindings (licensed)
|
|
19
|
+
* 9. msgpack — Native encode/decode (licensed)
|
|
18
20
|
*/
|
|
19
21
|
import type { BrainyPlugin } from '@soulcraft/brainy/plugin';
|
|
20
22
|
declare const cortexPlugin: BrainyPlugin;
|
package/dist/plugin.js
CHANGED
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
* 3. metadataIndex — Native Rust query/mutation engine (licensed)
|
|
14
14
|
* 4. graphIndex — Native 4 LSM-trees with verb tracking (licensed)
|
|
15
15
|
* 5. embeddings — Candle ML native engine (CPU/CUDA/Metal) (licensed)
|
|
16
|
-
* 6.
|
|
17
|
-
* 7.
|
|
16
|
+
* 6. embedBatch — Native batch embedding (single forward pass) (licensed)
|
|
17
|
+
* 7. entityIdMapper — Native UUID ↔ integer mapping (licensed)
|
|
18
|
+
* 8. roaring — CRoaring bitmap bindings (licensed)
|
|
19
|
+
* 9. msgpack — Native encode/decode (licensed)
|
|
18
20
|
*/
|
|
19
21
|
import { loadNativeModule, isNativeAvailable } from './native/index.js';
|
|
20
22
|
import { validateLicense } from './license.js';
|
|
@@ -88,6 +90,19 @@ const cortexPlugin = {
|
|
|
88
90
|
}
|
|
89
91
|
return engine.embed(text);
|
|
90
92
|
});
|
|
93
|
+
// Batch embeddings: single Rust forward pass for multiple texts
|
|
94
|
+
// Brainy uses this for bulk operations (import, reindex, batch add)
|
|
95
|
+
// when available, bypassing the N-individual-calls path
|
|
96
|
+
context.registerProvider('embedBatch', async (texts) => {
|
|
97
|
+
if (!engine.isInitialized()) {
|
|
98
|
+
await engine.initialize();
|
|
99
|
+
}
|
|
100
|
+
return engine.embedBatch(texts);
|
|
101
|
+
});
|
|
102
|
+
// Entity ID mapper: Native UUID ↔ integer mapping in Rust (O(1) HashMap)
|
|
103
|
+
// Used by MetadataIndexManager for roaring bitmap integration
|
|
104
|
+
const { NativeEntityIdMapperWrapper } = await import('./utils/nativeEntityIdMapper.js');
|
|
105
|
+
context.registerProvider('entityIdMapper', (storage) => new NativeEntityIdMapperWrapper({ storage }));
|
|
91
106
|
// Roaring bitmaps: CRoaring bindings (binary-compatible with roaring-wasm)
|
|
92
107
|
const { RoaringBitmap32 } = await import('./native/NativeRoaringBitmap32.js');
|
|
93
108
|
context.registerProvider('roaring', RoaringBitmap32);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/cortex",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Native Rust acceleration for Brainy — SIMD distance, vector quantization, zero-copy mmap, native embeddings. Commercial license required (14-day free trial).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|