SafeBite AI: Allergy-Aware Meal Planner Powered by Mastra & Gemini
This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend Check it out SafeBite AI — Allergy-Aware Agentic Meal Planner Live Demo: https://safebite-agent.onrender.com/
This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
Check it out
SafeBite AI — Allergy-Aware Agentic Meal Planner
- Live Demo: https://safebite-agent.onrender.com/
- Hacktoberfest Submissions: Best Use of Mastra | Best Use of Render
- Code: Github Repo https://github.com/AdahJerrie/safebite-agent.git
Inspiration
Planning daily meals while managing food allergies or strict dietary restrictions is a constant source of stress for my friend who is very selective because of allergies. Standard recipe generators often output unsafe suggestions or fail to spot hidden allergen risks (such as dairy derivatives in pre-packaged items or peanut cross-contamination).
I created SafeBite AI to solve this problem with true agentic reliability. Powered by Mastra AI and Google Gemini, SafeBite doesn't simply prompt a static LLM—it runs an autonomous agent that screens pantry ingredients through real-time tool checks before generating a verified recipe.
📸 Proof of Functionality & Screenshots
1. Interactive Dashboard & Restrictions Selector
Users select active dietary restrictions (e.g., Peanuts, Dairy) and specify available pantry ingredients along with a maximum prep time limit.
Check out the demo: https://safebite-agent.onrender.com/
2. Autonomous Agentic Output & Recipe Verification
The Mastra agent validates ingredients against all listed restrictions and generates a structured, step-by-step recipe ("Quick Garlic Chicken & Wilted Spinach Rice Bowl").
What It Does
- Dynamic Restriction & Pantry Inputs: Allows users to toggle active allergens (Peanuts, Tree Nuts, Dairy, Eggs, Soy, Gluten, Shellfish, Fish) and input exact pantry items.
-
Autonomous Ingredient Screening: The
safeBiteAgentleverages Mastra's tool-calling engine to executeallergenCheckerTool, inspecting every ingredient before finalizing the recipe. - Execution Telemetry: Displays live agent status badges and execution telemetry on the interface so users can confirm active safety validation.
- Clear Markdown Recipes: Outputs comprehensive cooking instructions complete with prep time breakdowns, safe ingredient lists, and safety disclaimers.
How I Built It
-
Agent Framework: Mastra AI (
@mastra/core) for agent instructions, tool binding, and runtime execution. -
LLM Model Provider: Google Gemini (
gemini-3.8-flash) via@ai-sdk/google. -
Frontend & Design: Next.js 15 (App Router) with Tailwind CSS v4 dark mode and
react-markdown. - Deployment Platform: Deployed directly as a Node.js web service on Render.
Challenges I Ran Into
-
Module Resolution & Build Errors: Configured PostCSS and Tailwind v4 to use
.cjsextensions to handle Next.js ESM module constraints ("type": "module"). -
AI SDK Compatibility: Resolved version specification mismatches between
@mastra/coreand@ai-sdk/googleto enable seamless tool calling withagent.generate(). -
Production Build Dependencies: Adjusted dependency configurations to ensure Render's automated build pipeline cleanly installs
@tailwindcss/postcss.
Accomplishments
- True Tool-Driven Workflow: Built an AI agent that actively invokes validation tools instead of relying solely on raw text generation.
- Seamless Render Deployment: Successfully hosted the application at safebite-agent.onrender.com with automated builds and fast response times.
Prize Category Submissions
-
Best Use of Mastra: Architected using Mastra's core Agent framework, custom tool orchestration (
allergenCheckerTool), and execution telemetry. - Best Use of Render: Deployed and actively running in production as a Render Web Service.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.
