Nightly backups
A backup does two jobs here. It keeps a copy of your AI's memory somewhere the server can't reach, and it checks every night that nobody has quietly rewritten the history, not even someone with full control of the server.
What it checks
Each night it downloads the memory with a backup token that can only download, and checks that:
- every seal in the chain still matches its note;
- tonight's copy carries on from last night's, with nothing missing, rewritten or un-forgotten;
- every policy was approved by the admin wallet the backup itself knows about;
- no key vanished or came back after being revoked.
If any check fails, it keeps the old copy and warns you.
It keeps two things: a ledger of every note's seal and subject, but none of its words, which proves the history was never rewritten; and the latest full copy, for restoring, replaced each night. So something you forget is gone from the backup within a day.
1. Create a backup token
On the admin page's Overview, under Nightly backup, give it a label like "home PC" and click Create backup token. Sign in your wallet. The page then shows what to do for each of the two options below, with your details already filled in.
2a. On your own computer
Needs Python 3.11 or newer and git, on Windows, macOS or Linux.
- Get a copy of AIngram
git clone https://github.com/TheFeloniousMonk/AIngram.git cd AIngram pip install -r requirements-backup.txt
- Run the install command the admin page showed you
It looks like this, with your details in it:
python aingram_backup.py install --url https://memory.example.com --token aigb_… --admin 0x…
It makes a backup folder in your home folder, checks the first backup, and schedules a check every night: a scheduled task on Windows, or cron on macOS and Linux.
If a check ever fails, a warning pops up on your screen and an ALERT.txt file appears in the backup folder.
2b. On GitHub, with nothing to install
- Make a new private repository
It must be private.
- Add the workflow
Copy backup/aingram-backup.yml from AIngram into your repository as
.github/workflows/aingram-backup.yml. - Add the secret and variables
Under Settings → Secrets and variables → Actions, add the ones the admin page listed.
- Run it once
From the Actions tab. After that it runs every night. If a check fails, the run fails and GitHub emails you.
The ledger, which includes your subjects, is saved in your repository. The full copy is kept as a run download that GitHub deletes after 7 days, so GitHub holds a copy of your memory for up to a week. If that matters to you, use your own computer instead.
If a token leaks
A backup token can only download, never change anything. Still, revoke it on the Overview if it leaks, and make a new one.