MacroDeckDocs
AI meal plans

AI meal plans

The conversational meal-plan workspace — generate a plan, talk to the AI to refine it, validate against clinical rules, and fix it for a specific client.

The AI workspace is where you go from "this client needs a plan" to a finished, rule‑checked week in a few minutes. It's a grid you can edit by hand and a chat assistant that edits it for you — both working on the same plan, live.

This page covers the workspace itself. For the building blocks it draws on (templates, foods, ingredients) see Meal plans and Food library.

Starting a session

There are two entry points, and they set the workspace's mode:

  • Client mode — open the client, go to the Meal Plan tab, click New meal plan. The plan is built for that client and knows their targets, conditions, allergies, and taste profile.
  • Template mode — open Meal Plan Templates in the sidebar and click New Meal Plan Template. You're authoring a reusable library template with no client attached.

You then pick how to begin. The options differ by mode, because only a client gives the AI something to generate against:

For a client:

OptionWhat happens
Generate a fresh plan (default)The AI composes the whole week from scratch against the client's targets, conditions, and taste profile.
Start from a templateFork one of your saved templates, then review it for this client.
Blank planAn empty grid you fill yourself.

For a library template there's no client to generate against, so you get Duplicate existing (fork a saved template) or Blank plan — then set the targets and conditions in the editor.

Start a meal plan session

Tip: the old /ai-meal-plans/designer link now opens the same workspace — there's one canonical editor for both library and client plans.

The generation loader

If you chose Generate, you'll see a staged progress display while the engine works — analysing the profile and targets, picking dishes from the food pool, balancing macros across the week, running the nutrition and rule checks, and finalising. It takes up to a minute; the plan drops straight into the grid when it's done.

The workspace

AI meal plan workspace

Three parts:

The grid — rows are meal slots (Early Morning → Dinner), columns are days. Each cell holds one or more dishes with their per‑serving macros (kcal · P · C · F). The row under each day tallies the day's totals against the target so you can see the balance at a glance. A coloured ring on each cell tells you its validation state:

  • Green — checked, no issues.
  • Amber — a warning.
  • Red — a hard error (an allergen, an unsafe dish for a condition).
  • Grey — not yet validated.

The editor buttons (top of the grid) open focused panels for the inputs that drive the plan. Closing any panel re‑validates the plan.

ButtonWhat you edit
Macros (client) / Targets (library)Daily kcal and protein / carb / fat targets.
ConditionsAllergies and disease flags the plan must respect.
Taste profile (client)Diet type, likes, dislikes.
Food poolInclude or exclude specific dishes for this plan.
RulesTurn rules on/off and tune their thresholds (see Rules).

The chat — the floating Ask AI button (bottom‑right) opens the assistant. On a wide screen you can Dock to side to pin it as a rail next to the grid.

Talking to the assistant

The chat edits the plan in place. You write what you want in plain language; the assistant reads the current plan, finds candidate dishes, makes the change, and re‑checks it. Things it can do:

  • Regenerate a cell or a whole day — "redo Wednesday lunch", "regenerate day 3".
  • Swap a dish — "replace the paneer with a dal at dinner".
  • Adjust targets and recompose — "make it 1,500 kcal", "more protein".
  • Apply a constraint — "make it diabetic‑safe", "avoid peanuts everywhere".
  • Freeze a slot so it survives the next regeneration, or add / remove a component.

Every edit is applied to the grid and immediately re‑validated, so you see the macro totals and validation rings update as the conversation goes. Use Undo / Redo in the header if a change isn't what you wanted.

Validation

The workspace continuously checks the plan against a library of clinical and structural rules. The validation summary sits in the header:

  • No issues — green, everything passes.
  • N errors · M warnings — click it to see the list.
  • Not validated — nothing's been checked yet; hit Validate / Re‑check.

Validation panel

The violation list is grouped by day. Each row tells you the location (e.g. Day 3 · Lunch or Plan‑wide) and the rule's message. Click any violation to jump the grid to that cell and flash it, so you can fix it in context.

Fixing a plan for a client

When you build a generic plan (or assign a template) to a specific client, the workspace can flag everything that doesn't fit that client — allergens, condition conflicts, medication interactions. Those appear in an amber review bar with two ways forward:

Fix… opens a dialog where you pick how aggressively the AI should change the plan:

PolicyWhat it changes
ConservativeSwaps only the unsafe dishes and rescales portions. Keeps the curated pool.
StandardAlso pulls from the wider library, drops a dish if there's no compliant swap, and rebalances to the calorie target.
ThoroughAlso rebalances protein and variety, and regenerates any day that still fails.

Hit Preview changes to see the fix as a diff overlay on the grid — changed cells glow, removed dishes show as ghosts — then Apply or Discard.

Regenerate rebuilds the plan from scratch instead of patching it. It includes a season picker, so you can plan ahead; out‑of‑season ingredients are excluded with a safe fallback.

The rules

The Rules editor button shows every rule the plan is checked against. Most run automatically; some you can tune (thresholds, frequency windows) and some you can switch off, while a few safety‑critical ones are locked on. They fall into a few families:

  • Dietary — the session's diet type (veg / non‑veg / vegan / egg / Jain) and allergy avoidance (locked on — a dish touching any client allergen is dropped).
  • Disease & medication — drops dishes whose ingredients are on a condition's avoid list or conflict with a client medication, and boosts ones that are beneficial. These read the flags you set on ingredients and foods.
  • Structure & macros — required components per slot, per‑slot and daily calorie caps, and a macro tolerance band for the day.
  • Combinations — sensible plating rules (no rice and roti the same day, one grain per meal, an oil cap, no non‑veg at breakfast).
  • Frequency & variety — caps on how often non‑veg or eggs recur across the week and a nudge away from recently‑used dishes.
  • Preferences — honours the client's likes, dislikes, and preferred proteins.

Verified foods only

A newer rule, on by default, restricts the plan to verified dishes — meal items a library editor has reviewed for accuracy (see Food library › Verifying). If you trust only reviewed content in client plans, leave it on. If the verified pool is too small to build a plan, the engine stops and tells you rather than silently using unreviewed dishes — turn the rule off in the Rules panel if you want to draw from everything.

How targets are calculated

The daily targets the plan is built against come from the client's profile:

  • Protein scales with the client's ideal body weight and their goal (muscle gain needs more than maintenance).
  • Fat is set at ~20% of the calorie target.
  • Carbs make up the remainder of the calories.

Calories themselves come from the client's BMR/TDEE and activity level, set during client onboarding. Change the goal, weight, or activity and the targets recompute — in client mode you can also edit them directly from the Macros panel, or just tell the chat ("set 1,500 kcal").

Common workflows

"Generate and assign a week for a diabetic client"

  1. Confirm the client's Medical tab lists Diabetes and any allergies.
  2. Meal Plan tab → New meal planGenerate a fresh plan.
  3. Review the grid. Anything red is a hard conflict — click the violation to find it, then ask the chat to swap it.
  4. Happy? Assign…, set the start date and duration. The client sees it in their portal.

"This template doesn't fit a new client"

  1. Assign the template, then open the session — the review bar flags what doesn't fit.
  2. Fix… → Conservative → Preview changes. If conflicts remain, re‑run at Standard or Thorough.
  3. Apply, then Assign.

What's next

  • Food library — verify foods and tag ingredient conditions/medications so the rules above have data to work with.
  • Meal plans — the manual builder and template library.