Use the service commands to enable, start, and inspect the shared backend service installed on your machine.
These commands manage the installed shared memory service backend.
They are for the normal packaged setup, not for source-level development runs like cargo run --bin memory -- service run, which activate a fully isolated dev profile on different ports. See Dev Stack vs Installed Stack for the full contract.
Enable or start the service:
memory service enablePreview the service action without changing the machine:
memory service enable --dry-run
memory service disable --dry-run
memory service ensure-api-token --rotate-placeholder --dry-run
memory service restart-all --dry-run --jsonThis command also provisions the shared service API token automatically if it is missing or still set to the old development placeholder.
Check service status:
memory service statusRotate an old placeholder token manually:
memory service ensure-api-token --rotate-placeholderRestart active services after an install or upgrade:
memory service restart-all --mark-tui-restart --jsonrestart-all restarts only services that are already active or loaded. It does not start services that the user intentionally stopped. On Linux it checks the system backend service and active user watcher services. When run as root during a package install, it also checks logged-in user systemd sessions under /run/user/*. On macOS it checks loaded Memory Layer LaunchAgents.
Installers pass --mark-tui-restart so a TUI that is already open can show restart in red in the bottom status bar. Restarting the TUI is still a user action; the installer does not kill the running terminal UI.
Health checks from the client side:
memory health
memory doctorThe HTTP API does not trust Origin or Referer headers as authentication, even when they point at localhost. API clients must send the configured service token with x-api-token. The bundled same-origin web UI bootstraps that token from the service and attaches it to its own API requests.
On macOS, memory service enable manages the LaunchAgent.
On Linux, the packaged service is usually managed with:
sudo systemctl enable --now memory-layer.service
memory service restart-all --mark-tui-restartUse systemctl directly only when debugging a specific unit.
When working from source, cargo run --bin memory -- service run starts a dev backend that is fully isolated from any installed service on the same machine: different HTTP port (4250 vs 4040), different Cap'n Proto port (4251 vs 4041), and its own Cap'n Proto Unix socket under the user-local project runtime directory. The dev profile ignores the installed global config entirely.
Bootstrap is one-time per checkout:
cargo run --bin memory -- init
cargo run --bin memory -- dev init --copy-from-global
cargo run --bin memory -- service run--copy-from-global lifts the database URL and LLM/embedding endpoints out of the installed config into the dev overlay. Without it (and without a TTY) you will need to populate those sections in the user-local project config.dev.toml by hand.
For the full isolation contract, override flags, verification steps, and troubleshooting, see Dev Stack vs Installed Stack.