01 / Overview

What Thermostat Is & What It Does

Thermostat uses a host of MCPs & Skills to help me organise my life better. It is connected to a bunch of underlying data sources including the MacBook (via MacOS MCP) giving access to calendar, notes, music, email etc, Open Wearables (that stores biometrics & nutrition), a bridge to connect with the Tuya ecosystem, Google Maps, Google AI Studio, Linear and a growing number of sources that helps the agent gather data & context.

Its primary interface is Slack, though I sometimes use it via the terminal.

  • Ingests Telemetry: Continuously reads room sensors (temperature, humidity, air quality), wearable biometrics (sleep stages, resting heart rate, HRV), nutrition logs, local calendars, and system stats.
  • Runs Scheduled Beats: Executes at fixed points throughout the day (07:30, 08:00, 12:30, 16:30, 19:30, 22:30) via a local cron engine.
  • Reasons via Modular Skills: Evaluates data using 25+ markdown skill playbooks to formulate operational plans and exertion checks.
  • Delivers Actionable Verdicts: Posts structured verdicts and daily briefs directly into Slack and updates Linear tickets without conversational fluff.

02 / Rules of Execution

Operating Rules

The agent executes under five core operational rules:

1. Verdicts, Not Questions

GO · DRIFTED · ON-TRACK

Checkpoints end with an explicit verdict (GO, DRIFTED, ON-TRACK) and the reasoning attached. If data is missing or incomplete, it states UNVERIFIABLE. It never guesses or asks open-ended questions.

2. Delta-Only Reporting & Silence as Data

Silence Is Data

Checkpoints report only changes against the morning plan. Settled facts are not repeated. If nothing material has changed, the agent outputs "No delta — plan holds" or responds with [SILENT] to suppress notification noise.

3. Rolling Target Bands

7, 14, 30 & 180-Day Trends

Evaluates biometrics and habit consistency against multi-day rolling bands (sleep duration target envelopes, baseline RHR ranges, rolling HRV baselines) rather than overreacting to single-day variance.

4. Present, Don't Decide

Visible Evidence

The agent presents decisions with all underlying evidence visible. The human retains final override authority.

5. Multi-Tier Freshness Verification

Tier 1 → Tier 2 → Tier 3

Audits data freshness before making claims. For sleep data: checks Tier 1 (Finalized database event), falls back to Tier 2 (Raw active night Redis cache), and only marks Tier 3 (Pending sync) when no live records exist.


03 / Daily Operating Rhythm

The 5 Scheduled Daily Beats

Thermostat runs five scheduled cron beats aligned with my day:

07:30 Daily Learning Summary

Executes via the daily-ai-brief MCP and Apple Podcasts store (MTLibrary.sqlite). It ingests newly dropped AI episodes, scans 22 technical engineering feeds, extracts arXiv breakthroughs and frontier lab model drops, and queues actionable takeaways for the morning brief.

