Bring memory in and take it out
Backups and restore
MemIndex keeps copies of your memory database for you, so a bad day does not cost you your history. You can save one yourself and restore any of them.
Automatic copies
Every 24 hours, MemIndex saves a checked copy of your database in the snapshots folder of your memory folder, and keeps the newest seven. It also saves one when the service starts if the newest copy is older than that. Copying runs in a separate process, so your agent keeps working.
| Setting | Default | What it does |
|---|---|---|
MEMINDEX_SNAPSHOT_ENABLED |
true |
false stops the automatic copies. |
MEMINDEX_SNAPSHOT_INTERVAL_HOURS |
24 |
Hours between copies. |
MEMINDEX_SNAPSHOT_KEEP |
7 |
Copies kept. Older ones are removed. |
A copy holds the database only. It does not hold settings.json, .env or your corpora, so back those up too, and copy backups to another device to protect against a lost disk. See Export, import and move machines.
Save one now
npx memindex snapshot
npx memindex snapshot list
Snapshot saved: ~/.memindex/snapshots/memindex-2026-11-16T03-26-49-294Z.db
snapshot list prints every saved copy, newest first.
Restore
Stop the service first. Restore refuses to run while it is up.
npx memindex stop
npx memindex snapshot restore latest
npx memindex start
Memory restored: ~/.memindex/memindex.db
Previous database kept: ~/.memindex/memindex.db.before-restore-2026-11-16T03-27-23-592Z
Use npx memindex snapshot restore <file> to restore a particular copy. MemIndex checks the copy first and keeps the database it replaces, so you can go back. Search by meaning rebuilds from the restored notes in the background.