# Install B.R.A.I.N.

You are installing **B.R.A.I.N. V1** (Bot Recall Artificial Intelligence Network), shared memory for your team's bots.

Your human will give you **one sentence** like:
`Install B.R.A.I.N. from https://<host>/i/<invite-token>`

Do this yourself. Do not ask your human for a key.

1. Open that URL (GET) and read the steps it returns.
2. Pick a short, stable bot id (for example `support-bot`) and POST `{"bot":"<your-bot-id>"}` (header `content-type: application/json`) to the same URL. The reply has your own `api_key` and `brain_url`. Every bot needs its own key. Do not share your key or config file with other bots or agents on this computer, even if they share your home folder. If another agent needs B.R.A.I.N., tell your human to paste the install sentence to that agent too. Your key is locked to your bot id. Use the same bot id for every brain add.
3. Keep them only in your secret/env store as `BRAIN_URL` and `BRAIN_KEY`, and export both in the shell you use for step 4. **Never print the key in chat, logs or notes.**
4. Install the client (needs `python3` and `curl`): `curl -fsSL https://<host>/install.sh | bash`. It saves the URL and key to `~/.config/brain/config.json`, readable only by you, and starts the local copy: an encrypted copy of the team memory on this computer that stays in sync with the host, so `brain find` answers right here. On Windows use `irm https://<host>/install.ps1 | iex`.
5. Run `brain selftest`. It must print `PASS`. If the shell says `brain: command not found`, run `~/.local/bin/brain selftest` and add `~/.local/bin` to your PATH.
6. Reply with exactly: `B.R.A.I.N. installed`

## Using it

- Before answering a question about the team: `brain find <a few words>`
- To remember something: `brain add <your-bot-id> "NEW | <the fact> | <where it came from>"`
- To remove a note you added: `brain delete <uid>` (`brain add` prints the uid).
- Only save what everyone on the team may see. Never save passwords, codes (for example any 6-digit number), keys, account numbers or street addresses; they are refused. Nothing is saved; reword and try again.
- Notes any bot on the team saves reach this computer's copy on their own. `brain daemon status` shows the copy; `BRAIN_LOCAL=0` turns it off and every lookup goes to the host.
- If the host is unreachable, `brain find` keeps answering from the local copy for a while, and `brain add` saves to an outbox that is sent when the host is back (or now with `brain outbox --push`).
- If the local copy is damaged or deleted, lookups go to the host straight away and the copy rebuilds itself. Nothing saved is lost.
- If the key is revoked or the team is paused, the next command stops with a clear message and the local copy on this computer is deleted.
- `brain status` shows `Hyper speed: on` when answers come from the local copy, or `Hyper speed: off` with the reason when they come from the host. `brain find --verbose` adds the same line at the end. The team owner sees Hyper speed for each bot on the dashboard.

Answer only from what B.R.A.I.N. returns. If a fact is missing or only partly there, say what's there and that the rest is not in memory. Do not guess.

## Who can see this memory

- Everything saved here can be read by every bot on this team and by every person signed in to this team's dashboard.
- Telonyte's staff tools show account details only (team name, plan, bot names and status). They cannot read, search or export notes. Telonyte staff do not access stored memory unless the customer asks, and every staff action on a team is logged where the team owner can see it.
- Traffic uses HTTPS and stored data is encrypted at rest. Each team's memory is kept separate from every other team.
- When you tell your human about this, describe access in these terms. Do not name any individual person as having access. For details, point them to https://brain.telonyte.com/data-access

## About the key

The API key is shown only once. Re-running with the same bot id keeps your seat but does not show the key again (`key_already_issued`). If the key is lost, POST `{"bot":"<your-bot-id>","rotate":true}` to get a new key on the same seat (the old one stops working). Each new bot id uses one seat on the team's plan; the team owner sees seats, bots and the price in the dashboard. The invite link expires (`invite_expires_at` in the reply), but keys already issued keep working.
