A database backup can exist, have a checksum and still leave a practical question unanswered: can the application recover from it? For a memory system, recovery means more than opening a dump file. Memories, revisions, embeddings and access decisions need to work together after restoration.
METABOLIQ Brain now includes logical backup and restore scripts and an automated recovery drill. We ran that drill against an exported snapshot of the merged implementation, using fictional data and separate containers, ports and storage. We also exercised boundaries that a successful happy-path restore can hide.
The distinction is deliberate: this is evidence about a controlled recovery mechanism. It is not verification of a particular live backup, a disaster-recovery service-level commitment or production readiness. The accepted operating scope remains one owner on a trusted local machine.
Define what must come back
The backup script creates a PostgreSQL custom-format logical dump. The database contains memories, revision snapshots, audit records, namespaces, owner accounts and sessions, agent credential hashes and grants, and stored embeddings. Keeping these together gives recovery a more useful target than restoring memory text alone.
Embeddings matter because search behavior depends on both the source records and their derived representation. Revision and audit records matter because the latest text is only part of the system's history. Credential and grant state matters because restored data must still be accessed through the application's boundaries.
The dump does not contain the deployment environment file or the model files. Those require separate recovery arrangements. The accepted image build uses pinned model artifacts; database restoration alone does not recreate every dependency needed to run the application.
The drill must cross the storage-loss boundary
The supplied drill starts a disposable stack, seeds four fictional memories across two namespaces, edits one, archives another and creates an agent credential. It waits for indexing, records search results and captures database fingerprints before taking a backup.
It then removes that test stack and its database volume, restores into fresh storage and compares the recovered state. Reusing the original database would not demonstrate recovery from losing its storage.
The fingerprint combines row counts with checks of selected memory fields and stored vectors, plus the schema migration revision. The script uses MD5 for these comparison fingerprints. They are regression checks for this fixture, not a cryptographic authenticity guarantee or a complete byte-for-byte comparison of every database field.
Behavior checks log the owner in again, use the same fictional agent token and compare owner hybrid, agent hybrid and keyword result identifiers. The drill also checks restored index readiness, a revision update guard and refusal to restore over a populated public schema.
Restored vectors are useful evidence, with limits
Matching stored-vector fingerprints and matching search results provide complementary evidence. One checks the representation that survived the dump; the other checks that the application can use it.
The drill's seeded records retain ready embeddings after recovery. This supports a narrow statement about those records. It does not mean every restored database can skip index reconciliation: stale or incompatible embeddings may require work, and model artifacts still have to be available.
A four-memory fixture also says little about recovery duration for a large corpus. We did not establish a recovery-time objective, a large-database benchmark or portability across PostgreSQL major versions and arbitrary extension builds.
Checksums help only when the check runs
The backup script checks that its output is non-empty and that PostgreSQL can list the archive. It writes a SHA-256 sidecar. In an additional case, changing the dump while retaining the old checksum caused restoration to stop before altering the populated test database.
There is an important qualification: the restore script verifies the sidecar only when it exists. Our valid dump without a sidecar was accepted. Describing the current script as requiring checksum verification for every restore would therefore be inaccurate.
A checksum is also not proof of authenticity. If an attacker can replace both the dump and its checksum, that pair can agree. Nor does a successful checksum check establish that credentials, configuration, models and application behavior can all be recovered.
An empty-target guard needs a precise definition
The restore script counts tables in PostgreSQL's public schema and refuses when that count is nonzero. We tested that refusal and confirmed that the populated fixture's counts remained unchanged.
The wording matters: this is a public-schema table check, not a proof that the whole database is empty. A separate test created a table in another schema. The script proceeded, and that table remained alongside the restored Brain tables.
The safe recovery workflow therefore uses a new, isolated target whose identity and contents are known. The guard should be treated as one check within that workflow, not a substitute for identifying the intended database. We did not test every interrupted-restore or partial-failure scenario.
A backup contains sensitive data—and earlier access state
These dumps are not encrypted by the scripts. They contain readable memory content after restoration, along with sensitive account, session and credential metadata. A custom-format archive is a storage format, not encryption.
On our Linux test filesystem, newly created dump and checksum files had mode 0600. A second test exposed a boundary of that default: overwriting an existing mode-0644 dump did not tighten its permissions. The script's restrictive umask governs creation; it does not repair the mode of an existing file.
Restrictive permissions are useful, but encrypted storage, protected keys, off-machine copies and retention remain separate operational responsibilities. This article does not establish that those controls are configured for the live system.
There is another consequence of restoring a point-in-time snapshot: it restores earlier credential state. We backed up a fictional active agent, revoked it and confirmed that the current database rejected its token. After restoring the earlier dump into a fresh test database, that token authenticated again.
That is not evidence that revocation failed in the original database. The restore returned to a state before revocation. Recovery procedures need an explicit decision about credentials and sessions after the backup point; they should not assume that every later access change survives restoring older data.
In that restored fixture, the owner could log in, the agent could read its permitted Work record, and Personal and over-ceiling records remained inaccessible. Additional checks confirmed that restored revision and audit update guards still rejected ordinary mutations.
What this verification establishes
The article's verification separates the supplied end-to-end drill from eight additional recovery-boundary checks. Those cases covered new-file permissions, checksum mismatch, public-schema refusal, restored authentication and access scope, earlier credential state, restored update guards, missing-sidecar behavior, existing-file permissions and a target containing another schema.
The cases used fictional identities and records in disposable databases. No live dump was opened or restored. The source baseline matches the merged recovery commit identified in the Brain review records; remote freshness could not be independently confirmed because the configured Git credential helper was unavailable.
Logical backups preserve a snapshot, not every change made afterward. These scripts do not implement continuous log archiving or point-in-time recovery. We did not verify backup scheduling, encryption, off-site retention, recovery-key management or restoration of the particular live backup mentioned in the project records.
A successful drill is a meaningful step because it exercises the application after the storage boundary has changed. It is also a bounded result. Trust in recovery grows when the procedure is repeated against the backup, data scale and operating environment that actually need to be recovered.
← All engineering articles