🍽️ About BiteAid
Inspiration
The 2 AM regret.
I was cramming for a midterm, exhausted, and ordered pizza at 11 PM. Two hours later, I couldn't sleep, my stomach was still digesting that heavy meal. I woke up groggy, bombed the exam, and thought: "I knew this was a bad idea. Why did I eat it anyway?"
This happens to millions of students, athletes, and professionals every day. We know certain foods will hurt our performance, but we eat them anyway because we're hungry, stressed, and don't know exactly when the crash will hit or how to minimize the damage.
Current food apps just shame you: "This is unhealthy." Thanks, genius. But they don't help you eat it smarter.
That's why I built BiteAid.
What It Does
BiteAid is the first context-aware food AI. It doesn't judge what you eat, it shows you:
- What to eat first (protein before carbs)
- What to skip (fries = crash zone)
- What happens next (timeline: crash at 1.5h, right when your exam starts)
Same meal. Different context. Different advice.
- Exam in 2h: "Skip fries entirely, crash risk 30min before exam"
- Late night study: "Eat only 2/3, finish by 10pm for midnight sleep"
- Pre-workout: "Timing mismatch, eat AFTER gym"
Upload a photo. Add context (text or voice). Get instant harm reduction advice.
Gemini 3 Integration
BiteAid leverages Gemini 3's Extended Thinking (2048 tokens) to perform complex biological reasoning that traditional AI cannot achieve. When a user uploads a meal photo and provides context like "exam in 2 hours," Gemini doesn't just identify foods, it reasons through multi-step metabolic processes:
- Multimodal Analysis: Gemini 3 Flash analyzes the meal image to detect individual food items (chicken, rice, fries)
- Extended Thinking: Gemini 3 Pro uses deep reasoning to calculate: absorption timelines (fat digestion 60-90min, carbs 30-45min), energy peak timing (+45min carb spike), crash prediction (+90min insulin response), and timing delta analysis (crash at 90min vs exam at 120min)
- Context-Aware Prompting: Different prompts are sent to Gemini based on mode, exam mode focuses on crash prevention and alertness, late-night mode on sleep quality and sustained energy, workout mode on performance timing
- Structured Output: JSON schemas ensure reliable, actionable harm reduction advice without hallucinations
Gemini 3's multimodal intelligence (vision + text), extended thinking for biological reasoning, and structured output capabilities make BiteAid's context-aware harm reduction possible. No other AI can chain these capabilities together for real-time decision support.
How I Built It
Architecture
- Frontend: React 19 + TypeScript (~2,084 lines of code)
- AI Engine: Gemini 3 Pro (Extended Thinking) + Gemini 3 Flash (image analysis)
- Voice Input: Web Speech API
- Export: jsPDF + html2canvas
- Build Tool: Vite
The Gemini 3 Magic
1. Extended Thinking (2048 tokens)
When you say "exam in 2 hours," Gemini doesn't just see food, it reasons through:
1. Detected: Fried chicken (high fat), white rice (high GI)
2. Absorption timeline: Fat = 60-90min, carbs = 30-45min
3. Energy peak: +45min (carb spike)
4. Crash prediction: +90min (insulin response + fat digestion)
5. Exam timing: 2 hours = 120min
6. Delta analysis: Crash at 90min vs exam at 120min
7. Harm assessment: "Crash 30min before exam—CRITICAL"
8. Strategy: "Remove rice, keep protein, add water"
This is biological reasoning, not pattern matching.
2. Adaptive Prompting
Different context = different prompt:
- Exam mode: Focus on alertness, crash prevention
- Late night mode: Sleep quality, digestion load
- Workout mode: Performance timing, bloating risk
- Meeting mode: Breath freshness, visible fatigue
The same image gets analyzed differently based on your life.
3. Multimodal Intelligence
Gemini analyzes:
- Image: Detect foods (chicken, rice, fries)
- Text: Understand messy context ("got test tmrw lol")
- Structured output: JSON schemas prevent hallucination
4. Real-time Processing
- Image analysis: <500ms
- Full harm reduction analysis: ~2-3 seconds
- Streaming: Results appear as generated
Privacy-First Design
- No user accounts
- No data storage (session-based only)
- Photos analyzed in real-time, deleted immediately
- No tracking, no analytics
- Client-side processing only
Challenges I Faced
1. Extended Thinking Prompt Engineering
Problem: Gemini 3's extended thinking is powerful but required precise prompting to output biological reasoning instead of generic advice.
Solution: Spent days iterating on prompts. Key breakthrough: explicitly asking Gemini to "show your work" in steps:
1. Detect foods
2. Calculate absorption timelines
3. Predict energy peaks
4. Assess timing delta (crash vs event)
5. Generate harm reduction strategy
This forced Gemini to reason step-by-step instead of jumping to conclusions.
2. Context Detection Accuracy
Problem: Users type messy context: "got midterms tmrw need to cram tonight". How do you detect:
- Is this exam mode or late-night mode?
- Urgency level?
- Timeline?
Solution: Multi-stage context detection:
- Keyword extraction: "midterms" = exam, "tonight" = late night, "cram" = urgency
- Time sensitivity parsing: "tmrw" = 12-16 hours away
- Mode selection logic: If eating NOW for TONIGHT activity → late night mode
- Adaptive timeline: Late night = 4 hours (covers study session)
Gemini 3's language understanding made this possible, it handles typos, slang, and ambiguity.
3. Timeline Generation Complexity
Problem: How do you generate a context-aware timeline?
- Exam mode: 2-hour timeline, focus on crash timing
- Late night mode: 4-hour timeline, focus on sleep impact
- Default mode: 6-hour timeline, general energy projection
Solution: Dynamic timeline generation:
// Exam in 2h → 5 points, focus on crash
timeline = [
{ time: "now", energy: 80 },
{ time: "+30min", energy: 95 }, // peak
{ time: "+1h", energy: 75 }, // decline
{ time: "+1.5h", energy: 60 }, // ⚠️ crash zone
{ time: "+2h", energy: 55 } // ❌ exam starts
]
Each mode has custom logic for:
- Number of timeline points
- Time intervals
- Focus metrics (energy vs sleep vs performance)
- Warning thresholds
4. Simulation Feature
Problem: Users wanted to see "what if I skip the fries?" but calling Gemini for every simulation is slow and expensive.
Solution: Two-tier simulation:
- Fast simulation: Re-analyze detected foods minus the removed item
- Gemini analysis: Call Gemini with modified food list
- Impact comparison: Show metric changes (energy +10%, crash delay +30min)
This lets users explore trade-offs in ~2-3 seconds.
5. Voice Input Reliability
Problem: Web Speech API is browser-dependent and can fail silently.
Solution:
- Feature detection before enabling voice
- Fallback to text input if unavailable
- Clear error messages
- Visual feedback (microphone icon animation)
6. Mobile Responsiveness
Problem: Timeline graphs, food chips, and analysis cards broke on mobile.
Solution: Responsive grid layouts with Tailwind:
// Desktop: side-by-side, Mobile: stacked
<div className="grid md:grid-cols-2 gap-4">
Tested on iPhone, Android, tablets, works everywhere.
What I Learned
Technical
- Extended thinking is a game-changer: Not just "smarter GPT", it's a fundamentally different reasoning paradigm. Watching Gemini reason through metabolic processes step-by-step was mind-blowing.
- Prompt engineering is an art: Spent 40% of dev time iterating on prompts. Small wording changes = huge output differences.
- Multimodal is harder than it looks: Combining image + text + context requires careful data flow and error handling.
- Structured output prevents hallucination: JSON schemas are non-negotiable for production apps.
Product
- Harm reduction > prevention: People don't want to be told "don't eat that." They want: "You're eating it? Here's how to minimize damage."
- Context is everything: Same food = different advice. This is BiteAid's killer feature.
- Privacy sells: "No accounts, no tracking" resonates deeply with users.
Personal
- Ship fast, iterate faster: V1 was basic (just image analysis). V2 added context. V3 added voice. V4 added simulation. Each version taught me something.
- User feedback is gold: Students said "I want to know when I'll crash", boom, timeline feature. "Can I see what happens if I skip the rice?", boom, simulation.
What's Next for BiteAid
- Today's Bite: Point your phone at the canteen, scan options, tell us your goal (focus/energy/recovery), get real-time guidance on what to pick, what to pair, what to skip
- Group harm reduction: Analyze meals for multiple people at once
- Offline mode: Local model for privacy + speed (TensorFlow Lite)
Why This Matters
For Users
Bad meals compound:
- Exam crash → lower grade → GPA impact → career consequences
- Poor sleep → chronic fatigue → mental health decline
- Wrong pre-workout fuel → injury → months of recovery
BiteAid doesn't prevent bad meals. It reduces the harm when they happen.
Because let's be real: you're eating that pizza. The question is: how do you eat it smarter?
For AI Research
BiteAid demonstrates:
- Context-aware prompting at scale
- Extended thinking for biological reasoning
- Multimodal chaining (vision + text + context)
- Adaptive UX based on AI interpretation
- Harm reduction as an AI application domain
Pushes boundaries of what AI can do for daily decisions.
Try BiteAid
👉 Live Demo: BiteAid on AI Studio
Built with Gemini 3 Hackathon
Eat Now, Fix Later.
Built With
- api
- css
- gemini3
- gemini3flash
- gemini3pro
- googleaistudio
- html2canvas
- jspdf
- react19
- tailwind
- typescript
- vite
Log in or sign up for Devpost to join the conversation.