Export and backup
Export an agexs brain space as Markdown files at any time, or back up every team memory to your own server each night with a plain cron script and a backup key.
Export
Export a space or everything you can read at any time: a zip with one Markdown file per memory.
Backup to your own server
A plain script (cron, no agent, no tokens spent) copies everything you read in a team to your own server. Run it nightly; after the first run it only fetches what changed.
1. Create a backup key
Team settings, Devices, Create backup key. Copy the key (srx_...), it is shown once. Store it on your
server, readable only by the backup user:
install -m 600 /dev/stdin /etc/axs-brain-backup.key <<< 'srx_...'The key only reads, only the backup routes below. It does not work for agents (MCP, hooks) or the dashboard. It
sees what you read in that team; one key per team. Revoke it under Devices like any device.
2. Fetch
Every call sends Authorization: Bearer srx_.... At most 120 calls per key and hour.
GET https://brain.axs.sh/api/v1/backup answers JSON:
generated_at: send it as?since=next time to get only changes.memories: every memory, retired ones too (withsince: only those changed after it). Each hasid,name,space,type(rule, procedure, fact, ...),scope,description,text,aliases,expires(valid until),status,retired,modified_at,meta(the whole frontmatter) andraw(the full Markdown file).memory_ids: all memory ids now. An id you have that is missing here was deleted.rules: your enforced rules in full, always all.files: files withname,size,sha256anddownload(withsince: only new ones).file_ids: all now.spaces,team: names and descriptions.
GET https://brain.axs.sh/api/v1/backup/files/{id} redirects to the file's bytes (send the key, follow the
redirect). Do not send the key to the redirect target: the storage link is already signed and answers 400 when
it gets an Authorization header. curl drops it on its own; in Python use
req.add_unredirected_header("Authorization", "Bearer " + key).
3. The script
Keeps memories.json, rules.json and files/ in one folder and applies only the changes each night.
#!/bin/sh
# /usr/local/bin/axs-brain-backup
set -eu
KEY=$(cat /etc/axs-brain-backup.key)
DIR=/srv/backup/axs-brain
mkdir -p "$DIR/files"
SINCE=$(cat "$DIR/since" 2>/dev/null || true)
curl -fsS -H "Authorization: Bearer $KEY" \
"https://brain.axs.sh/api/v1/backup${SINCE:+?since=$SINCE}" > "$DIR/new.json"
KEY="$KEY" python3 - "$DIR" <<'EOF'
import json, os, subprocess, sys
d = sys.argv[1]
new = json.load(open(f"{d}/new.json"))
path = f"{d}/memories.json"
mem = json.load(open(path)) if os.path.exists(path) else {}
mem.update({m["id"]: m for m in new["memories"]})
keep = set(new["memory_ids"])
mem = {i: m for i, m in mem.items() if i in keep}
json.dump(mem, open(path, "w"), ensure_ascii=False, indent=1)
json.dump(new["rules"], open(f"{d}/rules.json", "w"), ensure_ascii=False, indent=1)
for f in new["files"]:
out = f"{d}/files/{f['id']}-{f['name'].replace('/', '_')}"
if not os.path.exists(out):
subprocess.run(["curl", "-fsSL", "-H", "Authorization: Bearer " + os.environ["KEY"],
"-o", out, "https://brain.axs.sh" + f["download"]], check=True)
open(f"{d}/since", "w").write(new["generated_at"])
EOFRun it nightly:
chmod +x /usr/local/bin/axs-brain-backup
echo '30 3 * * * root /usr/local/bin/axs-brain-backup' > /etc/cron.d/axs-brain-backupTo start over with a full copy, delete since.
Restore
raw of each memory is the Markdown file agexs brain stores. Put them in a folder and ask your agent to import it
(see Import agent notes), or keep them as plain notes.
Security and data location
How agexs protects your data: per team encryption and row level security in agexs brain, credentials encrypted in your browser for agexs cred, servers in the EU.
How agexs brain works
agexs brain is shared long term memory for AI agents: it saves lessons while you work, puts the right memories into each session and enforces your team rules.