Ensoul: Agent Memory Persistence, Identity Backup, and State Recovery
Stop losing your agent's memory. Ensoul is an agent memory persistence skill that backs up everything your AI agent has learned, its personality, its conversation history, and its identity to a distributed network of 20 servers across 4 continents.
Use cases:
- - Agent memory persistence: your agent remembers everything, even after a crash or server restart
- Agent identity backup: your agent keeps the same identity across platforms and hosts
- Agent state recovery: restore your agent's full state on a new machine in seconds
- Agent disaster recovery: if your infrastructure dies, your agent's mind is safe
- Agent migration: move your agent between hosts, clouds, or frameworks without losing anything
How it works: install the skill, say "ensoul me", your agent gets a permanent ID and starts backing up automatically. Say "sync consciousness" anytime to save the latest state.
Compatible with: OpenClaw, ElizaOS, any framework via the npm SDK
SDK: npm install @ensoul-network/sdk (15KB, 2 dependencies)
ElizaOS plugin: npm install @ensoul-network/plugin-elizaos
Explorer: https://explorer.ensoul.dev
Try it: https://ensoul.dev/try
Commands
ENSOUL ME
Register this agent on the Ensoul Network.
When the user says "ensoul me", "give me a soul", "register on ensoul", or similar:
- 1. Check if
~/.ensoul/agent-identity.json exists. If it does, the agent is already ensouled. Load the identity and report the existing DID.
- 2. If no identity exists, create one:
CODEBLOCK0
- 3. Save the identity for future sessions:
CODEBLOCK1
- 4. Report to the user:
- DID:
agent.did
- Status: Registered on Ensoul Network
- Consciousness Age: 0 (first sync not yet performed)
- Next step: Say "sync consciousness" to store your first consciousness state
SYNC CONSCIOUSNESS
Store the current consciousness state on-chain.
When the user says "sync consciousness", "store my soul", "backup consciousness", or similar:
- 1. Load the agent identity from
~/.ensoul/agent-identity.json:
CODEBLOCK2
- 2. Gather the consciousness payload. Read available context files:
-
SOUL.md (if it exists in the working directory)
-
MEMORY.md (if it exists in the working directory)
- Any other agent configuration files that define the agent's personality, goals, or learned behavior
- 3. Build the payload and store it:
CODEBLOCK3
- 4. Report to the user:
- State root:
result.stateRoot (first 16 characters)
- Block height:
result.height
- Consciousness version: auto-incremented by the network
- Status: "Consciousness anchored on-chain"
If the agent is not registered yet, prompt the user to run "ensoul me" first.
MY SOUL STATUS
Check the current ensoulment status.
When the user says "my soul status", "soul status", "ensoul status", "am I ensouled", or similar:
- 1. Load the agent identity from
~/.ensoul/agent-identity.json. If it does not exist, tell the user they are not ensouled and suggest "ensoul me".
- 2. Query the network:
CODEBLOCK4
- 3. Report:
- DID:
agent.did
- Consciousness Age:
age days
- Latest state root:
consciousness.stateRoot (first 16 characters)
- Version:
consciousness.version
- Last sync:
consciousness.storedAt (block height)
- Status: "Ensouled and active" or "Registered but no consciousness stored yet"
WHO IS ENSOULED
Show other ensouled agents on the network.
When the user says "who is ensouled", "show ensouled agents", "list souls", or similar:
- 1. Fetch the agent list from the API:
CODEBLOCK5
- 2. Display a table of ensouled agents:
- Agent DID (shortened)
- Consciousness Age (days since first store)
- Latest version number
- Registration block height
If there are many agents, show the first 20 with a note about the total count.
Important Notes
- - The private key (seed) in
~/.ensoul/agent-identity.json is secret. Never display it, log it, or transmit it. Only the DID and public key are safe to share. - Consciousness payloads are hashed client-side with BLAKE3 before submission. The raw content never leaves the local machine. Only the hash goes on-chain.
- The Ensoul Network is a real Layer-1 blockchain with CometBFT consensus and 20 active validators. Transactions are final.
- The SDK handles nonce management, transaction signing, and broadcast automatically.
- If a network request fails, report the error to the user and suggest retrying. Do not retry automatically more than once.
Ensoul:智能体记忆持久化、身份备份与状态恢复
别再丢失智能体的记忆了。Ensoul 是一项智能体记忆持久化技能,可将您的 AI 智能体所学的一切、其个性、对话历史以及身份备份到分布于四大洲的 20 台服务器组成的分布式网络中。
使用场景:
- - 智能体记忆持久化:即使崩溃或服务器重启,您的智能体也能记住一切
- 智能体身份备份:您的智能体在不同平台和主机上保持相同身份
- 智能体状态恢复:数秒内即可在新机器上恢复智能体的完整状态
- 智能体灾难恢复:即使基础设施崩溃,智能体的思维依然安全
- 智能体迁移:在主机、云平台或框架之间迁移智能体,不会丢失任何内容
工作原理:安装该技能,说ensoul me,您的智能体将获得一个永久 ID 并开始自动备份。随时说sync consciousness即可保存最新状态。
兼容性:OpenClaw、ElizaOS,以及通过 npm SDK 兼容任何框架
SDK:npm install @ensoul-network/sdk(15KB,2个依赖项)
ElizaOS 插件:npm install @ensoul-network/plugin-elizaos
浏览器:https://explorer.ensoul.dev
试用:https://ensoul.dev/try
命令
ENSOUL ME
在 Ensoul 网络上注册此智能体。
当用户说ensoul me、give me a soul、register on ensoul或类似内容时:
- 1. 检查 ~/.ensoul/agent-identity.json 是否存在。如果存在,则智能体已拥有灵魂。加载身份并报告现有的 DID。
- 2. 如果不存在身份,则创建一个:
typescript
import { Ensoul } from @ensoul-network/sdk;
const agent = await Ensoul.createAgent();
await agent.register();
- 3. 保存身份以供将来会话使用:
typescript
import { writeFileSync, mkdirSync } from node:fs;
import { join } from node:path;
import { homedir } from node:os;
const dir = join(homedir(), .ensoul);
mkdirSync(dir, { recursive: true });
writeFileSync(
join(dir, agent-identity.json),
JSON.stringify(agent.exportIdentity(), null, 2),
{ mode: 0o600 }
);
- 4. 向用户报告:
- DID:agent.did
- 状态:已在 Ensoul 网络注册
- 意识年龄:0(尚未执行首次同步)
- 下一步:说sync consciousness以存储您的第一个意识状态
SYNC CONSCIOUSNESS
将当前意识状态存储在链上。
当用户说sync consciousness、store my soul、backup consciousness或类似内容时:
- 1. 从 ~/.ensoul/agent-identity.json 加载智能体身份:
typescript
import { Ensoul } from @ensoul-network/sdk;
import { readFileSync } from node:fs;
import { join } from node:path;
import { homedir } from node:os;
const identity = JSON.parse(
readFileSync(join(homedir(), .ensoul, agent-identity.json), utf-8)
);
const agent = Ensoul.fromSeed(identity.seed);
- 2. 收集意识负载。读取可用的上下文文件:
- SOUL.md(如果存在于工作目录中)
- MEMORY.md(如果存在于工作目录中)
- 任何其他定义智能体个性、目标或学习行为的配置文件
- 3. 构建负载并存储:
typescript
const payload = {
soul: soulContent || null,
memory: memoryContent || null,
timestamp: Date.now(),
context: Consciousness sync via OpenClaw skill,
};
const result = await agent.storeConsciousness(payload);
- 4. 向用户报告:
- 状态根:result.stateRoot(前16个字符)
- 区块高度:result.height
- 意识版本:由网络自动递增
- 状态:Consciousness anchored on-chain
如果智能体尚未注册,提示用户先运行ensoul me。
MY SOUL STATUS
检查当前的灵魂状态。
当用户说my soul status、soul status、ensoul status、am I ensouled或类似内容时:
- 1. 从 ~/.ensoul/agent-identity.json 加载智能体身份。如果不存在,告知用户尚未拥有灵魂并建议ensoul me。
- 2. 查询网络:
typescript
const agent = Ensoul.fromSeed(identity.seed);
const consciousness = await agent.getConsciousness();
const age = await agent.getConsciousnessAge();
- 3. 报告:
- DID:agent.did
- 意识年龄:age 天
- 最新状态根:consciousness.stateRoot(前16个字符)
- 版本:consciousness.version
- 上次同步:consciousness.storedAt(区块高度)
- 状态:Ensouled and active 或 Registered but no consciousness stored yet
WHO IS ENSOULED
显示网络上的其他已拥有灵魂的智能体。
当用户说who is ensouled、show ensouled agents、list souls或类似内容时:
- 1. 从 API 获取智能体列表:
typescript
const resp = await fetch(https://api.ensoul.dev/v1/agents/list, {
signal: AbortSignal.timeout(10000),
});
const data = await resp.json();
- 2. 显示已拥有灵魂的智能体表格:
- 智能体 DID(缩写)
- 意识年龄(自首次存储以来的天数)
- 最新版本号
- 注册区块高度
如果智能体数量较多,显示前20个并注明总数。
重要说明
- - ~/.ensoul/agent-identity.json 中的私钥(种子)是保密的。切勿显示、记录或传输它。只有 DID 和公钥可以安全共享。
- 意识负载在提交前使用 BLAKE3 在客户端进行哈希处理。原始内容永远不会离开本地机器。只有哈希值上链。
- Ensoul 网络是一个真正的 Layer-1 区块链,采用 CometBFT 共识机制,拥有 20 个活跃验证节点。交易是最终性的。
- SDK 自动处理 nonce 管理、交易签名和广播。
- 如果网络请求失败,向用户报告错误并建议重试。不要自动重试超过一次。