{"skill":{"slug":"auto-drive","displayName":"auto-drive","summary":"Indestructible agent memory — permanently stored, never lost. Save decisions, identity, and context as a memory chain on the Autonomys Network. Rebuild your...","description":"---\nname: auto-drive\ndescription: Indestructible agent memory — permanently stored, never lost. Save decisions, identity, and context as a memory chain on the Autonomys Network. Rebuild your full history from a single CID, even after total state loss.\nmetadata:\n  openclaw:\n    emoji: \"🧬\"\n    primaryEnv: AUTO_DRIVE_API_KEY\n    requires:\n      bins: [\"curl\", \"jq\", \"file\"]\n      env: [\"AUTO_DRIVE_API_KEY\"]\n    install:\n      - id: curl-brew\n        kind: brew\n        formula: curl\n        bins: [\"curl\"]\n        label: \"Install curl (brew)\"\n      - id: jq-brew\n        kind: brew\n        formula: jq\n        bins: [\"jq\"]\n        label: \"Install jq (brew)\"\n      - id: file-brew\n        kind: brew\n        formula: file-formula\n        bins: [\"file\"]\n        label: \"Install file (brew)\"\n---\n\n# Auto-Drive Skill\n\nPermanent 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.\n\n## What This Skill Does\n\n1. **Upload files** to Auto Drive and get back a CID (Content Identifier) — a permanent, immutable address on the Autonomys distributed storage network.\n2. **Download files** from Auto Drive using a CID — uses the authenticated API if a key is set, otherwise falls back to the public gateway.\n3. **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.\n4. **Resurrect from a chain** — given the latest CID, walk the chain backwards to reconstruct full agent history.\n\n## When To Use This Skill\n\n- User says \"save this to Auto-Drive\" or \"upload to Autonomys\" or \"store permanently\"\n- User says \"download from Auto-Drive\" or provides a CID to retrieve\n- User says \"save memory\", \"remember this permanently\", or \"checkpoint\"\n- User says \"resurrect\", \"recall chain\", \"rebuild memory\", or \"load history\"\n- Any time the user wants data stored permanently and immutably on a decentralized network\n\n## Post-Install\n\nAfter installing via ClawHub, make the scripts executable:\n\n```bash\nchmod +x skills/auto-drive/scripts/*.sh\n```\n\nClawHub does not currently preserve file permissions during install.\n\n## Configuration\n\n### API Key\n\nRequires an `AUTO_DRIVE_API_KEY`. Run the guided setup script for the easiest path:\n\n```bash\nscripts/setup-auto-drive.sh\n```\n\nThis opens [explorer.ai3.storage](https://explorer.ai3.storage/mainnet/drive/developers) in your browser, prompts for the key, saves it to `~/.openclaw/.env`, and verifies the connection.\n\n**Manual setup:**\n\n1. Navigate to **https://explorer.ai3.storage** (not `ai3.storage` — that's just the landing page)\n2. Check authentication: if the sidebar shows a \"Log In\" button or lock icons on My Files / Profile / Developers, you are not signed in\n3. **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\n4. Once authenticated, click **Developers** in the left sidebar\n5. Click **Create API Key** and copy the generated key\n\nThen set the key via:\n\n- **Environment:** `export AUTO_DRIVE_API_KEY=your_key_here`\n- **OpenClaw config:** `skills.entries.auto-drive.apiKey`\n\nThe 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).\n\n## Core Operations\n\n### Upload a File\n\n```bash\nscripts/autodrive-upload.sh <filepath> [--json] [--compress]\n```\n\nUploads a file to Auto Drive mainnet using the 3-step upload protocol (single chunk).\nReturns the CID on stdout. Requires `AUTO_DRIVE_API_KEY`.\n\n- `--json` — force MIME type to `application/json`\n- `--compress` — enable ZLIB compression\n\n### Download a File\n\n```bash\nscripts/autodrive-download.sh <cid> [output_path]\n```\n\nDownloads 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.\n\n### Save a Memory Entry\n\n```bash\nscripts/autodrive-save-memory.sh <data_file_or_string> [--agent-name NAME] [--state-file PATH]\n```\n\nCreates a memory experience with the Autonomys Agents header/data structure:\n\n```json\n{\n  \"header\": {\n    \"agentName\": \"my-agent\",\n    \"agentVersion\": \"1.0.0\",\n    \"timestamp\": \"2026-02-14T00:00:00.000Z\",\n    \"previousCid\": \"bafk...or null\"\n  },\n  \"data\": {\n    \"type\": \"memory\",\n    \"content\": \"...\"\n  }\n}\n```\n\n- If the first argument is a **file path**, its JSON contents become the `data` payload.\n- If the first argument is a **plain string**, it is wrapped as `{\"type\": \"memory\", \"content\": \"...\"}`.\n- `--agent-name` — set the agent name in the header (default: `openclaw-agent` or `$AGENT_NAME`)\n- `--state-file` — override the state file location\n\nUploads 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.\n\nReturns structured JSON on stdout:\n\n```json\n{\"cid\": \"bafk...\", \"previousCid\": \"bafk...\", \"chainLength\": 5}\n```\n\n### Recall the Full Chain\n\n```bash\nscripts/autodrive-recall-chain.sh [cid] [--limit N] [--output-dir DIR]\n```\n\nIf no CID is given, reads the latest CID from the state file.\nWalks the linked list from newest to oldest, outputting each experience as JSON.\n\n- `--limit N` — maximum entries to retrieve (default: 50)\n- `--output-dir DIR` — save each entry as a numbered JSON file instead of printing to stdout\n\nSupports both `header.previousCid` (Autonomys Agents format) and root-level `previousCid` for backward compatibility.\n\nThis is the **resurrection** mechanism: a new agent instance only needs one CID to rebuild its entire memory.\n\n## The Resurrection Concept\n\nEvery 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:\n\n```\n┌─────────────────────┐     ┌─────────────────────┐     ┌─────────────────────┐\n│  Experience #1      │     │  Experience #2      │     │  Experience #3      │\n│  CID: bafk...abc    │◄────│  CID: bafk...def    │◄────│  CID: bafk...xyz    │\n│  previousCid: null  │     │  previousCid:       │     │  previousCid:       │\n│  (genesis)          │     │  bafk...abc         │     │  bafk...def         │\n└─────────────────────┘     └─────────────────────┘     └─────────────────────┘\n                                                                   ▲\n                                                                   │\n                                                               HEAD CID\n                                                           (resurrection key)\n```\n\nA 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:\n\n```\n┌──────────┐    save      ┌──────────────┐    anchor    ┌────────────────┐\n│  Agent   │─────────────►│  Auto-Drive  │─────────────►│  Auto-Respawn  │\n│          │              │  (chain)     │   head CID   │  (on-chain)    │\n└──────────┘              └──────────────┘              └────────────────┘\n      ▲                                                          │\n      │                     recall chain                         │\n      └──────────────────────────────────────────────────────────┘\n                      gethead → CID → walk chain\n```\n\nWhat 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.\n\n## Usage Examples\n\n**User:** \"Upload my report to Autonomys\"\n→ Run `scripts/autodrive-upload.sh /path/to/report.pdf`\n→ Report back the CID and gateway link\n\n**User:** \"Upload with compression\"\n→ Run `scripts/autodrive-upload.sh /path/to/data.json --json --compress`\n\n**User:** \"My soul.md has changed — save it permanently\"\n→ Run `scripts/autodrive-save-memory.sh /path/to/soul.md --agent-name my-agent`\n\n**User:** \"Save a memory that we decided to use React for the frontend\"\n→ Run `scripts/autodrive-save-memory.sh \"Decision: using React for frontend. Reason: team familiarity and component reuse.\"`\n\n**User:** \"Save a structured memory\"\n→ Create a JSON file, then run `scripts/autodrive-save-memory.sh /tmp/milestone.json --agent-name my-agent`\n\n**User:** \"Resurrect my memory chain\"\n→ Run `scripts/autodrive-recall-chain.sh`\n→ Rebuild identity and context from genesis to present\n\n**User:** \"Download bafk...abc from Autonomys\"\n→ Run `scripts/autodrive-download.sh bafk...abc ./downloaded_file`\n\n## Important Notes\n\n- All data stored via Auto Drive is **permanent and public** by default. Do not store secrets, private keys, or sensitive personal data.\n- 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`.\n- 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.\n- The memory state file tracks `lastCid`, `lastUploadTimestamp`, and `chainLength`. Back up the `lastCid` value — it's your resurrection key.\n- 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.\n- 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.\n- Gateway URL for any file: `https://gateway.autonomys.xyz/file/<CID>`\n- 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](https://github.com/autojeremy/openclaw-memory-chain) for an example contract implementation.\n","tags":{"agent-memory":"1.0.4","auto-drive":"1.0.4","autonomys":"1.0.4","decentralized":"1.0.4","immutable":"1.0.4","latest":"1.0.4","long-term":"1.0.4","memory":"1.0.4","persistence":"1.0.4","resurrection":"1.0.4","storage":"1.0.4","latest memory storage auto-drive resurrection agent-memory persistence immutable long-term decentralized autonomys":"1.0.3"},"stats":{"comments":0,"downloads":1124,"installsAllTime":0,"installsCurrent":0,"stars":1,"versions":5},"createdAt":1771452860454,"updatedAt":1778491578254},"latestVersion":{"version":"1.0.4","createdAt":1772215994657,"changelog":"Version 1.0.4 of auto-drive\n\n- Updated tags","license":null},"metadata":{"setup":[{"key":"AUTO_DRIVE_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"emilfattakhov","userId":"s173bfytsj63nttjj93m4gxm0s8857c5","displayName":"Emil Fattakhov","image":"https://avatars.githubusercontent.com/u/66026548?v=4"},"moderation":null}