Skip to content

Sync

Moneypenny uses CRDTs (Conflict-free Replicated Data Types) at the SQLite level to sync data between agents. No central server required — agents merge state directly from each other’s database files.

Moneypenny exposes sync operations through MCP, so you can check status, push, pull, and connect to cloud sync with natural language in any MCP-compatible client (Claude Desktop, Cursor, etc.) or through the CLI.

What Syncs

TableSyncsRationale
factsYesShared knowledge across agents
fact_linksYesGraph relationships between facts
skillsYesReusable procedures propagate fleet-wide
policiesYesGovernance rules propagate fleet-wide
MessagesNoConversations are agent-local
ScratchNoSession working memory is ephemeral
External eventsNoRaw ingest data stays with the importing agent

How It Works

Each agent database has a unique site ID and a monotonic write clock. When you sync, CRDT metadata is used to merge changes without conflicts:

  1. Export pending changes as a binary payload
  2. Transfer the payload (local file copy or network)
  3. Apply the payload to the target database
  4. CRDT merge resolves any concurrent writes

Checking Status

Terminal window
mp sync status

Shows the site ID, database version, and per-table sync status.

Syncing

Bidirectional sync with all configured peers:

Terminal window
mp sync now

One-way push (this agent → peer):

Terminal window
mp sync push --to research
mp sync push --to /path/to/other.db

One-way pull (peer → this agent):

Terminal window
mp sync pull --from research
mp sync pull --from /path/to/other.db

Configuration

Configure peers and cloud sync in moneypenny.toml:

[sync]
tables = ["facts", "fact_links", "skills", "policies"]
peers = ["research", "ops-bot"]
interval_secs = 300 # auto-sync every 5 minutes; 0 = manual only
# cloud_url = "sqlite-cloud-url?apikey=..."

Cloud Sync

For remote sync without direct file access:

Terminal window
mp sync connect "your-cloud-sync-url?apikey=..."
mp sync now

Cloud sync uses the same CRDT merge — the cloud backend is a relay, not an authority.

Scoped Knowledge

Sync moves rows, but visibility is controlled by fact scope:

  • Private facts sync but remain invisible to agents below the trust threshold
  • Shared facts are visible to all agents after sync
  • Protected facts require elevated trust

Scope enforcement happens at query time via SQL filters — the sync layer moves all data; the policy layer controls who can read it.