Getting data out of Apple Health is a nightmare of shortcuts and third-party collectors. We compiled a Go daemon into the iOS app and stream directly to an agent. Two G-Brains. One channel. Talk to it on Telegram.
Your watch knows more about your body than any doctor. Getting that data out — and doing something intelligent with it — is an unsolved engineering problem.
Apple lets you export a ZIP. The XML inside is 500 MB, unstructured, and missing workout metadata. Shortcuts can drip samples one-by-one but there is no streaming API and no way to push data anywhere reliably.
Every "sync to Google Sheets" app is a new data custodian. Your HRV, sleep stages, and resting heart rate end up on someone else's server, often unencrypted, with terms that can change.
Even if you get the data out, you still need a receiver, a transformer, a store, a query layer, and something to reason over it. Most people stop at the export. The wiring is the hard part.
Charts show what happened. But "should I train hard today?" requires HRV trend, sleep quality, and your calendar for the week — cross-referenced. No consumer app does this. Ours does.
Each agent has its own OpenClaw workspace, its own Pilot identity, its own G-Brain, and its own Docker container. They coordinate only via send-message.
Receives HealthKit envelopes from the iPhone, deduplicates by sample UUID, and writes to a DuckDB warehouse. Answers SQL queries from the Coach. Its G-Brain holds factual observations — what HealthKit reported, when, raw counts. No interpretation.
Monitors health events via 7 rule models, pulls your Google Calendar, and reasons over all of it. Sends proactive nudges on Telegram when a rule fires. Answers questions with paper-backed evidence from 17 peer-reviewed studies.
Every step is traceable. No cloud middleware, no magic.
Anchored queries capture every sample exactly once — HRV, sleep stages, resting heart rate, SpO₂, training load, and more. 27 on-device models compute composites like burnout CUSUM, circadian drift, and autonomic balance. No server dependency for analysis.
The embedded Go daemon calls pilotctl send-message <collector-id> --data '...'. The envelope carries a batch UUID, sample UUIDs, and raw values. E2E encrypted tunnel — no data is visible to any relay, including the Pilot overlay itself.
The JSON lands in the Collector's Pilot inbox as a file. inbox_watcher.py classifies by content shape — a message with a samples array goes to the ingest path. INSERT OR IGNORE on UUID deduplicates. An Ack is sent back; only then does the iPhone advance its HealthKit cursor. Crash-safe by design.
After each batch commit, {kind: "samples_added"} is sent to the Coach's inbox. Same primitive — send-message — different content shape. The Coach classifies it by the kind field. No pub/sub, no message broker.
On each ChangeEvent, the Coach sends a SQL query message to the Collector. The Collector executes it read-only and replies with a QueryResult, correlated by request_id. If a rule fires — HRV below baseline, burnout CUSUM crossing a threshold, circadian drift detected — and cooldown has elapsed, a Telegram nudge goes out.
The Coach combines a DuckDB query, G-Brain recall, and health-intelligence RAG — 17 peer-reviewed papers, 89 interventions — to answer in ≤200 words with inline citations. Calendar context from Google OAuth is already in its G-Brain, so "HRV dropped during my heavy meeting week" is answerable without you explaining anything.
Each agent is a fully independent unit. To add another — just share its Pilot node ID. The network grows without central coordination.