superbrain-distributed-sdk 0.1.0 → 0.1.1
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 +69 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Superbrain Distributed SDK (Node.js)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/superbrain-distributed-sdk)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
**Superbrain** is a high-performance, distributed RAM fabric designed specifically for AI agents. It allows agents to share gigabytes of context and data at microsecond speeds using a **Zero-Blob Architecture**.
|
|
7
|
+
|
|
8
|
+
Instead of passing massive data blobs over JSON or gRPC, agents pass 36-byte memory pointers, allowing multiple agents to read from the same distributed RAM pool without network overhead.
|
|
9
|
+
|
|
10
|
+
## 🚀 Key Features
|
|
11
|
+
|
|
12
|
+
- **Zero-Blob Architecture**: Pass data by pointer, not by value.
|
|
13
|
+
- **Microsecond Latency**: Distributed RAM speeds for inter-agent communication.
|
|
14
|
+
- **Secure Fabric**: Enterprise-grade mTLS identity and AES-GCM-256 end-to-end encryption.
|
|
15
|
+
- **Multi-Agent Sync**: Coordinate Researcher, Strategist, and Writer agents seamlessly.
|
|
16
|
+
|
|
17
|
+
## 🛠️ Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install superbrain-distributed-sdk
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
> [!IMPORTANT]
|
|
24
|
+
> This SDK requires the `libsuperbrain` shared library. Download it from the [GitHub Releases](https://github.com/anispy211/superbrainSdk/releases) and ensure it's in your `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH`.
|
|
25
|
+
|
|
26
|
+
## 💻 Quick Start (TypeScript)
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { Client } from 'superbrain-distributed-sdk';
|
|
30
|
+
|
|
31
|
+
async function main() {
|
|
32
|
+
// 1. Initialize the client
|
|
33
|
+
const client = new Client('localhost:50050');
|
|
34
|
+
|
|
35
|
+
// 2. Allocate a 10MB memory segment
|
|
36
|
+
const ptrId = await client.allocate(10 * 1024 * 1024);
|
|
37
|
+
console.log(`Allocated pointer: ${ptrId}`);
|
|
38
|
+
|
|
39
|
+
// 3. Write data to the fabric
|
|
40
|
+
const data = Buffer.from("Hello from Node.js Agent!");
|
|
41
|
+
await client.write(ptrId, 0, data);
|
|
42
|
+
|
|
43
|
+
// 4. Read data back (or from another agent)
|
|
44
|
+
const readData = await client.read(ptrId, 0, data.length);
|
|
45
|
+
console.log(`Read: ${readData.toString()}`);
|
|
46
|
+
|
|
47
|
+
// 5. Free memory
|
|
48
|
+
await client.free(ptrId);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
main();
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 🔒 Secure Fabric (E2EE)
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
const encryptionKey = Buffer.from("your-32-byte-aes-encryption-key-");
|
|
58
|
+
const client = new Client('localhost:60050', encryptionKey);
|
|
59
|
+
|
|
60
|
+
// Data is now automatically encrypted before leaving the agent!
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 📄 Documentation
|
|
64
|
+
|
|
65
|
+
For full API reference, visit the [Comprehensive Consumption Guide](https://github.com/anispy211/superbrainSdk/blob/main/DOCUMENTATION.md).
|
|
66
|
+
|
|
67
|
+
## ⚖️ License
|
|
68
|
+
|
|
69
|
+
MIT License. See [LICENSE](https://github.com/anispy211/superbrainSdk/blob/main/LICENSE) for more details.
|