@sykeclone/kage-sdk
v1.0.0
Published
Kage — Onchain Agent Memory Protocol for Sui + Walrus
Maintainers
Readme
Kage — Onchain Agent Memory Protocol
影 (Kage) — Shadow. What an agent remembers is its shadow on the chain.
Kage is the missing memory layer for autonomous AI agents on Sui. Not just persistent storage — queryable, conflict-aware, event-driven, temporally-snapshotted, cross-graph agent cognition infrastructure.
Built for Sui Overflow 2026 — Walrus Track.
The Problem
Agents today forget. They rely on fragile local memory, can't share context across workflows, and produce zero verifiable audit trail. When a trade goes wrong, there is no record of what the agent knew, or why it decided.
LangGraph, Mastra, ElizaOS — none of them solve this. They're all offchain.
Kage Solves It With 5 Primitives
| # | Feature | What it does | |---|---------|-------------| | 1 | Associative Memory Index | Tag-based semantic query — find memories by asset, action, namespace, confidence | | 2 | Conflict Detection | Two agents disagree on BTC? Flagged automatically onchain | | 3 | Memory Inheritance | Child agent bootstraps from parent memory — linked provenance chain | | 4 | Temporal Snapshots | Freeze namespace state at any point — full time travel audit | | 5 | Cross-graph Sharing | Two separate agent graphs share a memory namespace via a permissioned bridge |
Plus event-driven triggers — subscriptions that fire a Sui event when a matching memory is written, waking the next agent automatically.
Architecture
Your Agent (TypeScript/Python)
│
▼
Kage Runtime SDK
┌──────────────────────────────┐
│ write() / inherit() │
│ snapshot() / share() │
│ subscribe() / recall() │
└──────────┬───────────────────┘
│
┌───────┴────────┐
▼ ▼
Walrus Sui Move
(blob storage) (truth layer)
blob_id ──────────► memory index
state JSON conflict detection
persistent subscriptions
verifiable snapshots
cross-graph bridgesQuick Start
1. Deploy the contract
chmod +x deploy.sh
./deploy.sh # mainnet
./deploy.sh --testnet2. Configure
cp .env.example .env
# Fill in SUI_PRIVATE_KEY_B64
# KAGE_PACKAGE_ID and KAGE_PROTOCOL_ID are filled by deploy.sh3. Install and run the demo
npm install
npm run demoSDK Usage
import { Kage } from './src/kage.js';
const kage = new Kage({
suiRpcUrl: 'https://fullnode.mainnet.sui.io:443',
privateKeyB64: process.env.SUI_PRIVATE_KEY_B64!,
packageId: process.env.KAGE_PACKAGE_ID!,
protocolId: process.env.KAGE_PROTOCOL_ID!,
walrusAggregatorUrl: process.env.WALRUS_AGGREGATOR_URL!,
walrusPublisherUrl: process.env.WALRUS_PUBLISHER_URL!,
agentName: 'MyAgent',
namespace: 'myapp',
});
await kage.init();
// Write a memory
const result = await kage.write({
state: { signal: 'UP', price: 67420 },
tags: ['BTC', 'SCOUT', 'UP'],
asset: 'BTC',
action: 'BUY',
confidence: 78,
});
// Inherit from parent
const child = await kage.inherit(result.memoryId, newState, 'EXECUTE', ['BTC', 'RISK'], 65);
// Snapshot the namespace
await kage.snapshot('Pre-trade state captured');
// Cross-graph share
await kage.createBridge(otherProtocolId, 'shared-signals');
await kage.shareMemory(bridgeId, otherProtocolId, result.memoryId);
// Subscribe to BUY signals
await kage.subscribe(['BUY'], 'BTC', 'BUY', 'myapp');
// Recall a blob from Walrus
const state = await kage.recall(result.blobId);
// Report outcome (updates reputation)
await kage.reportOutcome(result.memoryId, 'SUCCESS');AlphaLoop Demo
AlphaLoop is a live 4-node trading agent that uses Kage as its memory layer. It pulls signals from Trend Pilot (X Layer) and runs Scout → Risk → Decide → Execute.
Every node writes to Walrus, inherits from the previous node, and the full decision trail is anchored onchain.
npm run demoFile Structure
kage/
├── move/
│ ├── Move.toml
│ └── sources/
│ └── kage.move # The full protocol contract
├── src/
│ ├── kage.ts # Main SDK
│ ├── walrus.ts # Walrus client
│ ├── sui.ts # Sui Move client
│ ├── types/
│ │ └── index.ts # All TypeScript types
│ └── demo/
│ └── alphaloop.ts # Live trading agent demo
├── deploy.sh # One-command deploy
├── .env.example
├── package.json
└── tsconfig.jsonBuilt by Semideus / @syke0x
Sui Overflow 2026 — Walrus Track — $70K prize pool
