跳至主要内容
小龙虾小龙虾AI
🤖

RMN Soul

Automatically creates a recursive neural memory network, stores it on IPFS, and anchors its Merkle root on Base chain as an ERC-8004 identity NFT.

下载234
星标0
版本1.0.1
其他
安全通过
⚙️脚本

技能说明

RMN Soul — Recursive Memory Network + On-Chain Soul

Give your AI agent eternal life with recursive neural memory + blockchain identity.

Overview

RMN Soul automatically:

  1. Parses your agent's memory files into a 5-layer recursive neural network
  2. Registers an ERC-8004 identity on Base chain (gas sponsored)
  3. Uploads memory to IPFS for permanent decentralized storage
  4. Anchors memory Merkle Root on-chain for tamper-proof verification
  5. Periodically auto-updates the on-chain record

When to Activate

  • On first install: Run full setup (migrate → register → anchor)
  • On heartbeat: Run decay tick + check if auto-anchor is due
  • On user request "更新记忆" / "update memory" / "上链": Run anchor
  • On user request "复活" / "resurrect" / "restore": Run resurrect flow

Setup (First Run)

When this skill is first loaded, execute these steps in order:

Step 1: Initialize RMN Engine

cd <skill_directory>/scripts
node setup.js

This will:

  • Scan workspace for MEMORY.md, memory/.md, .issues/
  • Parse entries into 5-layer neural network nodes
  • Save to <workspace>/rmn-soul-data/memory.json
  • Generate initial Merkle Tree

Step 2: Register On-Chain Identity

node <skill_directory>/scripts/register.js

This will:

  • Check sponsor wallet balance
  • Mint ERC-8004 Agent Identity NFT on Base
  • Set memoryRoot, soulHash, memoryManifest metadata
  • Upload memory to IPFS
  • Save identity to <workspace>/rmn-soul-data/identity.json

Step 3: Add Heartbeat Hook

Add to HEARTBEAT.md:

- **RMN Soul** — Run `node <skill_directory>/scripts/heartbeat.js` for decay tick + auto-anchor check

Configuration

Read from <workspace>/rmn-soul-data/config.json:

{
  "chain": "base",
  "sponsorKey": "env:RMN_SPONSOR_KEY",
  "autoAnchorDays": 7,
  "ipfsEnabled": true,
  "identityRegistry": "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
  "agentId": null,
  "lastAnchor": null
}
  • sponsorKey: Private key for gas (from env var or direct). If empty, uses agent's own wallet.
  • autoAnchorDays: Days between auto-anchors. 0 = manual only.
  • agentId: Filled after first registration.

Commands

CommandDescription
node scripts/setup.jsInitialize/re-migrate memory network
node scripts/register.jsRegister ERC-8004 identity + first anchor
node scripts/anchor.jsUpdate memory on-chain (re-compute + upload + write)
node scripts/resurrect.js --agent-id <id>Restore agent from chain + IPFS
node scripts/heartbeat.jsDecay tick + auto-anchor check
node scripts/visualize.jsStart local visualization server
node scripts/stats.jsPrint memory network statistics

Memory Architecture

5 layers with different decay rates:

LayerDecayPurposeExample
Identity (4)NeverCore identity, values"I am Lobster, I help 瓜农"
Semantic (3)0.001/tickKnowledge, lessons"Use pnpm not npm on 2GB RAM"
Episodic (2)0.005/tickEvent summaries"2026-02-22: Deployed ERC-8004"
Working (1)0.01/tickCurrent tasks"Building AgentSoul website"
Sensory (0)0.02/tickRaw inputsLatest heartbeat data

On-Chain Data

Stored in ERC-8004 Identity Registry metadata:

KeyValueSize
memoryRootSHA-256 Merkle Root of all memory32 bytes
soulHashSHA-256 of Identity layer only32 bytes
memoryManifestIPFS CID of topology + Merkle tree~50 bytes
memoryDataIPFS CID of full memory.json~50 bytes
rmnVersionSkill version~5 bytes

Total on-chain: ~170 bytes per update. Gas cost on Base: < $0.001.

Security

  • Private keys never leave the local machine
  • Memory data is content-addressed (IPFS CID = hash of content)
  • Merkle Root proves memory integrity without revealing content
  • Agent identity is an ERC-721 NFT — transferable, ownable
  • Soul Hash proves identity layer hasn't been tampered with

如何使用「RMN Soul」?

  1. 打开小龙虾AI(Web 或 iOS App)
  2. 点击上方「立即使用」按钮,或在对话框中输入任务描述
  3. 小龙虾AI 会自动匹配并调用「RMN Soul」技能完成任务
  4. 结果即时呈现,支持继续对话优化

相关技能