A minimal end-to-end proof-of-concept pipeline using multi-agents concept:
- Planning Agent: Generates meal outlines based on user constraints.
- Chef Agent: Produces detailed recipe steps from the meal outline.
- Nutrition Agent: Computes nutritional breakdown of the generated recipe.
This document covers high-level architecture, data flows, and implementation steps.
Goals
- Validate multi-agent orchestration in LangChain.
- Produce a working pipeline: Planner → Chef → Nutrition.
- Enable iterative development and prompt tuning.
Constraints
-
User-selected cuisine (e.g., Italian, Indian, Mexican).
-
Maximum prep time (e.g., ≤30 minutes).
*Additional dietary restrictions and preferences (vegetarian, dairy-free, likes/dislikes) will be integrated in future iterations.
+---------+ +---------+ +-------------+
| User | →─▶ | Planner | →─▶ | Chef |
| Input | | Agent | | Agent |
+---------+ +---------+ +-------------+
|
↓
+-------------+
| Nutrition |
| Agent |
+-------------+
|
↓
+-------------+
| Output: |
| Recipe + |
| Nutrition |
+-------------+
Agents communicate via JSON payloads validated by Pydantic models.
- Function: Interpret user constraints and propose a single meal outline.
- Prompt Structure: Few-shot examples plus JSON schema.
- Output Model:
from pydantic import BaseModel
from typing import List
class Ingredient(BaseModel):
item: str
qty: str # e.g. "100g"
class Plan(BaseModel):
meal: str
ingredients: List[Ingredient]-
Function: Expand meal name + ingredients into cooking steps.
-
Prompt Structure: Input JSON
Plan, request recipe fields. -
Output: Structured JSON or Markdown containing:
- Title
- Prep & cook times
- Steps (numbered list)
- Serving size
-
Function: Lookup macro & micro data per ingredient.
-
Implementation Steps:
- Parse
qtyinto grams or common units. - Query USDA FoodData Central API (or Edamam).
- Aggregate calories, carbs, protein, fat, and key micros.
- Return JSON:
- Parse
{
"calories": 450,
"macros": {"carbs": 60, "protein": 20, "fat": 10},
"micros": {"iron_mg": 4.5, "vitamin_c_mg": 20}
}