← BACK TO HOME

AI AGENT / FULLSTACK

myBot, a LINE Fitness Coach

AI meal logging from photos

Flow diagram of myBot next to a real LINE chat: a meal photo goes in, the bot asks a follow-up question, the user replies, and calories and nutrients come back

Logging food usually means opening an app, searching for each item and filling in a form; with myBot, you start by taking a photo. In the backend I put the LLM last, to keep cost and latency down and the replies more predictable: rules catch explicit commands, a formula works out daily calorie needs, and only photos and messages that need language understanding reach the LLM.

ROLE

Solo backend developer

STACK

TypeScript · Vercel Serverless · Gemini · Supabase

LINE bot · 8-layer intent routing · solo backend

HIGHLIGHTS

  1. Rules before Gemini: 8-layer intent routing runs cheap regex and keyword checks on explicit commands first, and only what gets past them reaches Gemini
  2. Asks about portion size: photo recognition takes two steps; the bot saves a pending_context with a TTL, asks a follow-up and ties the two LINE webhook calls (photo and reply) together, so Gemini's portion estimate is more accurate
  3. Cycle-aware replies: the menstrual cycle is split proportionally into four phases, and the current phase goes into the system prompts of three LLMs (coach, cravings, strength training)
  4. TDEE by formula: calculated with the Mifflin-St Jeor equation, not estimated by the LLM, so the same inputs always give the same number