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-02T101544Z-ab2bbdebf5) 2026-08-02 | "NL to LLM to device commands; the resulting rules run offline in firmware." 1 - AI Loop - Natural Language to LLM to Device Commands POST /api/chip/chat chip_api.py:533 node_id, message, provider? _call_llm chip_api.py:_call_llm system, message, provider chip_memory.db chip_api.py:533 device_id, key, value _cmd chip_api.py:_cmd node_id, command natural langua… LLM system pro… memory state 2 - Rule Loop - Offline Device Command Execution /rules.json rule_manager.cpp:349 id, name, sensor, condition, threshold, on_cmd, off_cmd RuleManager::evaluate rule_manager.cpp:128 sensor readings condition evaluation command execution rules from mem… 1. Receive natural lan… 2. Call LLM with syste… 3. Process LLM respons… 4. Store relevant stat… 5. Execute generated d… 6. Load rules from /ru… 7. Evaluate sensor dat… 8. Trigger device acti… LLM System Prompt Template { "response": "<plain English confirmation>", "tool_calls": [{"tool": "<name>", "args": { ... }}]} If no tool is needed, reply: { "response": "<answer>", "tool_calls": [] } Rule JSON Structure { "id": "8-char hex UUID", "name": "human-readable name", "sensor": "sensor type", "condition": "gt|lt|eq|ne|ge|le", "th… The AI Loop handles natural language input and translates it into device commands using an LLM. The Rule Loop executes offline rules based on sensor data without requiring network or LLM interaction. 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

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-02T101544Z
From commit
ab2bbdebf5
Watches
3 paths
  • daemon/src/chip_api.py
  • firmware/mx/lib/App/rule_manager.cpp
  • firmware/mx/lib/App/rule_manager.h