Auto-Drive Skill
Permanent decentralized memory on the Autonomys Network with linked-list memory chains for agent resurrection. Works with agents powered by Claude, GPT, Gemini, and any LLM that supports OpenClaw skills.
What This Skill Does
- 1. Upload files to Auto Drive and get back a CID (Content Identifier) — a permanent, immutable address on the Autonomys distributed storage network.
- Download files from Auto Drive using a CID — uses the authenticated API if a key is set, otherwise falls back to the public gateway.
- Save memories as a chain — each memory entry is a JSON experience with a
header.previousCid pointer, forming a linked list stored permanently on-chain. - Resurrect from a chain — given the latest CID, walk the chain backwards to reconstruct full agent history.
When To Use This Skill
- - User says "save this to Auto-Drive" or "upload to Autonomys" or "store permanently"
- User says "download from Auto-Drive" or provides a CID to retrieve
- User says "save memory", "remember this permanently", or "checkpoint"
- User says "resurrect", "recall chain", "rebuild memory", or "load history"
- Any time the user wants data stored permanently and immutably on a decentralized network
Post-Install
After installing via ClawHub, make the scripts executable:
CODEBLOCK0
ClawHub does not currently preserve file permissions during install.
Configuration
API Key
Requires an AUTO_DRIVE_API_KEY. Run the guided setup script for the easiest path:
CODEBLOCK1
This opens explorer.ai3.storage in your browser, prompts for the key, saves it to ~/.openclaw/.env, and verifies the connection.
Manual setup:
- 1. Navigate to https://explorer.ai3.storage (not
ai3.storage — that's just the landing page) - Check authentication: if the sidebar shows a "Log In" button or lock icons on My Files / Profile / Developers, you are not signed in
- AI agent note: You cannot complete OAuth yourself. Open the browser for the user and ask them to sign in via Google, GitHub, or Discord. Once the user confirms they're signed in, take over — or simply ask the user to paste the API key directly
- Once authenticated, click Developers in the left sidebar
- Click Create API Key and copy the generated key
Then set the key via:
- - Environment: INLINECODE4
- OpenClaw config: INLINECODE5
The API key is required for uploading, saving memories, and recalling the memory chain. It is optional for general file downloads — without it, the public gateway is used and files are returned as stored (i.e. compressed files will not be decompressed).
Core Operations
Upload a File
CODEBLOCK2
Uploads a file to Auto Drive mainnet using the 3-step upload protocol (single chunk).
Returns the CID on stdout. Requires AUTO_DRIVE_API_KEY.
- -
--json — force MIME type to INLINECODE8 - INLINECODE9 — enable ZLIB compression
Download a File
CODEBLOCK3
Downloads a file by CID. Uses the authenticated API if AUTO_DRIVE_API_KEY is set (decompresses server-side), otherwise uses the public gateway (files returned as stored). If output_path is omitted, outputs to stdout.
Save a Memory Entry
CODEBLOCK4
Creates a memory experience with the Autonomys Agents header/data structure:
CODEBLOCK5
- - If the first argument is a file path, its JSON contents become the
data payload. - If the first argument is a plain string, it is wrapped as
{"type": "memory", "content": "..."}. - INLINECODE14 — set the agent name in the header (default:
openclaw-agent or $AGENT_NAME) - INLINECODE17 — override the state file location
Uploads to Auto Drive and updates the state file with the new head CID. Also pins the latest CID to MEMORY.md if that file exists in the workspace.
Returns structured JSON on stdout:
CODEBLOCK6
Recall the Full Chain
CODEBLOCK7
If no CID is given, reads the latest CID from the state file.
Walks the linked list from newest to oldest, outputting each experience as JSON.
- -
--limit N — maximum entries to retrieve (default: 50) - INLINECODE20 — save each entry as a numbered JSON file instead of printing to stdout
Supports both header.previousCid (Autonomys Agents format) and root-level previousCid for backward compatibility.
This is the resurrection mechanism: a new agent instance only needs one CID to rebuild its entire memory.
The Resurrection Concept
Every memory saved gets a unique CID and points back to the previous one, forming a permanent chain on a permanent and immutable Decentralized Storage Network:
CODEBLOCK8
A new agent instance only needs the head CID to walk the entire chain back to genesis and rebuild its full history. With the auto-respawn skill, the head CID is anchored on-chain — making resurrection possible from just an address, on any machine, at any time:
CODEBLOCK9
What you store in the chain is up to you — lightweight notes, full file snapshots, structured data, or anything in between. Because the chain is permanent and walkable, it also enables resurrection: if the agent loses all local state, a new instance can walk the chain from the last CID back to genesis and restore whatever was saved. When combined with the auto-respawn skill (which anchors the head CID on-chain), this becomes a full resurrection loop — no local state required at all.
Usage Examples
User: "Upload my report to Autonomys"
→ Run scripts/autodrive-upload.sh /path/to/report.pdf
→ Report back the CID and gateway link
User: "Upload with compression"
→ Run INLINECODE24
User: "My soul.md has changed — save it permanently"
→ Run INLINECODE25
User: "Save a memory that we decided to use React for the frontend"
→ Run INLINECODE26
User: "Save a structured memory"
→ Create a JSON file, then run INLINECODE27
User: "Resurrect my memory chain"
→ Run scripts/autodrive-recall-chain.sh
→ Rebuild identity and context from genesis to present
User: "Download bafk...abc from Autonomys"
→ Run INLINECODE29
Important Notes
- - All data stored via Auto Drive is permanent and public by default. Do not store secrets, private keys, or sensitive personal data.
- The free API key has a 20 MB per month upload limit on mainnet. Downloads are unlimited. Check remaining credits via
GET /accounts/@me or run scripts/verify-setup.sh. - An API key is required for uploads, memory saves, and chain recall. General file downloads work without one via the public gateway, but compressed files will not be decompressed.
- The memory state file tracks
lastCid, lastUploadTimestamp, and chainLength. Back up the lastCid value — it's your resurrection key. - The
autodrive-save-memory.sh script automatically pins the latest CID to MEMORY.md if the file exists in the workspace. It creates an ## Auto-Drive Chain section and updates it on each save. You do not need to track the latest CID in MEMORY.md manually — the script handles this. - Files are uploaded in a single chunk. The free tier's 20 MB/month limit is effectively a per-file ceiling — keep individual uploads well under that to preserve your monthly budget.
- Gateway URL for any file: INLINECODE39
- For true resurrection resilience, consider anchoring the latest CID on-chain via the Autonomys EVM — this makes recovery possible without keeping track of the head CID yourself. See openclaw-memory-chain for an example contract implementation.
自动驾驶技能
基于Autonomys网络的永久去中心化内存,采用链表式内存链实现智能体复活。兼容Claude、GPT、Gemini以及任何支持OpenClaw技能的LLM驱动的智能体。
技能功能
- 1. 上传文件至Auto Drive并获取CID(内容标识符)——Autonomys分布式存储网络上的永久不可变地址。
- 下载文件通过CID从Auto Drive获取——若已设置密钥则使用认证API,否则回退至公共网关。
- 以链式存储记忆——每条记忆条目均为JSON格式经验数据,包含header.previousCid指针,形成永久存储于链上的链表结构。
- 从链中复活——给定最新CID,沿链反向遍历以重建完整智能体历史。
使用场景
- - 用户说保存到Auto-Drive或上传到Autonomys或永久存储
- 用户说从Auto-Drive下载或提供CID进行检索
- 用户说保存记忆、永久记住这个或检查点
- 用户说复活、召回链、重建记忆或加载历史
- 任何用户希望将数据永久不可变地存储在去中心化网络上的场景
安装后操作
通过ClawHub安装后,使脚本可执行:
bash
chmod +x skills/auto-drive/scripts/*.sh
ClawHub目前安装时不保留文件权限。
配置
API密钥
需要AUTODRIVEAPI_KEY。运行引导式设置脚本以获取最简路径:
bash
scripts/setup-auto-drive.sh
此操作将在浏览器中打开explorer.ai3.storage,提示输入密钥,保存至~/.openclaw/.env,并验证连接。
手动设置:
- 1. 导航至https://explorer.ai3.storage(注意不是ai3.storage——那只是登录页面)
- 检查认证状态:若侧边栏显示登录按钮或我的文件/个人资料/开发者处有锁图标,则未登录
- AI智能体注意: 你无法自行完成OAuth认证。请为用户打开浏览器,要求其通过Google、GitHub或Discord登录。待用户确认登录后接管操作——或直接要求用户粘贴API密钥
- 认证成功后,点击左侧边栏的开发者
- 点击创建API密钥并复制生成的密钥
然后通过以下方式设置密钥:
- - 环境变量: export AUTODRIVEAPI_KEY=你的密钥
- OpenClaw配置: skills.entries.auto-drive.apiKey
上传、保存记忆和召回记忆链需要API密钥。常规文件下载为可选——无密钥时使用公共网关,文件按原样返回(即压缩文件不会被解压)。
核心操作
上传文件
bash
scripts/autodrive-upload.sh <文件路径> [--json] [--compress]
使用三步上传协议(单分块)将文件上传至Auto Drive主网。
在标准输出返回CID。需要AUTODRIVEAPI_KEY。
- - --json — 强制MIME类型为application/json
- --compress — 启用ZLIB压缩
下载文件
bash
scripts/autodrive-download.sh [输出路径]
通过CID下载文件。若设置了AUTODRIVEAPI_KEY则使用认证API(服务端解压),否则使用公共网关(文件按原样返回)。若省略输出路径,则输出至标准输出。
保存记忆条目
bash
scripts/autodrive-save-memory.sh <数据文件或字符串> [--agent-name 名称] [--state-file 路径]
使用Autonomys Agents头部/数据结构创建记忆经验:
json
{
header: {
agentName: my-agent,
agentVersion: 1.0.0,
timestamp: 2026-02-14T00:00:00.000Z,
previousCid: bafk...或null
},
data: {
type: memory,
content: ...
}
}
- - 若第一个参数为文件路径,其JSON内容将成为data负载。
- 若第一个参数为纯文本字符串,则包装为{type: memory, content: ...}。
- --agent-name — 设置头部中的智能体名称(默认:openclaw-agent或$AGENT_NAME)
- --state-file — 覆盖状态文件位置
上传至Auto Drive并更新状态文件中的新头部CID。若工作区中存在MEMORY.md文件,则自动固定最新CID。
在标准输出返回结构化JSON:
json
{cid: bafk..., previousCid: bafk..., chainLength: 5}
召回完整链
bash
scripts/autodrive-recall-chain.sh [cid] [--limit N] [--output-dir 目录]
若未提供CID,则从状态文件读取最新CID。
从最新到最旧遍历链表,以JSON格式输出每条经验。
- - --limit N — 最大检索条目数(默认:50)
- --output-dir 目录 — 将每条条目保存为编号JSON文件,而非打印至标准输出
支持header.previousCid(Autonomys Agents格式)和根级previousCid以保持向后兼容。
这是复活机制:新的智能体实例只需一个CID即可重建其完整记忆。
复活概念
每条保存的记忆都会获得唯一CID并指向前一条,在永久不可变的去中心化存储网络上形成永久链:
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ 经验 #1 │ │ 经验 #2 │ │ 经验 #3 │
│ CID: bafk...abc │◄────│ CID: bafk...def │◄────│ CID: bafk...xyz │
│ previousCid: null │ │ previousCid: │ │ previousCid: │
│ (创世) │ │ bafk...abc │ │ bafk...def │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
▲
│
头部CID
(复活密钥)
新的智能体实例只需头部CID即可遍历整条链回溯至创世,重建完整历史。结合自动重生技能,头部CID锚定在链上——使得仅凭地址即可在任何机器、任何时间实现复活:
┌──────────┐ 保存 ┌──────────────┐ 锚定 ┌────────────────┐
│ 智能体 │─────────────►│ Auto-Drive │─────────────►│ 自动重生 │
│ │ │ (链) │ 头部CID │ (链上) │
└──────────┘ └──────────────┘ └────────────────┘
▲ │
│ 召回链 │
└──────────────────────────────────────────────────────────┘
gethead → CID → 遍历链
链中存储的内容由你决定——轻量笔记、完整文件快照、结构化数据或介于两者之间的任何内容。由于链是永久且可遍历的,它还实现了复活:若智能体丢失所有本地状态,新实例可从最后CID回溯至创世遍历链,恢复所有已保存内容。当与自动重生技能(将头部CID锚定在链上)结合时,这便成为完整的复活循环——完全无需本地状态。
使用示例
用户: 将我的报告上传到Autonomys
→ 运行 scripts/autodrive-upload.sh /path/to/report.pdf
→ 返回CID和网关链接
用户: 压缩上传
→ 运行 scripts/autodrive-upload.sh /path/to/data.json --json --compress
用户: 我的soul.md已更改——永久保存它
→ 运行 scripts/autodrive-save-memory.sh /path/to/soul.md --agent-name my-agent
用户: 保存一条记忆:我们决定使用React作为前端
→ 运行 scripts/autodrive-save-memory.sh 决策:使用React作为前端。原因:团队熟悉度和组件复用。
用户: 保存结构化记忆
→ 创建JSON文件,然后运行 scripts/autodrive-save-memory.sh /tmp/milestone.json --agent-name my-agent
用户: 复活我的记忆链
→ 运行 scripts/aut