How aryanil89/smh-hermes works
Purpose and Runtime Topology
Hermes is an on-device AI operations layer for a Snapdragon X Elite laptop. It combines infrastructure telemetry, UNO Q physical sensors, and access state into incident assessments, proactive alerts, and a local operations wall. Core reasoning is Qwen3-4B served by Qualcomm GenieX on the laptop Hexagon NPU; Hermes Agent invokes local MCP servers over stdio. Main operational entry points are mcp-tools/src/dashboard/server.ts, MCP server launchers in mcp-tools/src/servers/, and the board application at uno-q/hermes-sensor-logger/python/main.py.
Telemetry and Sensor Ingestion
The UNO Q produces climate ticks, button/ToF events, and board-local SmolLM2 activity inferences. Its app writes events locally and pushes a log to the laptop over WiFi plus Tailscale; USB is provisioning only. The laptop environmental adapter reads that file, applies freshness checks and labeled mock fallback, forming the boundary between physical telemetry and application logic.
Paths: uno-q/hermes-sensor-logger/python/main.py, uno-q/hermes-sensor-logger/push_sensor_log.sh, mcp-tools/src/environmental/file-source.ts, mcp-tools/src/environmental/unoq-client.ts.
MCP Telemetry and Deterministic Assessment
Five stdio MCP servers expose network, storage, compute, environmental, and a one-call assessment endpoint. Network/storage and most compute data are simulated; host compute can use local OS metrics and preserves real versus mock provenance. The assessment service collects the telemetry families, computes reproducible risk/confidence, and appends UNO activity only after scoring so it cannot change the verdict.
Paths: mcp-tools/src/servers/network-server.ts, mcp-tools/src/servers/environmental-server.ts, mcp-tools/src/servers/assessment-server.ts, mcp-tools/src/assess/assess.ts.
Alerting and On-Site Suppression
A persistent watchdog evaluates environmental state every 15 seconds without calling the LLM. It persists alert state, edge-triggers alert/recovery delivery, and routes messages through a Telegram adapter when configured. Suppression is coupled to fresh access state: an expected enrolled responder can defer normal pages, while escalation or stale access state fails open and pages.
Paths: mcp-tools/src/alert-skill/watch-loop.ts, mcp-tools/src/alert-skill/tick.ts, mcp-tools/src/alert-skill/suppress.ts, mcp-tools/src/common/telegram.ts.
Access-Control Decision Loop
The dashboard server hosts both a read-only wall and the phone approval terminal. Presence events open challenges; captured images go through a pluggable identity ladder, then a decision matrix handles authorization, tailgating, anti-passback, and human approval/denial. Face CPU matching uses external Python/ONNX tooling; unmatched captures remain memory-only, while enrollment stores embeddings/audit state locally.
Paths: mcp-tools/src/access/sentry.ts, mcp-tools/src/access/identify.ts, mcp-tools/src/access/decide.ts, mcp-tools/src/dashboard/server.ts.
Human Interfaces and Messaging Boundaries
The local dashboard presents shared sensor, infrastructure, access, and alert state, and reads Hermes transcript data read-only. /phone.html is the sole human write surface for access decisions. Telegram is the only intentional cloud relay and carries messages, not inference or tool execution. Gateway hooks add early receipts and a degraded failover path when GenieX is unavailable.
Paths: mcp-tools/public/index.html, mcp-tools/public/phone.html, hermes-hooks/ack/handler.py, hermes-hooks/failover/handler.py.
Compute Tiers and Operations
Laptop inference requires Windows ARM64, Node 22+ for MCP tooling, Hermes Agent, and GenieX’s OpenAI-compatible localhost endpoint. The UNO Q independently runs SmolLM2-135M for pre-correlation. A Galaxy S25 Ultra runs a one-shot ADB-backed Qwen failover, explicitly degraded and tool-less. NPU profiling and serving/energy benchmarks are separate evidence harnesses, not runtime dependencies.
Paths: scripts/geniex-supervisor.ps1, llm-serving-bench/phone/run.sh, bench/bench.py, llm-serving-bench/bench.py.
Main entry points: server.ts Dashboard server · unoq-client.ts UNO Q client · environmental-server.ts Telemetry MCP servers · assessment-server.ts Assessment MCP server
Components 21
UNO Q Edge
Physical sensing and local pre-correlation.
- UNO Q sensor app · Produces climate, presence, and local activity events.
uno-q/hermes-sensor-logger/python/main.py - WiFi log push · Pushes the board event log to the laptop.
uno-q/hermes-sensor-logger/push_sensor_log.sh - SmolLM2 pre-correlation · Board-local activity inference.
Laptop MCP Layer
stdio tools, assessment, and alerting.
- Environmental file source · Reads pushed logs with freshness and mock fallback.
mcp-tools/src/environmental/file-source.ts - UNO Q client
mcp-tools/src/environmental/unoq-client.ts - Telemetry MCP servers · Network, storage, compute, and environmental telemetry with provenance.
mcp-tools/src/servers/environmental-server.ts - Assessment MCP server · Exposes one-call deterministic assessment.
mcp-tools/src/servers/assessment-server.ts - Risk scorer · Scores telemetry before appending UNO activity.
mcp-tools/src/assess/assess.ts - Alert watchdog · Evaluates environmental state every 15 seconds without an LLM.
mcp-tools/src/alert-skill/watch-loop.ts - On-site suppression · Fresh expected presence can defer normal pages; stale state fails open.
mcp-tools/src/alert-skill/suppress.ts - Telegram relay · Only intentional cloud relay; carries messages only.
mcp-tools/src/common/telegram.ts
Access & Wall
Local dashboard and access-control loop.
- Dashboard server · Hosts the read-only wall and phone approval terminal.
mcp-tools/src/dashboard/server.ts - Operations wall · Shows sensor, infrastructure, access, alert, and transcript state.
mcp-tools/public/index.html - Phone approval terminal · Sole human write surface for access decisions.
mcp-tools/public/phone.html - Access sentry · Opens access challenges from presence events.
mcp-tools/src/access/sentry.ts - Identity ladder · Uses pluggable matching; unmatched captures stay memory-only.
mcp-tools/src/access/identify.ts - Access decision matrix · Handles authorization, tailgating, anti-passback, and approval.
mcp-tools/src/access/decide.ts
Inference Tiers
Local NPU reasoning with degraded phone fallback.
- Hermes Agent · Invokes local MCP servers over stdio.
- GenieX / Qwen3-4B · OpenAI-compatible localhost inference on Hexagon NPU.
scripts/geniex-supervisor.ps1 - Gateway hooks · Add early receipts and degraded inference failover.
hermes-hooks/failover/handler.py - Galaxy Qwen failover · One-shot ADB-backed and tool-less.
llm-serving-bench/phone/run.sh
Connections 22
- UNO Q sensor app → SmolLM2 pre-correlation: activity inputs
- UNO Q sensor app → WiFi log push: event log
- WiFi log push → Environmental file source: WiFi/Tailscale
- Environmental file source → UNO Q client: fresh or mock data
- UNO Q client → Telemetry MCP servers: environmental telemetry
- Telemetry MCP servers → Assessment MCP server: telemetry families
- Assessment MCP server → Risk scorer: assess
- SmolLM2 pre-correlation → Risk scorer: append after scoring
- UNO Q client → Alert watchdog: environmental state
- Alert watchdog → On-site suppression: alert candidate
- On-site suppression → Telegram relay: edge-triggered page/recovery
- Dashboard server → Operations wall: serves
- Dashboard server → Phone approval terminal: serves
- Dashboard server → Access sentry: presence event
- Access sentry → Identity ladder: capture
- Identity ladder → Access decision matrix: identity result
- Phone approval terminal → Access decision matrix: approval or denial
- Access decision matrix → On-site suppression: access freshness
- Hermes Agent → Telemetry MCP servers: stdio tools
- Hermes Agent → Assessment MCP server: stdio assessment
- Hermes Agent → GenieX / Qwen3-4B: local inference
- Gateway hooks → Galaxy Qwen failover: GenieX unavailable