Set up GBrain memory
Give the agent the user already has a reliable memory. Preserve its identity,
native memory, existing instructions, and unrelated configuration. Start with
keyless storage and keyword retrieval. A private repository, identity interview,
automatic capture, paid API key, or background service is not a prerequisite.
Contract
- Select the intended brain and source before inspecting or changing installation state.
- Reuse a healthy installation; diagnose partial or conflicting state without reinitializing memory.
- Relay the mandatory search-mode matrix and obtain the operator's choice.
- Save explicit memories with provenance and verify a randomized write/readback.
- Report software installation, native instruction activation, and cross-conversation recall separately.
- Automatic capture, imports, connectors, schedules, and paid enrichment require explicit opt-in.
setup_history imports past sessions: run its import argv only on a yes (the range on a second yes).
Phase 1: Choose the path
Use the user's existing context; do not repeat choices they already made.
| Intent |
Action |
| Add memory inside Grok Bot |
First choice: use the brain on your own computer over MCP — remote-mcp publishes it (--funnel, the Bot runs in the vendor cloud), then hosted harness access installs the private handoff in the Bot. No always-on machine: follow Grok Bot and the isolated setup helper. Root: /workspace/gbrain, with data under .gbrain. |
| Add memory inside Muse |
First choice: use the brain on your own computer over MCP — remote-mcp publishes it (--funnel), then hosted harness access installs the private handoff in Muse. No always-on machine: follow Muse. Either way, establish its durable user-files location first. Do not invent MUSE.md, a persistent path, or a native MCP mechanism. |
| Memory for a bot that answers several people |
gbrain setup <harness> --serves several --members <id,...>; ask the user who the people are, never guess. With no owner set it names one (--owner <id>, default the login name); relay its unbound lines, and rescope a key only on the user's word. Relay key file paths, never keys, and the open pages lines: ask who reads each folder (--labelled-only only on their word); keep the owner in every --readers list, and pass --allow-without-owner only on their word. On setup_history_choice_required, ask whether the existing pages stay private (--labelled-only) or every member reads them (--open-history); never choose for the user. When a re-run's company/ rule readers wait for gbrain access apply, relay it and approve only on the user's word. Fix a setup_serves_several, requester_scope_required or credential_scope_required refusal with its fix. Pass --stdio-member <id> (claude-code, codex) only for a harness one person uses: it binds that harness's entry alone; refused where OpenClaw or Hermes runs. With --shape company setup ties its own entry to the owner; relay each call's readers line. Guide. |
| Add memory to another existing agent |
Follow INSTALL_FOR_AGENTS.md; the coding-agent tutorial covers Claude Code and Codex. |
| Connect an existing hosted brain |
Follow mcp-access and hosted harness access. Select native OAuth/PKCE or a private machine handoff for the intended harness. |
| Use the brain from other devices, apps or cloud agents over MCP |
Follow remote-mcp: gbrain mcp expose publishes the local server on the Tailscale tailnet (Funnel only for cloud agents), then mcp-access / hosted access selects native OAuth or a private machine handoff for each consumer. |
| Explicitly create a new personal agent with identity and a private repo |
Follow BOOTSTRAP_FOR_AGENTS.md. gbrain bootstrap is for this explicit request. |
| Explicitly configure per-worktree code engines with shared artifacts |
Follow topologies. Brain and source routing must be set independently. |
If intent is unclear, default to memory for the existing agent. Ask only for
missing information needed to choose a safe target, such as which existing
brain to connect or which Muse directory is durable.
Phase 2: Inspect, install, or repair
For an existing installation, use its recorded absolute launcher when present:
gbrain engine status --json
gbrain engine status --probe
These commands work while the database is down. Inspect the engine,
configuration provenance, root, and source. Ambient database/MCP settings or a
working-directory mount are not authorization to adopt that database.
GBRAIN_HOME alone does not isolate all routing.
For Grok Bot/Muse, let the setup helper inspect and isolate the chosen root.
Do not run another global init around it. Its receipt distinguishes absent,
partial, malformed, and conflicting state. Repair uses the retained
<root>/bin/gbrain-setup; adoption and upgrades require explicit options.
Never replace existing memory to recover from an initialization error.
For other local installations, resolve conflicting routing before following
the canonical distribution and keyless initialization:
bun install -g github:garrytan/gbrain#stable
gbrain init --pglite --no-embedding
Install Bun first if missing, following
INSTALL_FOR_AGENTS.md. Do not use the unrelated
npm package named gbrain, or bun add in the user's current project.
Local/thin-client conversion requires explicit intent and preservation of the
previous configuration.