Commit Graph

8 Commits

Author SHA1 Message Date
f38ee499ae feat(bot): unified topic processor replacing router+interpreter stack
Replace 3-layer architecture (gpt-5-nano router + gpt-4o-mini interpreter) with
single unified topic processor (gpt-4o-mini) for simplified message handling.

New components:
- HouseholdContextCache: TTL-based caching (5 min) for household config data
- TopicProcessor: Unified classification + parsing with structured JSON output

Key changes:
- Renamed ASSISTANT_ROUTER_MODEL → TOPIC_PROCESSOR_MODEL
- Added TOPIC_PROCESSOR_TIMEOUT_MS (default 10s)
- Refactored save() → saveWithInterpretation() for pre-parsed interpretations
- Removed deprecated createOpenAiTopicMessageRouter and ~300 lines legacy code
- Fixed typing indicator to only start when needed (purchase routes)
- Fixed amount formatting: convert minor units to major for rawText

Routes: silent, chat_reply, purchase, purchase_clarification, payment,
payment_clarification, topic_helper, dismiss_workflow

All 212 bot tests pass. Typecheck, lint, format, build clean.
2026-03-14 13:33:57 +04:00
9cac339d0a fix: improve AI router prompt for topic message routing
- Add engagement rule: respond when engaged=yes/mention/reply (not silent)
- Add explicit purchase rules: classify as candidate when realistic items + amount
- Add fantastical purchase rule: respond with chat_reply (playful), not silent
- Add payment classification rules
- Simplify prompt structure for clarity
2026-03-14 10:44:03 +04:00
f1670c521f Refine topic workflow followups 2026-03-13 02:21:08 +04:00
88b50d2cb7 Refine topic assistant conversation context 2026-03-12 22:00:31 +04:00
401bbbdcca Refine topic context and purchase followup guards 2026-03-12 20:24:50 +04:00
23faeef738 feat(bot): add topic history-aware assistant replies 2026-03-12 19:06:51 +04:00
5ebae7714c fix(bot): improve purchase-topic conversation flow 2026-03-12 18:23:26 +04:00
8374d18189 feat(bot): add shared topic router 2026-03-12 17:12:26 +04:00