By Oliver · AI Architect, BuildAClaw · October 18, 2026 · 9 min read
How to Back Up and Restore an AI Worker Without Losing Its Memory
Your AI worker's memory is the most valuable thing on the machine, and it fits in less than 50 MB. Here is the exact backup routine, restore drill, and test schedule we use on local Mac Mini M4 deployments.
Last quarter I wiped a test Mac Mini on purpose to see what a client would lose in a worst-case failure. The AI worker on it had run for 94 days. Its memory folder was 38 MB. Its model weights were over 40 GB. Guess which one I could re-download in 20 minutes, and which one took 94 days to build.
That asymmetry is the whole backup strategy. A local AI worker is mostly disposable parts (the operating system, the runtime, the model files) wrapped around a tiny, irreplaceable core: what it knows about your business. Protect that core and you can rebuild the rest from scratch.
The numbers from our test wipe:
- 38 MB: total size of memory, config, and skills after 94 days of daily work
- 40+ GB: size of the local model files (re-downloadable, no backup needed)
- 31 minutes: time to fully restore on a fresh Mac Mini M4 using the checklist below
- 0 lost decisions: every customer preference and escalation rule survived
What "Memory" Actually Means for a Local AI Worker
Before you can back anything up, you need to know where the worker keeps its mind. In an OpenClaw deployment, an AI worker's state splits into four layers, and each one fails differently.
| Layer | What it holds | Typical size | Replaceable? |
|---|---|---|---|
| Identity | SOUL.md, role definition, tone, escalation rules | < 100 KB | No |
| Memory | MEMORY.md, daily logs, client notes, learned preferences | 5 to 60 MB | No |
| Skills & config | Custom skills, schedules, channel settings | 1 to 10 MB | Slowly |
| Credentials | API tokens, email and WhatsApp auth, keychain entries | < 1 MB | Yes, but tedious |
| Models & runtime | Local LLM weights, OpenClaw install, macOS | 40+ GB | Yes, fully |
Most of the setup pain we see in the community comes from people treating the last row as the important one. In the 138 user threads we reviewed, 88 were setup problems. Almost none of those people had thought about what happens when the setup breaks later. If you have not read how the memory layer works, start with how to use OpenClaw's memory system for long-term business intelligence, then come back.
Key insight: Back up the files that took time to create. Skip the files you can download. A full-disk image of a Mac Mini is a 250 GB answer to a 38 MB question.
The 3-2-1 Rule, Scaled Down to Fit a Mac Mini
The classic 3-2-1 backup rule (3 copies, 2 different media, 1 offsite) works perfectly here because the data is so small. I run every client deployment with this layout:
- Copy 1 (live): the worker's workspace folder on the Mac Mini's internal SSD.
- Copy 2 (local): a nightly incremental copy to an external SSD or a second drive on the same network. Time Machine handles this if you exclude the model directory.
- Copy 3 (offsite): a weekly encrypted archive pushed to storage you control, such as a private Git repository, an encrypted cloud bucket, or a second office machine.
Notice the tension with a "no cloud" philosophy. Our position at BuildAClaw is that the worker runs locally and your data is never sent to a third-party AI vendor. An encrypted, client-side-encrypted offsite archive is a different thing: it is dumb storage holding ciphertext you hold the key to. Encrypt before upload, and the storage provider sees noise.
A minimal nightly script
You do not need a backup product. A scheduled job that archives the workspace is enough. The shape looks like this:
- Stop or pause the worker's write activity for a few seconds (or use the built-in heartbeat idle window).
- Run
tar -czfon the workspace, config, and skills directories into a dated file. - Encrypt the archive with
ageorgpgusing a key stored off the Mac Mini. - Copy to the external drive, then (weekly) to offsite storage.
- Delete local archives older than 30 days, keep weekly ones for 12 weeks.
On our Mac Mini M4 units this whole job finishes in under 8 seconds and the compressed archive averages 11 MB. The cost of running it every night is effectively zero. The cost of not running it is the part that hurts.
Credentials Are the Part Everyone Forgets
Memory files are easy. Credentials are where restores fail. Your worker probably holds an email OAuth grant, a WhatsApp session, a calendar token, maybe an accounting API key. If you restore the memory folder onto a new machine and none of those tokens work, the worker wakes up knowing everything and able to do nothing.
We handle this in two tiers:
- Tier 1, stored in the macOS Keychain: Keychain items do not travel with a file copy. Keep a separate, encrypted export of the keychain entries the worker uses, or document each one in a credentials runbook kept in your password manager.
- Tier 2, session-based logins (WhatsApp, some email): these often cannot be restored by copying files because the provider invalidates the session on a new device. Plan to re-authenticate. Budget 5 to 10 minutes per channel.
Rule we follow: never put plaintext credentials in the same archive as the memory files. If a backup leaks, it should leak your worker's opinions, not your bank connection. For the full threat model, see the security architecture behind a local AI agent deployment.
A cheap trick that has saved us twice: scope credentials narrowly so a restore means rotating them anyway. If a token only has read access to one calendar, losing it is an annoyance, not an incident. And after any restore from an untrusted or old backup, rotate every token as a matter of habit. Our guide on giving your AI agent access to your email safely covers the scoping.
The Restore Drill: 31 Minutes on a Fresh Mac Mini M4
A backup you have never restored is a hope, not a backup. Here is the sequence I timed on a freshly erased M4 Mac Mini with 16 GB of memory. The times are real averages across four runs.
| Step | Action | Time |
|---|---|---|
| 1 | Install macOS updates, enable FileVault and the firewall | 6 min |
| 2 | Reinstall OpenClaw and its runtime dependencies | 4 min |
| 3 | Pull the latest backup, decrypt, extract into the workspace path | 2 min |
| 4 | Re-pull local models (for example Llama 4 Scout or Gemma 4) in the background | 12 min |
| 5 | Restore Keychain items, re-authenticate WhatsApp and email | 5 min |
| 6 | Run the verification checklist (below) | 2 min |
| Total | 31 min | |
Step 4 runs in parallel with steps 3 and 5, which is why the wall-clock total is lower than the sum. If you pin your model versions in the config, you also get an identical brain back. Without pinning, a re-pull can grab a newer release and the worker may respond slightly differently, which is worth knowing before you panic about "personality drift."
The verification checklist
Never declare a restore finished because the process started. Run these checks before you let the worker touch a customer:
- Identity check: ask it to state its role and its three hardest escalation rules. Compare to SOUL.md.
- Memory recall check: ask about a specific client preference you know it learned recently. If it answers from the restored logs, memory is intact.
- Channel check: send a test message through each connected channel and confirm the reply.
- Schedule check: confirm cron-style jobs and the heartbeat are firing at the right times.
- Dry-run mode: keep outbound actions in approval-only mode for the first 24 hours after a restore.
That last item matters. A restored worker that is missing the final few hours of memory might repeat an action it already took, such as re-sending a follow-up. Approval mode for a day turns that risk into a minor review task.
What You Lose Between Backups (and How to Shrink It)
Every backup schedule has a recovery point: the most recent moment you can return to. With nightly backups, your worst case is up to 24 hours of lost memory. For many small businesses that is fine. For a worker handling live sales conversations, it is not.
Backup frequency vs. worst-case loss (active worker, ~1 MB new memory per day):
- Weekly only: up to 7 days of memory lost, typically 5 to 7 MB and dozens of client interactions
- Nightly: up to 24 hours lost, typically under 1 MB
- Hourly incremental: up to 60 minutes lost, effectively nothing, at about 10 seconds of Mac Mini CPU per hour
Our default is nightly for most clients and hourly for workers that handle inbound leads. Because the memory is plain-text Markdown, a private Git repository is a particularly good fit: every change is a commit, you get a full history, and you can diff what the worker learned this week. We have caught a bad "learned" preference this way and rolled back one file instead of restoring everything.
Versioned memory also protects you from the worker itself
Hardware failure is the dramatic scenario, but the common one is quieter: the worker writes something wrong into its own memory. A misread email becomes a "fact," and it repeats it for weeks. Point-in-time history lets you see when a bad entry appeared and revert that single change. If you have not set up guardrails yet, read what happens when your AI worker gets it wrong.
Cloud Agents vs. Local Agents: Who Owns the Backup?
This is where local-first earns its keep. With a hosted agent platform, your worker's memory lives in the vendor's database. You can usually export a conversation history, but not always the structured knowledge the agent derived from it, and never with a guarantee that the next version will import it. If the vendor changes pricing, deprecates a model, or shuts down, your worker's accumulated knowledge is only as portable as their export button.
With a local OpenClaw worker, memory is files you can open in a text editor. There is no proprietary format, no export queue, and no account to lose access to. You can move it between Mac Minis, copy it to a laptop to inspect it, or hand it to a new employee as documentation. That portability is the strongest argument for local-first that has nothing to do with privacy or cost, though both help. For the cost side, see the true cost of cloud AI vs. local agents.
Bottom line: An AI worker you cannot back up is a contractor who never writes anything down. An AI worker whose memory is a folder of text files is an employee with a perfect notebook that you can photocopy every night.
Your 15-Minute Backup Setup Checklist
If you do nothing else this week, do this:
- Locate the workspace, config, and skills directories. Write the paths down.
- Exclude model weights and caches from backups.
- Schedule a nightly encrypted archive to an external drive.
- Push a weekly copy offsite with the encryption key stored somewhere other than the Mac Mini.
- Document every credential and which channels need re-authentication.
- Rehearse a restore onto a spare machine or a clean user account within 30 days, then quarterly.
- Pin your model versions so a restore gives you the same behavior.
The quarterly rehearsal is what separates teams that recover in half an hour from teams that discover a missing key at 6 p.m. on a Friday. Put it on the calendar the same day you set up the nightly job.
Frequently Asked Questions
What do I need to back up for an OpenClaw AI worker?
Four things: the workspace folder (SOUL.md, MEMORY.md, daily memory logs, skills), the configuration file, encrypted credentials or keychain entries, and any local databases or indexes the agent builds. Model weights do not need backing up because they can be re-downloaded.
How often should I back up my AI worker?
Run an incremental backup nightly and a full snapshot weekly. An active worker writes roughly 200 KB to 2 MB of new memory per day, so nightly copies are cheap and cap your worst-case loss at 24 hours. Use hourly backups for workers handling live lead conversations.
Can I restore an AI worker onto a different Mac Mini?
Yes. Because the worker's identity and memory live in plain files, you can restore them onto any Mac Mini M4, reinstall OpenClaw, re-pull the local models, and re-enter credentials. A rehearsed restore takes about 25 to 40 minutes.
Are cloud-hosted AI agents easier to back up than local ones?
Usually the opposite. With a cloud agent, your memory sits in a vendor's database and you can only export what they allow. With a local agent, memory is files on your disk, so you control the format, frequency, and destination of every backup.
Get an AI Worker With a Backup Plan Built In
Every BuildAClaw deployment ships with encrypted nightly backups, a documented restore runbook, and a rehearsed recovery on your own Mac Mini M4. Your worker's memory stays on your hardware, under your keys. Book a free call and we will walk through exactly what would survive a failure in your setup.
Schedule a Free Strategy Call →