The hub is a momentary bridge, not long-term memory. It keeps the current conversation in sync across channels, with a bounded database (automatic pruning). Persistent memory across projects/sessions is still the memory system (
/memory) and /session save.How it works
- Principal: the shared conversation identity. In single-user mode (the default), the local CLI and the gateway collapse to the same principal (
defaultif you set nothing), so everything shares with zero configuration. hub.db: an append-only SQLite log (~/.chatcli/hub.db). The CLI and the gateway daemon open the same file — that is how they understand each other across processes.- Ephemeral per session: opening chatcli starts a fresh conversation and the previous one is pruned — the database never grows and you don’t load a giant history. Conversations idle past the TTL (
CHATCLI_HUB_TTL_HOURS, default 24h) are swept. - Silent: turns from other channels enter the model’s context without being printed in your prompt (no noise, no “press Enter to continue”).
/newsessionresets the shared conversation for every channel.
/agent and /coder: the request and the final answer cross channels (tool-execution detail stays local on each machine).
Modes
- Local (same machine)
- Co-located in the server (real time)
- Multi-user / public bot
The simplest case — chatcli + gateway on one notebook, zero configuration (the default principal is enough):Talk on the notebook, then pick up the topic on Telegram → it has the context. Send on Telegram with the prompt open → it enters the context of the notebook’s next turn.
Cross-process, the notebook picks up context on its next turn (there is no live push into an already-open prompt). For real time, use the co-located mode below.
Commands
hub.db (read live by the gateway, no restart):
Shared identity (single-user vs multi-user)
| Scenario | Configuration | Result |
|---|---|---|
| Just you (notebook + personal bot) | nothing (or CHATCLI_HUB_PRINCIPAL=me) | everything collapses to one principal → one shared conversation |
| Multi-user/public bot | CHATCLI_HUB_ISOLATE=true (+ bindings) | each identity isolated; bindings merge whoever you choose |
Relationship to memory and sessions
The hub is an additive parallel rail: local history,
/session save and memory keep working exactly as before.
Observability — the hub never dies silently
Continuity depends on the hub being up, so every state it can be in is explicit in the log:- Hub active: the daemon logs
gateway: conversation hub active (principal=…, isolate=…, idle_ttl=…)at boot; the CLI logslocal hub mode enabled. - Hub disabled: a
Warnnames the exact source of the decision —db setting enabled=false,env CHATCLI_HUB_ENABLED=falseordefault— instead of simply making continuity vanish. - Daemon serving without the hub (database unreachable): a once-per-run warning makes it clear replies have no cross-channel context.
See also
- Chat Gateway — exposes ChatCLI on messaging channels
- Remote Server (/connect) — connect the CLI to a remote hub
- Environment Variables
- Command Reference