08:00 Morning Brief (The Day's Operating Plan)

Audits sleep data freshness → Evaluates 7-day recovery (HRV baselines, resting HR, workload ratio) → Checks yesterday's macro totals from PostgreSQL → Cross-checks calendar meetings and defends my 09:00–12:00 deep focus block → Outputs the day plan ticket to Linear and Slack.

12:30 Midday Checkpoint

Audits morning task progress against the plan, checks logged meals to date for protein pacing, triggers a quick camera alertness scan, and emits delta updates to the active day ticket.

16:30 Pre-Exertion Gate (4-Input Training Check)

Before I step out for a run or workout, it runs a 4-point gate to issue a binary GO / NO-GO verdict:

1. Calendar → Is the evening free of conflicting meetings or travel?
2. Physiology → Last night's HRV peak vs 7-night baseline & resting HR nadir
3. Climate → Hyperlocal weather feels-like temperature (17:00-19:00 window) & AQI
4. Fuel Floor → Protein intake to date (checking remaining dinner capacity)
19:30 Post-Session Reconciliation & Evening Transition

Reconciles workout data from wearable HR streams, calculates the remaining protein/macro target for dinner, and triggers local Tuya commands to start circadian lighting wind-down.

22:30 End-of-Day Look-Back (The Ledger Close)

Closes daily records (training mileage, strength habit checks, nutrition balance, completed Linear tickets), updates rolling composite scores, and flags bedtime drift.

Continuous Background Maintenance Tasks
  • Every 180 min · Host Watchdog: Checks Mac CPU load, memory pressure, swap %, disk headroom, and thermal state. Emits [SILENT] when healthy.
  • Sunday 06:00 · Photo Purge: Automatically purges local visual scan receipts older than 30 days.
  • Monday 09:30 · Weekly Retrospective: Audits cron reliability, runs automated LLM judge evaluations over past decisions, and patches skill prompts.

04 / Physiology & Training

Workout & Physiology Tracking

Workout management in Thermostat is closed-loop: it determines if and how hard I should train, passively reconstructs exercise mechanics from biometric streams, captures subjective effort, and reconciles metabolic load into the evening meal target.

1. The 16:30 Pre-Exertion Decision Gate

Binary GO / NO-GO

Instead of following a rigid static calendar, workouts are dynamically cleared 30 minutes before departure. The thermostat-coach skill executes a 4-point gate:

1. Autonomic Recovery (HRV & RHR)

Compares last night's HRV peak against the 7-day rolling envelope. If HRV dropped > 15% and resting HR nadir occurred late (> 04:30), intensity is automatically downgraded from threshold intervals to Zone 2 base.

2. Hyperlocal Climate & AQI

Polls the 17:00–19:00 feels-like temperature window, solar UV index, and AQI. If outdoor air quality exceeds threshold, it routes the workout indoors.

3. Schedule & Travel Defense

Cross-checks EventKit calendar via macos-mcp. Guarantees a minimum 90-minute block free of calls and travel transitions.

4. Fuel & Energy Floor

Audits lunch protein and carb intake from Open Wearables to ensure adequate glycogen availability before high-exertion sessions.

2. Passive Heart Rate & Zone Reconstruction

reconstruct-run-from-hr

When a workout finishes, the agent reads continuous second-by-second heart rate streams from the Open Wearables database:

  • Zone Distribution: Calculates time spent in Zone 1 (Recovery), Zone 2 (Aerobic Base), Zone 3 (Tempo), Zone 4 (Threshold), and Zone 5 (Anaerobic).
  • Cardiac Drift & Aerobic Decoupling: Compares heart rate kinetics against pace to detect cardiovascular fatigue or dehydration across long runs.
  • Recovery Heart Rate (HRR): Measures heart rate drop at 1-minute and 2-minute marks post-exertion to score acute autonomic tone.

3. Human Ground Truth & Qualitative RPE

run-feedback-analysis · biome.db

Biometrics only tell half the story. Whenever I drop a short note into Slack (e.g. "Ran 8.4km in 46m, felt smooth on climbs, slight right calf tightness, RPE 6"), the run-feedback-analysis skill parses it:

• Distance & Pace → Reconciled with GPS/HR stream
• Rate of Perceived Exertion (RPE) → Logged on a 1–10 scale into SQLite
• Biomechanical Flags → Tags musculoskeletal notes ("right calf tightness") for recovery tracking

4. 19:30 Post-Exertion Reconciliation

Metabolic Balancing

Active workout calories are factored into Total Daily Energy Expenditure (TDEE). The agent calculates the remaining protein and carbohydrate requirements for the day, outputting the exact dinner target in Slack before closing the training ticket on Linear.


05 / Nutrition Pipeline

The Nutrition & Meal Ingestion Pipeline

Nutrition runs through an automated pipeline that turns photos or plain-text meal notes into structured macronutrient records.

1. Ingestion Flow (food-log Skill)

When I drop a meal photo or food description into Slack, the agent processes it:

  • Vision API Delegation: The core text agent downscales photos via sips and calls Google AI Studio's vision model to extract plate items and estimate quantities.
  • Conservative Estimation: Portions default to conservative estimates to avoid camera-angle inflation. If I provide explicit portions (grams, spoon counts), they serve as absolute ground truth.
  • Unified Item Set: Combines detected image items with any typed notes (Image Contents ∪ User Text).
  • Historical Twin Matching: If external APIs are unavailable, it matches dishes against historical logs in the database.

2. Daily Macro Gating

Macro numbers feed directly into the daily operational loops:

16:30 Pre-Exertion Check
Compares cumulative daily protein against workout targets to check remaining dinner requirements.
19:30 Post-Exertion Check
Recalculates post-workout deficit and outputs the target for the day's final meal.

3. Nutrition Data Stores

Nutrition data is persisted across two dedicated local database stores:

PostgreSQL Store (meal_log & data_point_series)

Maintained in Open Wearables. Stores structured plate items, meal type (breakfast, lunch, dinner, snack), exact ingestion timestamp, and computed macronutrient breakdowns: total calories, protein, carbohydrates, fats, and dietary fiber.

SQLite Feedback Store (meal_feedback)

Captures post-meal qualitative signals: satisfaction rating (1–5), subjective satiety (light, full, stuffed), and subsequent energy levels (energetic vs sluggish) to calibrate future portion estimation models.


06 / Outcomes & Review

The Daily Scoreboard & Execution Dashboard

At 22:30 each night, the agent closes the daily ledger, writes performance metrics to composite_scores in SQLite, and computes multi-day rolling adherence bands:

Personal Operating Ledger

Hermes v2.4

Continuous execution tracking across 5 daily beats and 4 operational domains.

Current Streak
42 Days
Composite Score
94.2%
24-Week Daily Execution Consistency 168 Daily Ledgers Closed

Mon · Wed · Fri · Sun
Less More

1. Training & Movement 94.2%

48.2 km weekly running volume · 3/3 Strength sessions · 0 pre-exertion gate violations.

2. Recovery & Sleep 88.5%

7h 48m avg sleep duration · RHR nadir 47 bpm at 03:45 · HRV +8% vs 30-day baseline.

3. Fuel & Nutrition 91.0%

165g daily protein floor maintained · 100% meal photos logged · 0 late-night deficit spikes.

4. Deep Focus & Ops 96.0%

09:00–12:00 calendar blocks defended · 0 meeting collisions · Daily Linear issues closed.


07 / Data Ingestion & Sensors

Sensor Inventory & The Context Platter

Data from different systems flow differently. Some (like weather, environment) fire as a MacOS cronjob and deterministically write data to a local database. Some others like measuring calories from the photo of a meal fire on demand only when an image is posted on Slack. The system then computes all the data including rolling averages, and builds a consolidated current_context.json snapshot:

┌────────────────────────────────────────────────────────────────────────┐
│                        DATA PLATTER SOURCES                            │
│  PostgreSQL (Wearables & Meals) · SQLite (Biome) · Apple MTLibrary     │
│      IoT Room Telemetry · Hyperlocal Weather API · EventKit Calendar   │
└──────────────────────────────────┬─────────────────────────────────────┘
                                   │ Ingestion Daemon (every 15 min)
                                   ▼
┌────────────────────────────────────────────────────────────────────────┐
│                    UNIFIED CONTEXT SNAPSHOT                            │
│                  `~/.hermes/data/current_context.json`                 │
│  - Indoor Telemetry & Heat Index    - 7d/14d/30d/180d HRV Trajectories │
│  - 3-Hour Climate Forecasts & AQI   - Sleep Architecture & RHR Nadir   │
│  - Cumulative Daily Macros          - Calendar Clusters & Travel State │
└──────────────────────────────────┬─────────────────────────────────────┘
                                   │ Injected directly into agent prompt
                                   ▼
┌────────────────────────────────────────────────────────────────────────┐
│                       AUTONOMOUS OODA BEATS                            │
│               Agent reasons over full context state at once            │
└────────────────────────────────────────────────────────────────────────┘

1. The Desk / Room IoT Board

Sampled every 30 mins
Temperature: Room temperature with 60-min rate-of-change velocity.
Humidity: Relative humidity percentage.
Heat Index: Calculated indoor thermal comfort.
Barometric Pressure: Atmospheric pressure (hPa).
Gas Resistance / VOC: Indoor air quality and VOC concentration.
Ambient Light (Lux): Illuminance for circadian lighting automation.
PIR Motion: Desk presence detection.
Acoustic Noise (dB): Ambient room noise levels.

2. Outdoor Weather & Climate

Continuous polling
Ambient Temperature: Outdoor baseline temperature.
Feels-Like Index: Heat index governing outdoor workout safety.
UV Index (UVI): Solar radiation level.
Wind Speed & Direction: Air movement and cooling factor.
Air Quality Index (AQI): Multi-pollutant index (PM2.5, PM10, NO2, O3, CO).
Rain Probability: 3-hour precipitation forecasts for workout timing.

3. Biological Wearables (Open Wearables)

PostgreSQL & Redis Tiers
Sleep Duration & Efficiency: Time asleep vs time in bed scored against targets.
Sleep Architecture: Deep sleep, REM, light sleep, and latency.
Resting Heart Rate (RHR): Nightly baseline RHR, trend, and nadir timing.
Heart Rate Variability (HRV): Night peak, median, and 7d/14d/30d/180d averages.
HRV Readiness Score: Ratio comparing current peak to rolling baseline.
Workout HR & Steps: Heart rate streams during exercise and daily step counts.

4. Visual Telemetry & Camera Receipts

Built-in FaceTime HD Camera

Runs via a deterministic capture script: captures frame from camera → verifies file size (≥15KB) and JPEG header (ffd8ff) → generates SHA-256 capture receipt → extracts fatigue indicators (dark circles, hydration, alertness) → archives to disk with a 30-day retention purge.


08 / Intelligence Layer

The Modular Skillpack Catalog

Agent capabilities in Hermes are structured as modular Markdown skill files. Each skill contains exact execution rules, prompt templates, and data schemas:

A. Rhythm, Persona & Daily Loops

thermostat-coach
Defines the core persona, tone laws, and OODA loop governance.
context-platter
Parses the 15-min context platter and computes rolling 7d/14d/30d trend lines.
morning-brief
Executes the 08:00 recovery evaluation and drafts the day's operating plan.
eod-lookback
Runs the 22:30 scorecard close and audits plan vs actual execution.
eod-mechanics
Deterministic mechanical recipe for closing tickets and recording scores.
composite-score
Calculates monthly composite scores across training, recovery, and deep work.
verdict-report
Standardized verdict-first formatter for all Slack notifications.
linear-sync
Manages monthly plan tickets and daily sub-issue lifecycles in Linear.
mbr-dashboard
Generates monthly business review summaries across all personal systems.

B. Biometrics, Nutrition & Pipelines

food-log
Processes meal photos and descriptions into calories and macros via vision API.
wearable-data-pipeline
Enforces cache tiering (Postgres → Redis → Pending) and freshness audits.
openwearables-reader
Read-only queries to Open Wearables database for raw biometric series.
reconstruct-run-from-hr
Reconstructs workout distance, pace, and zones from raw HR streams.
reconstruct-nap-from-hr
Detects and reconstructs afternoon rest sessions triggered by human notes.
run-feedback-analysis
Extracts qualitative training feedback (perceived exertion, fatigue markers).
energy-expenditure-pipeline
Calculates total daily energy expenditure combining BMR and active burn.
biometric-vision-scan
Captures camera receipts and analyzes facial fatigue and hydration cues.

C. Smart Home & Environment

circadian-lighting
Calculates color temperature and lux curves matching time of day.
tuya-driver
LAN-only smart home drivers for bulbs and sockets without cloud latency.
tuya-lan-control
Direct CLI interface for local socket communication to Tuya hardware.
openhue
Direct local Philips Hue bridge integration for desk and room lighting.

D. Operations, Learning & Continuous Feedback

daily-content-briefing
Ingests Apple Podcasts, frontier lab updates, model drops, and arXiv breakthroughs via daily-ai-brief MCP.
travel-commute-planner
Restructures day calendar around commute times and live traffic.
agent-weekly-review
Monday morning retrospective auditing cron execution and decision drift.
hermes-cron-maintenance
Health registry and watchdog for scheduled Hermes background crons.
llm-agent-evals
Automated LLM-as-a-judge scoring of decision traces in Langfuse.
integration-principles
Security standards: zero tokens in plaintext, reversible actions only.

09 / Tools & MCPs

Tools, MCPs & Actuators

Thermostat connects to macOS, external services, and hardware actuators through open Model Context Protocol (MCP) servers and deterministic CLI tools:

Native macOS Companion MCP (macos-mcp)

40 tools that give AI agents hands on your Mac: reads and schedules Calendar events (via EventKit), manages Apple Reminders and Apple Notes, controls Apple Music playback, captures FaceTime camera snapshots, checks Mail, and monitors Mac health (CPU load, memory pressure, battery, and thermal state) over local stdio with zero cloud latency.

Daily Intelligence MCP (daily-ai-brief)

Pulls overnight intelligence across frontier lab releases, newly dropped AI podcast episodes, open-source model drops, and breakthrough arXiv papers into structured briefing payloads for the 07:30 learning beat.

Research Papers MCP (find-research-papers-mcp)

Searches PubMed, arXiv, and Crossref to ground physiology, recovery, and training queries in peer-reviewed scientific literature rather than training-set approximations.

Project Tracking MCP (linear-mcp)
Linear GraphQL API

Reads active monthly plan tickets, creates daily sub-issues, posts continuity comments, and closes tickets with root-cause notes.

LAN Smart Home Actuators (Tuya & Philips Hue)
Local TCP Sockets & Bridges

Direct local socket communication to Tuya smart bulbs, IR blasters, and Philips Hue bridges. Executes circadian color temperature curves with zero cloud latency.


10 / Quality & Reliability

Deterministic & LLM-as-a-Judge Evals

To keep Thermostat reliable without human micromanagement, every skill run and daily beat is audited through a two-layer evaluation architecture:

1. Real-Time Deterministic Assertions (Zero-Token Guards)

Synchronous Guardrails

Fast programmatic checks validate outputs before notifications are dispatched or tickets are updated:

  • Freshness Bounds: Asserts that sleep/wearable timestamps are within 3 hours of execution. Rejects stale cache as UNVERIFIABLE.
  • Camera Frame Integrity: Asserts file size is ≥ 15 KB with valid JPEG magic bytes (ffd8ff) to prevent blank frame hallucination.
  • Strict Verdict Conformance: Validates that the agent returned an approved verdict enum (GO, DRIFTED, ON-TRACK, UNVERIFIABLE) and refused open-ended questions.
  • Delta-Only Enforcement: Verifies that if no parameters drifted against the 08:00 plan, the agent emitted [SILENT] or "No delta — plan holds".

2. LLM-as-a-Judge Trace Scoring (Langfuse)

Asynchronous Trace Evals

All agent runs, tool calls, and Slack conversational traces stream directly into Langfuse. During the Monday 09:30 Retrospective, an automated judge model scores decision traces across four rubrics:

Evidence Grounding & Factuality

Verifies that every cited number (HRV, RHR nadir, protein grams, temperature) maps exactly to the frozen current_context.json snapshot.

Tone & Anti-Sermonizing

Penalizes motivational lecturing, unsolicited life advice, or fluff. Enforces a crisp, objective builder voice.

Decision Gate Logic Fidelity

Audits whether the 4-input pre-exertion gate correctly evaluated calendar, HRV baselines, climate AQI, and fuel floors before issuing a GO verdict.

Action Reversibility & Safety

Confirms that all executed tool actions (Linear updates, Tuya light adjustments) stayed strictly within reversible bounds without destructive side effects.

Langfuse Reliability & Quality Metrics

Real-time telemetry and weekly judge evaluations across 1,400+ trace runs.

Overall Quality: 98.6%
Deterministic Zero-Token Pass Rates 98.9% Avg
Cron Heartbeat & OODA Liveness 100%
Decision Logging (SQLite Ledger) 100%
Report Well-Formedness & Length 100%
Freshness Bounds (< 3h timestamps) 98.4%
Silence & Delta Suppression 96.2%
Linear Issue Lifecycle Sync 92.0%
LLM-as-a-Judge Evaluation Scores 0.984 / 1.00
Evidence Grounding (Zero Hallucination) 0.99 / 1.00
Tone & Anti-Sermonizing (No Fluff) 0.98 / 1.00
4-Point Exertion Gate Logic Fidelity 1.00 / 1.00
Action Reversibility & Blast Radius 1.00 / 1.00
Plan Delta Adherence 0.95 / 1.00
Multi-Turn Rule Retention 0.97 / 1.00
6-Week Continuous Improvement Trajectory Weekly Retrospective Refinements
W01
86.2%
W02
89.4%
W03
93.1%
W04
95.8%
W05
97.5%
W06 (Live)
98.6%
Langfuse Trace Inspection trace_exertion_gate_1630
200 OK · 842ms Evaluated by Hermes-Judge-v1
span:context_platter_fetch
14ms · 12.4 KB JSON payload
span:freshness_assertions
8ms · Wearable tier: Postgres Finalized (< 2h)
span:4_point_gate_evaluator
32ms · Cal: Clear · HRV: +6% · AQI: 38 · Fuel: 110g
span:llm_verdict_synthesis
788ms · Verdict: GO · Target: 8.0km Zone 2 Aerobic
Grounding
1.00
Zero Hallucination
Anti-Sermon
0.98
Zero Preachiness
Gate Fidelity
1.00
4/4 Rules Passed
Reversibility
1.00
Safe Actuation

11 / Persistence Layer

Local Data Stores & Persistence

Thermostat relies on structured local databases (SQLite and PostgreSQL) rather than ephemeral prompt memory. Every observation, decision trace, and human override is recorded into dedicated tables:

1. Sensory & Weather Time-Series (telemetry_observations)

SQLite · telemetry.db

What it captures: Continuous time-series readings from room IoT boards (indoor temperature, relative humidity, VOC air quality, ambient lux, acoustic noise in dB, barometric pressure) paired with outdoor climate readings (ambient temp, feels-like heat index, UV index, wind velocity, multi-pollutant AQI, and 3-hour precipitation probability).

Why it stores it: Enables 60-minute rolling rate-of-change velocity calculations to catch sudden heat spikes or deteriorating indoor air quality before focus sessions or workouts begin.

2. Autonomous Decision Ledger (agent_decisions)

SQLite · ledger.db

What it captures: A complete immutable audit log for every scheduled beat (08:00 morning brief, 16:30 exertion gate, 22:30 ledger close). Each record stores the full frozen JSON snapshot of biometrics, schedule, and environment at that second, alongside the agent's synthesized step-by-step reasoning chain, the final verdict (GO, DRIFTED, ON-TRACK, UNVERIFIABLE), and emitted actuator payloads.

Why it stores it: Powers the Monday morning retrospective, enabling automated LLM-as-a-judge evals to inspect why a specific recommendation was made without relying on vague memory.

3. Ground-Truth & Human Override Store (human_feedback & meal_feedback)

SQLite · biome.db

What it captures: Direct human notes (e.g. typed meal corrections, manual nap notes, workout logs) alongside subjective ratings (1–5 scale), Rate of Perceived Exertion (RPE 1–10), and post-meal energy states (energetic vs sluggish).

Why it stores it: Serves as absolute ground truth. Whenever automated sensor models or vision estimations conflict with direct human entries, the human feedback record takes priority.

4. Monthly Composite Execution Scorecard (composite_scores)

SQLite · ledger.db

What it captures: Daily rolled-up performance metrics spanning workout volume vs weekly plan, strength habit adherence, sleep duration compliance against baseline envelopes, nutrition balance, and deep focus blocks defended.

Why it stores it: Computes 7-day, 14-day, 30-day, and 180-day rolling trend lines so the agent evaluates consistency against long-term envelopes rather than overreacting to single-day variance.

5. Biological Wearables & Podcasting Stores

PostgreSQL & Apple SQLite

What it captures: Open Wearables' PostgreSQL tables (meal_log and data_point_series for sleep stages, resting HR nadir, continuous HRV, and exercise heart rate) and macOS native Apple Podcasts database (MTLibrary.sqlite for newly downloaded episodes and played timestamps).

Why it stores it: Provides raw biometric and audio intelligence pipelines that feed the 15-minute context platter aggregator.


12 / Open Source Release

Open-Sourcing the Skills

The core capabilities of Thermostat are organized as open Markdown skills, deterministic context collector scripts, local relational schemas, and standard MCP tool servers.

The entire collection of Hermes skillpacks, schema migrations, and tool integrations is being prepared for open-source release on GitHub.