Benchmark: smart home commands (medium) mis-routed to light #9

Closed
opened 2026-03-24 01:58:18 +00:00 by alvis · 0 comments
Owner

Problem

Smart home control commands that require HA tool calls are classified as light:

  • "выключи свет на кухне" → light
  • "включи вентилятор в детской" → light
  • "установи температуру 22 градуса" → light
  • "открой шторы в гостиной" → light
  • "выключи все лампочки" → light
  • "выключи свет во всём доме" → light (expected medium, marked ok=false)

Also personal memory queries route to light:

  • "как меня зовут" → light
  • "где я живу" → light
  • "что мы обсуждали в прошлый раз" → light

Root Cause

_MEDIUM_PATTERNS matches включи|выключи|открой... BUT only if followed by a space: (?:включи|выключи|открой|закрой|установи|поставь|убавь|прибавь|переключи)\s. The _LIGHT_PATTERNS regex runs first via .match() and does NOT match these, so they fall through to the semantic embedder. The embedder apparently finds these closer to the light centroid (short imperative sentences).

For memory queries, _MEDIUM_PATTERNS has как меня зовут|где я живу|... but these also lose to the embedder path when the regex order evaluation puts them after the light check and the light centroid wins.

Fix

  • Move _MEDIUM_PATTERNS.search() check BEFORE the semantic embedder call (it already runs before embedder but after _LIGHT_PATTERNS)
  • Verify _MEDIUM_PATTERNS actually matches these strings — test the regex
  • Add выключи свет, включи свет, открой шторы to the regex pattern explicitly without the trailing \s requirement

Impact

~12 medium smart-home + memory queries misclassified as light

## Problem Smart home control commands that require HA tool calls are classified as `light`: - "выключи свет на кухне" → light - "включи вентилятор в детской" → light - "установи температуру 22 градуса" → light - "открой шторы в гостиной" → light - "выключи все лампочки" → light - "выключи свет во всём доме" → light (expected medium, marked ok=false) Also personal memory queries route to light: - "как меня зовут" → light - "где я живу" → light - "что мы обсуждали в прошлый раз" → light ## Root Cause `_MEDIUM_PATTERNS` matches `включи|выключи|открой...` BUT only if followed by a space: `(?:включи|выключи|открой|закрой|установи|поставь|убавь|прибавь|переключи)\s`. The `_LIGHT_PATTERNS` regex runs first via `.match()` and does NOT match these, so they fall through to the semantic embedder. The embedder apparently finds these closer to the light centroid (short imperative sentences). For memory queries, `_MEDIUM_PATTERNS` has `как меня зовут|где я живу|...` but these also lose to the embedder path when the regex order evaluation puts them after the light check and the light centroid wins. ## Fix - Move `_MEDIUM_PATTERNS.search()` check BEFORE the semantic embedder call (it already runs before embedder but after `_LIGHT_PATTERNS`) - Verify `_MEDIUM_PATTERNS` actually matches these strings — test the regex - Add `выключи свет`, `включи свет`, `открой шторы` to the regex pattern explicitly without the trailing `\s` requirement ## Impact ~12 medium smart-home + memory queries misclassified as light
alvis closed this issue 2026-03-24 02:52:44 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alvis/adolf#9