superbrain-distributed-sdk 0.1.0 β†’ 0.2.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.
Files changed (2) hide show
  1. package/README.md +159 -0
  2. package/package.json +7 -2
package/README.md ADDED
@@ -0,0 +1,159 @@
1
+ # 🧠 superbrain-distributed-sdk v0.2.0 β€” TypeScript/Node.js
2
+
3
+ [![npm version](https://badge.fury.io/js/superbrain-distributed-sdk.svg)](https://badge.fury.io/js/superbrain-distributed-sdk)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js](https://img.shields.io/badge/Node.js-18%2B-green)](https://nodejs.org)
6
+
7
+ > **The Distributed RAM Fabric for AI Agents** β€” Share terabytes of context across your LLM cluster at microsecond speeds using 36-byte UUID pointers.
8
+
9
+ ---
10
+
11
+ ## πŸ“¦ Installation
12
+
13
+ ```bash
14
+ npm install superbrain-distributed-sdk
15
+ ```
16
+
17
+ ---
18
+
19
+ ## ✨ New in v0.2.0 β€” Phase 3: Automated AI Memory Controller
20
+
21
+ Version 0.2.0 introduces the Phase 3 **Automated AI Memory Controller** β€” a self-managing, intelligent memory fabric where multiple LLMs running on different machines share context instantly at RAM speed.
22
+
23
+ ### Key Phase 3 Features:
24
+ - **Auto-Discovery**: Zero-config cluster formation via mDNS
25
+ - **KV Cache Pooling**: Identical prefixes shared across models automatically
26
+ - **Smart Prefetching**: Markov-chain access pattern prediction
27
+ - **Self-Tuning Allocator**: Learns from access history to pre-allocate
28
+ - **Anomaly Detection**: Z-score alerting for unusual access patterns
29
+ - **Live Dashboard**: Real-time metrics at `http://localhost:9090`
30
+
31
+ ---
32
+
33
+ ## πŸ”§ Usage
34
+
35
+ ### Basic β€” Shared Memory Between Agents
36
+ ```typescript
37
+ import { SuperbrainClient } from 'superbrain-distributed-sdk';
38
+
39
+ const client = new SuperbrainClient('localhost:50050');
40
+ await client.register('my-agent-id');
41
+
42
+ // Allocate distributed RAM
43
+ const ptrId = await client.allocate(100 * 1024 * 1024); // 100 MB
44
+
45
+ // Write from Agent A on Machine A
46
+ await client.write(ptrId, 0, Buffer.from('Shared AI context'));
47
+
48
+ // Read from Agent B on Machine B (just needs the 36-byte pointer!)
49
+ const data = await client.read(ptrId, 0, 17);
50
+
51
+ await client.free(ptrId);
52
+ client.close();
53
+ ```
54
+
55
+ ### Advanced β€” Secure Fabric (E2EE)
56
+ ```typescript
57
+ import { SuperbrainClient } from 'superbrain-distributed-sdk';
58
+
59
+ // All data encrypted with AES-256-GCM at client level
60
+ // Memory nodes NEVER see plaintext
61
+ const client = new SuperbrainClient('localhost:50050', {
62
+ encryptionKey: crypto.randomBytes(32)
63
+ });
64
+ await client.register('secure-agent');
65
+
66
+ const ptr = await client.allocate(4 * 1024 * 1024);
67
+ await client.write(ptr, 0, Buffer.from(JSON.stringify(sensitiveData)));
68
+ const response = await client.read(ptr, 0, 0);
69
+ ```
70
+
71
+ ### Multi-Agent Context Passing
72
+ ```typescript
73
+ // Agent A writes β€” gets pointer
74
+ const ctxPtr = await client.allocate(1024 * 1024);
75
+ await client.write(ctxPtr, 0, Buffer.from(JSON.stringify({
76
+ topic: "distributed AI inference",
77
+ findings: researchResults,
78
+ timestamp: Date.now()
79
+ })));
80
+
81
+ // Share the 36-byte pointer ID via any channel (HTTP, gRPC, etc.)
82
+ broadcast({ contextPtr: ctxPtr }); // other agents connect immediately
83
+
84
+ // Agent B reads β€” microseconds, no data copying
85
+ const received = JSON.parse((await clientB.read(ctxPtr, 0, 0)).toString());
86
+ ```
87
+
88
+ ---
89
+
90
+ ## πŸ“Š Architecture
91
+
92
+ ```
93
+ Your LLM App SuperBrain Cluster
94
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
95
+ β”‚ Node.js SDK │──gRPC──>β”‚ Coordinator β”‚
96
+ β”‚ β”‚ β”‚ (Control Plane) β”‚
97
+ β”‚ allocate() β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
98
+ β”‚ write() β”‚ β”‚ pointer map
99
+ β”‚ read() β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
100
+ β”‚ free() │──gRPC──>β”‚ Memory Nodes β”‚
101
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ (Data Plane) β”‚
102
+ β”‚ 1TB+ pooled RAM β”‚
103
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
104
+ ```
105
+
106
+ **Control plane** (Coordinator): Routes allocation requests, maintains node registry.
107
+ **Data plane** (Memory Nodes): Direct gRPC streams for maximum throughput.
108
+ **Client**: Talks to nodes directly after allocation β€” Coordinator is never in the hot path.
109
+
110
+ ---
111
+
112
+ ## πŸ” Security Features
113
+
114
+ | Feature | Status |
115
+ |---------|--------|
116
+ | mTLS (mutual TLS between all nodes) | βœ… |
117
+ | E2EE (AES-256-GCM at SDK level) | βœ… |
118
+ | Pub/Sub (real-time memory notifications) | βœ… |
119
+ | Per-context key rotation | βœ… (v0.2.0) |
120
+ | Anomaly detection | βœ… (v0.2.0) |
121
+ | GDPR/SOC2 audit logging | βœ… (v0.2.0) |
122
+
123
+ ---
124
+
125
+ ## πŸ—ΊοΈ Roadmap
126
+
127
+ | Version | Milestone | Status |
128
+ |---------|-----------|--------|
129
+ | `v0.1.0` | Core Distributed RAM | βœ… Shipped |
130
+ | `v0.1.1` | Secure Fabric (mTLS + E2EE) | βœ… Shipped |
131
+ | `v0.2.0` | **Phase 3: Automated AI Memory Controller** | βœ… **Current** |
132
+ | `v0.3.0` | Raft Replication (Fault-Tolerant Memory) | 🚧 Planned |
133
+ | `v0.4.0` | NVMe Spilling ("Infinite Memory") | 🚧 Planned |
134
+ | `v0.5.0` | GPUDirect RDMA (GPUβ†’Network zero-copy) | πŸ”¬ Research |
135
+
136
+ ---
137
+
138
+ ## πŸ“š Documentation
139
+
140
+ - [Full Documentation & API Reference](https://github.com/anispy211/superbrainSdk/blob/main/DOCUMENTATION.md)
141
+ - [GitHub Repository](https://github.com/anispy211/superbrainSdk)
142
+ - [Main Server Repo](https://github.com/anispy211/memorypool)
143
+
144
+ ---
145
+
146
+ ## πŸ–₯️ Server Setup (Required)
147
+
148
+ This SDK connects to a **SuperBrain coordinator**. To run one locally in 30 seconds:
149
+
150
+ ```bash
151
+ git clone https://github.com/anispy211/memorypool
152
+ cd memorypool
153
+ docker compose up -d
154
+ # Dashboard: http://localhost:8080
155
+ ```
156
+
157
+ ---
158
+
159
+ MIT License Β· Built by [Anispy](https://github.com/anispy211)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superbrain-distributed-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Premium High-Performance Distributed Memory SDK for AI Agents",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -15,10 +15,15 @@
15
15
  "keywords": [
16
16
  "distributed-memory",
17
17
  "ai-agents",
18
+ "kv-cache",
19
+ "langchain",
20
+ "pytorch",
18
21
  "mcp",
19
22
  "grpc",
20
23
  "performance",
21
- "context-sharing"
24
+ "context-sharing",
25
+ "llm",
26
+ "rag"
22
27
  ],
23
28
  "author": "Anispy",
24
29
  "license": "MIT",