Garry's Opinionated OpenClaw/Hermes Agent Brain
v0.49.0.0 — Memory inside existing agents and hosted access grants
Preserve the current agent's identity, memory, credentials, and unrelated instructions. Local installation and hosted access are separate paths. New local memory starts keyless; automatic capture and paid enrichment require opt-in.
Upgrade a hosted brain
Identify the brain's actual database, runtime, HTTP server, workers, and their process managers. Pause admission and stop the old servers and workers using that deployment's controls. Keep restart loops paused through migration. Do not run old and new authorization implementations against the same database.
Take a protected database and managed-file backup before upgrading. For PGLite, copy the complete database directory only after its owner has closed; do not remove a live lock. For PostgreSQL, use the deployment's consistent database backup procedure. A Git push alone does not include database-only facts, credentials, or accounting evidence. Keep backups private and upload only with explicit authorization.
Install the new runtime with the deployment's normal package or binary procedure. While servers and workers remain stopped, run:
gbrain apply-migrations --yes gbrain doctorCheck that schema migrations 147 and 148 completed. Migration 147 adds the shared grant contract. Migration 148 retains withdrawals across later source imports. Preserve the existing database if a step fails and resume the migration after resolving the reported cause; never initialize over it.
Review existing clients before restarting admission. Unusable legacy delegation loses only its
agentscope and records a repair reason. Other access remains. New restrictions are not filled with permissive defaults. Keep existing finite spending caps. Repair a client only with an explicit source, allowed tool set, write policy, and positive concurrency.Restart only the upgraded runtimes. Inspect the authenticated
gbrain://capabilitiesresource orwhoamifor each affected client. Follow its exact repair command and preview the permission change before applying it. Advanced host-side repair starts with:gbrain auth rescope-client CLIENT_ID --helpUse
--dry-runand--if-version REVISIONfor reviewed updates. Against a running PGLite server use the authenticated admin UI/API orgbrain mcp grantwith--admin-token-file; do not open the live database from another CLI process. Repair retains the client ID and secret.Verify a harmless memory round trip and cleanup. For a private handoff:
gbrain mcp verify --client CLIENT_ID --harness HARNESS_ID \ --url https://brain.example.com/mcp \ --credentials-file /absolute/private/client.json --jsonExit 2 reports incomplete actual-harness evidence, even when server checks pass. If delegation is required, explicitly run the separate
--delegatechallenge and check terminal completion. It may incur provider charges.
If rollout fails, disable affected entry points and use a compatible runtime that enforces the migrated grants. Preserve memory and tightened permissions. Do not roll back to an older authorization implementation against this schema.
Understand changed access behavior
- Removed scopes restrict existing tokens immediately. Added scopes need a newly issued token; refresh cannot expand the token's original scope ceiling.
- Source, operation, surface, fence, and binding changes apply on the next
authenticated request. Existing tokens carrying
agentbenefit from repaired bindings. TTL changes affect newly issued tokens. - New profiles snapshot eligible operations and source access. Explicit regrant
is required to add later operations. Legacy
NULLoperation snapshots preserve their existing operation behavior. Archived sources are excluded. - Snapshot-bound clients use approved MCP writes; the legacy
POST /ingestwebhook is unavailable to them. Existing webhook clients withNULLoperation snapshots retain compatibility. - New renewable connections use one-hour access tokens; static-token adapters retain 30 days. Read the handoff's reported expiry.
- New delegation defaults to unlimited spending and concurrency 1. Unlimited permits provider charges without a client spending cap. Existing finite caps stay finite unless explicitly changed. Unknown finite-client liabilities stay reserved until reconciled, including across midnight.
Update an existing agent's memory instructions
Back up the existing instruction file before updating GBrain-owned sections. Use the memory operating protocol: recall relevant context, save explicit remembering with provenance, verify corrections, and enable automatic capture only on request. Withdrawal removes a fact from active memory; history, source material, and backups may remain. Never promise physical erasure. Preserve every unrelated instruction.
For a local Grok Bot or Muse installation, follow the dedicated
Grok Bot or
Muse guide. Existing unowned roots require explicit
adoption. Recorded installs repair through their absolute bin/gbrain-setup;
upgrades require --upgrade. Use the recorded absolute launcher on every call.
Ask for the required search-mode choice before optional enrichment.
Do not invent native configuration paths or silently register platform routines. Generated instructions are pending until enabled through the actual harness. Observe calls in a fresh conversation before claiming cross-conversation recall. The validation checklist names the remaining platform checks; repository tests do not certify them.