Key Outcomes
- Native iOS app + web launched
- Near‑real‑time plans with automated validation
- Prototype to production: weeks, not months
- Clean integrations with nutrition data and shopping lists
Problem
Families and individuals want meal plans and grocery lists that respect allergies, preferences, and macros. Off‑the‑shelf tools were rigid and vendor‑locked, making it hard to adapt quickly and personalize.
Approach
Ship a dual‑channel experience (iOS + web) backed by an agentic workflow that plans meals, explains choices, and generates a grocery list. Generation is near real‑time in the app; during development we used human review to tune prompts, choose models, and encode constraints. In production, automated validation checks enforce quality (e.g., block off‑limits ingredients, ensure required macros) with fallbacks when needed.
We started with a “thin, ownable slice”: one week of dinners for a specific profile. Once reliable, we expanded to full‑week plans, substitutions, and pantry‑aware suggestions.
Architecture
The agent orchestrates retrieval, tool use, and evaluation with validation gates:
- Preferences + constraints: dietary flags, allergies, cuisines, macros
- Retrieval: candidate recipes from a curated corpus and nutrition data APIs
- Tools: nutrient calculation, substitution finder, grocery list generator
- Planner: select a week of meals and justify the plan with citations
- Evals: hard rules (allergen/ingredient bans) and soft scores (variety, prep time)
Stack highlights:
- iOS: native app (Swift/Xcode) with Firebase Auth + Firestore for state
- Paywall: Nami integration with StoreKit (in‑app purchase)
- LLM backend: Firebase Cloud Functions (Node 20, TypeScript)
- Queue + worker model in Firestore (
llmJobs
,llmControl
) - Google Vertex AI (Gemini 2.5 Flash) via OAuth‑minted access tokens
- Concurrency shaping, idempotency, and short‑term cache (
llmCache
) - Usage + reliability metrics (
llmMetrics
) and graceful 429 handling
- Queue + worker model in Firestore (
- Web: static site generator (Node 22) for SEO recipe pages + tags
- JSON‑LD Recipe/CollectionPage, sitemap, RSS
- Optional Supabase source of truth and image generation pipeline
- Recipe images via Google Gemini 2.5 Image (Vertex or Gen Language API)
- Marketing dashboard (admin‑only) to bulk‑generate recipes and images so we can ride social trends and expand SEO coverage quickly
Validation checks
- Allergen blacklist (user‑specific; blocks off‑limits ingredients)
- Required macros within targets (calories, protein, carbs, fats)
- Prep‑time bounds per plan (keeps total prep under a threshold)
Results
- Reliable plans that respect user constraints with automated validation
- Faster change velocity: weekly improvements to rules, tools, and prompts
- Foundation for future features (pantry sync, family sharing, partner grocery integrations)
Stack
- Channels: native iOS app; public website (static, SEO‑first)
- Patterns: planning + tool use; retrieval‑augmented generation; validation gates
- Backend: Firebase Auth/Firestore; Cloud Functions (Node 20/TS)
- Models: Google Vertex AI (Gemini 2.5 Flash; JSON‑mode with continuation)
- Safety: runtime validation (allergen/ingredient constraints), strict prompting
- Observability: Firestore metrics (cache hits, 429s, token usage), logs
Roadmap
- Meal‑prep batching and nutrition targets per user
- Pantry import from receipts/previous orders
- Partner integrations for one‑click carts and delivery windows
Visit
- Live site: reciperx.ai