Sync — your data across your devices

Shipped

View as Markdown

Sync is off until you turn it on. When you do, Bring Your LM replicates your data to a Couchbase Edge Server that you run — there's no BYLM account and no backend we operate. Your agents, conversations, notes, and settings then follow you from one device to another, and each device keeps working offline and catches up when it reconnects.

Why it matters

You bring the model and the keys, so the app's job is to hold your setup and history without shipping it anywhere you didn't choose. Sync keeps that promise: you point the app at a server on your own machine or network, replication runs both ways continuously, and the things that only make sense on one device — or that must never leave it — are deliberately held back.

The one hard rule: Couchbase Lite 3.x

Bring Your LM stores everything in Couchbase Lite 3.x and replicates with that version's protocol. The server you run has to speak the same protocol, and this is the part that trips people up:

If sync connects but immediately errors with a protocol or version complaint, this mismatch is the first thing to check.

What syncs, and what stays on the device

Everything replicates through a single set of collections. When sync is on, the app pushes and pulls all of these:

Some things are created on every device but never handed to the replicator, because they're meaningless — or unsafe — anywhere but where they were written:

Secrets never ride the sync connection

Your provider and fetch-tool API keys live in your device's OS keystore, not in the app's database — so they are simply not among the things that replicate. A synced provider record carries its address and options and only a flag saying a key is set; the key's value stays on the device you typed it into. By default, then, turning on sync shares no secrets at all, and you re-enter a key once on each device.

Sharing a key on purpose

When you do want a key on another device without retyping it, BYLM has a deliberate, per-key path — not a blanket "sync my secrets" switch:

So secrets are private by default and shared only key-by-key, device-by-device, end-to-end encrypted — never dropped into the general sync stream in the clear.

Asking for a key you don't have

Sharing starts on the device that has the key, which is the wrong end when you are sitting in front of the device that needs one. So you can also ask:

Because nothing replicates while an app is closed, this is a "go and open the other device" flow: your ask reaches a device the next time you open BYLM there, and the badge on Settings points you at it.

Managing your devices

Settings → Devices lists every device in your registry — the names that show up in a message's per-device metrics. From here you can rename a device, delete a stale record for one you no longer use, and see each device's trust badge and key fingerprint. Verifying a device means comparing that fingerprint across the two screens; if a device's keys later change, it turns into a loud "Keys changed" badge rather than staying invisible, and a device that changes its name has to be re-verified before it can send or receive keys. Incoming key offers also land here, each with an explicit accept (which verifies the sender first) or decline — as do asks from your other devices for keys this one holds, and the keys this device is still waiting for. A badge points you to whatever is waiting, so nothing sits unnoticed.

Reading the sync status icon

Whenever sync is on, a small status icon rides in the top bar (and in the navigation drawer) so you always have an at-a-glance read on the connection. Tap it to jump straight to the sync settings. When sync is off, the icon isn't shown at all.

Here is every state it can show:

The eleven sync status states, each with its icon, label, and meaning

Turning sync on in the app

Open Settings, then Sync, and fill in the connection:

Use wss:// (TLS) for anything beyond your own trusted LAN — the endpoint carries all your synced data.

Standing up the server

You supply the server; the app is only the client. For a copy-and-run example — a Dockerfile, a docker run command, and the config and users files — see Running a Couchbase Edge Server. The essentials are the same however you run it:

If you manage servers with Ansible, this project's companion role automates all of the above: you provide the admin user's password (from a vault), the public hostname the proxy answers on, and the database-to-collections map shown above, and it renders the config and users files and runs the container for you.

Whenever you add a new collection to the app in a future version, remember the server's collection list has to grow to match, or that new data won't sync.

What it doesn't do yet

Sync is a single endpoint with a single user — there's no per-collection or per-device filtering, no channels, and no selective sync: enable it and the full collection set above replicates. And it only talks to a Couchbase Edge Server (or a compatible Sync Gateway) speaking the Couchbase Lite 3.x protocol — see the version rule above.