Inspiration

MealMate was born from a universal frustration: "What should I eat?" Whether you're trying to lose weight, control blood sugar, build muscle, or just cook something with whatever's left in the fridge, the daily decision is exhausting. Existing apps either track calories like a spreadsheet or give generic recipes — none understand you: your health goals, your available ingredients, your mood after a long day at work.

What it does

MealMate is an AI-powered smart chef that turns natural language into personalized recipes. Tell it "加班晚了,想吃点快的,有鸡蛋和面条" and it analyzes your health profile (BMI, goals, allergies), checks nutritional constraints, and generates a tailored recipe — complete with calories, macros, GI level, and a warm chef's note. It supports:

  • Smart Chef — natural language → multi-agent recipe generation
  • Image Recognition — snap a photo of your fridge, AI identifies ingredients
  • Reverse Engineering — upload a food photo, AI guesses how to cook it
  • Workflow Engine — multi-step agent chains (profile → nutrition → chef)
  • Bilingual UI — Chinese & English

How we built it

Backend: FastAPI (Python 3.12) with a modular multi-agent architecture. Each agent (ProfileAgent, NutritionAnalyzer, SmartChefAgent) is an independent unit that calls the LLM with specialized prompts, orchestrated through a unified pipeline.

Frontend: React + Vite + TailwindCSS, with a warm sage-toned UI designed for Chinese users. Axios for API calls, Lucide icons.

LLM: DeepSeek V4 Flash via OpenAI-compatible API (deployed with StepFun/MiMo fallback). Multi-provider client with retry, circuit breaker, and health monitoring.

Deployment: Production on Alibaba Cloud ECS (Alibaba Cloud Linux 8), Python 3.12 compiled from source, Nginx reverse proxy with SSL (bms.xiaoxianglink.com), SQLite database.

Challenges we ran into

  • Multi-agent orchestration: Getting agents to share context correctly without losing profile constraints
  • LLM timeout tuning: DeepSeek API response times varied wildly with prompt complexity — had to tune both backend (300s) and Nginx (180s→300s) timeouts
  • Environment variable hell on Alibaba Cloud: load_dotenv silently failed due to encoding issues, took hours to debug
  • Image recognition format: Xiaomi MiMo vision API didn't support detail: "high" — had to strip it
  • CORS & proxy: Frontend Vite dev server → backend → nginx → domain proxy chain required careful configuration

Accomplishments that we're proud of

  • A fully functional AI chef running on a Chinese cloud server with a Chinese domain, serving real users
  • Multi-agent architecture that actually works — users see "profile analysis → nutrition analysis → chef generating" in real time
  • Successfully switched from StepFun → Xiaomi MiMo → DeepSeek without changing a single line of agent code (provider abstraction worked)
  • The Smart Chef's "chef_chat" response — a warm, personalized message — consistently makes users smile

What we learned

  • Provider abstraction pays off: swapping LLM backends is a config change, not a code change
  • Nginx timeout defaults (60s) will silently kill long LLM calls — always set proxy_read_timeout
  • Chinese cloud environments have unique quirks (mirrors needed for pip/Python source, security group rules, SELinux)
  • Users prefer "talk to a chef" over "fill out a form" — natural language input dramatically lowers friction

What's next for MealMate

  • Agent Teams — parallel multi-agent execution (profile + nutrition simultaneously)
  • Meal Planning — weekly meal plans aligned to health goals
  • OCR Ingredients — scan supermarket receipts to auto-stock your virtual fridge
  • WeChat Mini Program — reach users where they already chat about food

Built With

  • ai
  • chief
  • coding
  • meal
  • vibe
Share this project:

Updates