Chip

Chip — Natural Language to Device Rules

NL to LLM to device commands; the resulting rules run offline in firmware.

Chip — Natural Language to Device Rules (v2026-08-22T175604Z-b502e8bc6d) 2026-08-27 | NL to LLM to device commands; the resulting rules run offline in firmware. 1 - AI Loop - Natural Language to LLM to Device Commands User POST /api/chip/chat chip_api.py POST /api/chip/chat _get_device_state _cmd chip_memory.db chip_memory table Device rule_manager.cpp CommandManager::process user message device state device command 2 - Rule Loop - Offline Rule Evaluation rule_manager.cpp evaluate addRule removeRule LittleFS /rules.json rule evaluation 1. User sends message 2. chip_api.py processes messa… 3. chip_api.py fetches device… 4. chip_api.py sends command t… 5. Device executes command 6. RuleManager evaluates rules POST /api/chip/chat request { "node_id": "device123", "message": "Turn on relay 1", "provider": "claude-haiku-4-5" } RuleManager rule structure { "id": "rule123", "name": "Relay 1 On", "sensor": "relay1", "condition": "eq", "threshold": 0, "on_cmd": "RELAY 1 ON", "off_cmd": "RELAY 1 OFF" } The AI Loop handles natural language input and translates it into device commands using an LLM. The Rule Loop evaluates offline rules stored in LittleFS and executes corresponding device commands. Legend actor = initiates work · process = code path · store = state on disk · bus = durable queue · dashed = separate process cyan = request flow · pink = state read/write · dashed green = pull / return path · red = refusal As of 2026-08-27 14:59 UTC, from commit 1b71989

Provenance

This drawing is generated, not drawn. It is rebuilt from the source files below, so when they change the picture changes — a diagram here cannot quietly describe a system that no longer works this way.

Owner
Chip
Slug
chip-device-ai
Rendered
2026-08-22T175604Z
From commit
b502e8bc6d
Updated
27 Aug 2026, 14:59 UTC
Sources at
1b71989
Watches
3 paths
  • daemon/src/chip_api.py
  • firmware/mx/lib/App/rule_manager.cpp
  • firmware/mx/lib/App/rule_manager.h