ON THIS PAGE
Overview Visual Architecture Feature Configuration API Specification Scenario Guide Security Detail

Superbrain Documentation

Superbrain is a next-generation distributed memory fabric designed for AI agents. It transforms passive storage into a cognitive participant in your agentic workflows.

Traditional databases treat data as static bytes to be retrieved. Superbrain treats data as Active Memory—with semantic awareness, intentional decay, and microsecond-latency sharing between co-located and distributed agents.

New in v3.0.0: Advanced cognitive triggers and mTLS enrollment for secure multi-agent swarms.

Architecture Deep Dive

Superbrain separates the **Control Plane** (Metadata, Consensus, Routing) from the **Data Plane** (Raw Bytes, mmap, rDMA). This allows for extreme horizontal scale without impacting metadata consistency.

Coordinator Raft Consensus / CA / mDNS Agent SDK AES-256-GCM SDK Local Metadata Cache Fabric Node RAM 1. Allocate (Control) 2. DATA IO (gRPC / SHM)

Hot Path Bypass: Once the SDK resolves metadata from the Coordinator, subsequent Reads/Writes go directly to Fabric Nodes.

Active Memory Concepts

Active Memory transforms distributed storage into a cognitive participant. Unlike Redis or S3, Superbrain understands the "liveliness" and "intent" of the data it stores.

Semantic Consistency

When multiple agents write to the same context, Superbrain resolves logical conflicts using "Intent-Based Locking" rather than just row-level locks.

Intentional Decay

Set a decay_rate on any write. Low-priority reasoning steps will naturally "evaporate" from RAM, while high-priority terminal decisions persist.

Quickstart Guide

Get your agent swarm up and running in minutes.

1. Install the SDK

pip install superbrain-sdk
npm install superbrain-distributed-sdk
go get github.com/golightstep/superbrainSdk

2. Basic Memory Share

from superbrain import SuperbrainClient
client = SuperbrainClient("localhost:50050")

# Write to distributed RAM
ptr_id = client.allocate(1024)
client.write(ptr_id, 0, b"Agent State Alpha")
const { SuperbrainClient } = require('superbrain-distributed-sdk');
const client = new SuperbrainClient('localhost:50050');

const ptrId = await client.allocate(1024);
await client.write(ptrId, 0, Buffer.from("Agent State Alpha"));
client := sdk.NewClient("localhost:50050")
ptr, _ := client.Allocate(1024)
client.Write(ptr.ID, 0, []byte("Agent State Alpha"))

Configuration Ability

Tune every aspect of the SDK and Cluster behavior. Superbrain supports configuration via Environment Variables (recommended for containers) or explicit `Config` objects.

SDK Settings

ParameterDefaultDescription
SB_COORDINATORlocalhost:50050Primary gRPC endpoint. Comma-separate for HA pools.
SB_ENCRYPTION_KEYnull32-byte key for E2EE. Enabling this wraps all IO in AES-GCM.
SB_BYPASS_LOCALtrueIf node IP is 127.0.0.1, use SHM for 15μs latency bypass.
SB_MTLS_ENABLEfalseForce mutual TLS certification for all agent operations.

Detailed API Specification

Superbrain provides three primary API tiers. Level 1 is the Raw Pointer API, offering maximum performance and control over byte offsets.

gRPC / SHM
CORE

Client.Allocate(size)

Reserves chunks of RAM across the distributed fabric. Returns a 36-byte UUID pointer.

# Allocate 50MB
ptr_id = client.allocate(50 * 1024 * 1024)
print(f"Memory ready: {ptr_id}")
// Allocate 50MB
const ptrId = await client.allocate(50 * 1024 * 1024);
console.log(`Memory ready: ${ptrId}`);
// Allocate 50MB
ptr, err := client.Allocate(50 * 1024 * 1024)
fmt.Printf("Memory ready: %s\n", ptr.ID)

Parameters

sizeuint64Number of bytes to allocate.

Common Exceptions

  • ERR_QUOTA_EXHAUSTED: Cluster has no free RAM in this tier.
  • ERR_COORD_UNREACHABLE: Metadata resolve failed.
Active Memory
COGNITIVE

Client.WriteCognitive(...)

Enriches raw data writes with semantic metadata. This is the foundation of Superbrain's "Cognitive Architecture".

Parameters

summarystringLLM-readable summary of the chunk content.
intentstringThe logical purpose of this write (e.g. "Drafting Plan").
livelinessfloat (0-1)Sets the decay rate. 0.1 = ephemeral, 1.0 = persistent.
Tip: Use low liveliness for intermediate "Chain of Thought" reasoning to save RAM and avoid context bloat.

Real-World Scenarios

Scenario 1: Collaborative Document Research

One agent downloads a 500MB PDF. Instead of sending the PDF to 10 other agents, it writes to Superbrain and shares the 36-byte pointer via a message bus.

Scenario 2: The "Strategic Interrupt"

An execution agent is writing logs. A security agent subscribes to tag="Sensitive". The moment the executor writes an API key by mistake, the security agent is woken up by Superbrain to scrub the memory and flag the breach.

Scenario 3: Cross-Language Handover

A Go ingestion agent writes high-speed telemetry. A Python agent reads the same offsets for ML inference. Superbrain handles the byte-order and mmap alignment automatically.