ModelBrain for Linux (command line)
===================================

A memory layer for AI assistants that runs on your own computer. This is the
command-line package: no tray icon, no windows. It works with Claude Code and
Cursor directly, and with ChatGPT through the relay client (see below).

Requirements
------------
- 64-bit Linux, x86_64 or aarch64 (use the package that matches your CPU)
- A glibc-based distribution, glibc 2.28 or newer (Debian 10+, Ubuntu 20.04+,
  RHEL/Rocky/Alma 8+, Fedora, Arch and similar). Not Alpine/musl. No other
  libraries are needed.
- About 200 MB of disk for the program, plus room for your data and, if you
  turn on reasoning mode, a model download of 1.5 to 2.5 GB.

Install
-------
    tar xzf modelbrain-<version>-linux-<arch>.tar.gz
    cd modelbrain-<version>-linux-<arch>
    ./install.sh --setup

That copies ModelBrain to ~/.local/lib/modelbrain, links `modelbrain` and
`connector_sync` into ~/.local/bin, and registers ModelBrain with Claude Code
and Cursor. Leave off --setup to install without touching any client config,
then run `modelbrain setup claude-code` or `modelbrain setup cursor` when you
are ready. Add --systemd to keep the daemon running as a user service. Without
it, the daemon starts on demand the first time an assistant connects.

To check the SHA-256 first: sha256sum -c modelbrain-<version>-linux-<arch>.tar.gz.sha256

Use
---
    modelbrain status                     is it running, which clients are set up
    modelbrain setup all                  register with Claude Code and Cursor
    modelbrain daemon restart             restart the background daemon
    modelbrain reasoning set-tier high    reasoning tier: auto, minimal, default, high, off
    connector_sync sync notes ~/notes     keep a folder of notes in your memory
    connector_sync list                   show registered folders

`modelbrain --help` and `connector_sync` with no arguments list every option.

ChatGPT
-------
ChatGPT reaches ModelBrain through a hosted relay. From a terminal:

    MODELBRAIN_RELAY_URL=wss://relay.modelbrain.net/device \
      ~/.local/lib/modelbrain/modelbrain_relay_client

It prints a short pairing code. In ChatGPT, add relay.modelbrain.net/mcp as a
custom connector and enter that code. Leave the command running while you use
ChatGPT; closing it disconnects ChatGPT, not your other assistants.

Where things live
-----------------
    Program         ~/.local/lib/modelbrain
    Your data       ~/.modelbrain/data   (override with MODELBRAIN_DIR)
    Logs            ~/.modelbrain/logs
    Reasoning models ~/.modelbrain/models   (downloaded on demand)

Upgrade
-------
Unpack the new package and run ./install.sh again. Your data is untouched.

Uninstall
---------
    ~/.local/lib/modelbrain/uninstall.sh              keeps your data
    ~/.local/lib/modelbrain/uninstall.sh --purge-data deletes it too

Privacy
-------
Everything runs on your machine. ModelBrain only uses the network to download
reasoning models when you turn that mode on, and for the ChatGPT relay if you run it.
