mnemon icon indicating copy to clipboard operation
mnemon copied to clipboard

Show & tell: cross-device store sync without changing mnemon

Open b1rdex opened this issue 5 months ago • 3 comments

Thanks for mnemon — the LLM-supervised design is lovely to build on. 🙏

I run Claude Code on two machines and wanted the same memory on both. Since a store is just a SQLite DB, I put together a small external tool (more duct tape than engineering) that keeps stores in sync across devices without changing mnemon at all.

Repo: https://github.com/b1rdex/mnemon-sync

The gist: instead of file-syncing the live .db (which corrupts and can't be merged), each machine publishes a per-device snapshot and the other side merges them back with last-writer-wins — converging without ever losing a memory. It leans on things mnemon already does right (UUID ids, soft-delete, an updated_at on every row) and runs automatically via Claude Code hooks.

I used Syncthing to move the files around because it's private (device-to-device, nothing on third-party servers) and free — but the tool doesn't care how the folder gets synced, so in theory iCloud / Dropbox / whatever should work too (haven't tested those).

Not asking for anything to be merged — just sharing in case it's useful to anyone else running mnemon on more than one machine, and happy to be corrected if I've misread any internals. Thanks again!

b1rdex avatar Jun 07 '26 14:06 b1rdex

Hey, cool idea, - big Syncthing fan between my macs and VPS, but did you consider Mnemon recall bumps access_count but not updated_at ?

MoonCaves avatar Jun 10 '26 07:06 MoonCaves

Good catch — confirmed: recall bumps access_count / last_accessed_at but not updated_at, so the LWW merge was dropping those bumps.

Fixed in 9a35fa0: content still resolves by updated_at, while access_count and last_accessed_at now merge as the max of the two sides — recall activity propagates between devices and survives content edits.

b1rdex avatar Jun 10 '26 10:06 b1rdex

@b1rdex really like this — per-device snapshots + last-writer-wins is exactly the right way to dodge the live-.db corruption trap, and leaning on the UUID / soft-delete / updated_at invariants is clean. Syncthing as a private, transport-agnostic mover is a nice touch.

Sharing another option in the same spirit, for a slightly different constraint — a team (~10 people) sharing project memory, not just one person across machines:

  • Transport = git. Same per-device-file idea (zero merge conflicts), but a private git repo doubles as the distribution channel, so onboarding a new machine is git clone + install.
  • Encrypted at rest. Because the memories live in a repo more than one person can read, each device's snapshot is encrypted with age, using the team's SSH public keys fetched from the git host (/<user>.keys) as recipients — no separate key management, and hybrid encryption writes the ciphertext once regardless of team size.
  • Two-tier stores. A shared team store (default) + a private personal store encrypted only to your own key, so preferences/sensitive notes never become teammate-readable.

For one user across two machines, your Syncthing version is simpler and I'd point folks there. For a team that wants shared, encrypted, git-hosted memory, this might fit — same underlying idea you laid out. Thanks for writing it up!

Repo: https://github.com/eszio/mnemon-vault

eszio avatar Jun 12 '26 12:06 eszio