Meal Prep Agent
A multi-agent AI system that creates 7-day meal plans with shopping lists based on dietary preferences and favorite food blogs.
Try It Live
Enter your preferences below and watch four AI agents collaborate in real-time. The entire process takes about 2-3 minutes.
Architecture
This project uses a multi-agent workflow where specialized AI roles work in sequence. Each agent has a focused responsibility and passes context to the next.
Why four agents instead of one?
Each agent has a narrow focus, which produces better results than one agent trying to do everything. The Recipe Research agent only thinks about finding recipes. The Meal Planning agent only thinks about nutritional balance and variety. Specialization leads to quality.
Implementation Details
Streaming with Server-Sent Events
The UI shows progress in real-time as each agent works. This is critical for a 2-3 minute process—users need feedback that something is happening.
// Server streams agent updates
const encoder = new TextEncoder();
const stream = new ReadableStream({
async start(controller) {
for await (const update of agentWorkflow()) {
controller.enqueue(encoder.encode(
`data: ${JSON.stringify(update)}\n\n`
));
}
controller.close();
}
});
Agent Prompting Strategy
Each agent receives:
- Clear role definition
- Structured output format
- Context from previous agents
- Constraints (budget, dietary restrictions)
The Shopping List agent gets the most detailed prompt—it needs to understand ingredient quantities, avoid duplicates, and organize by store section (produce, dairy, proteins, pantry).
Lessons Learned
Sequential beats parallel for this use case. I initially tried running agents in parallel, but the dependency chain made this impractical. Each agent genuinely needs the previous agent's output.
Prompt engineering is the difference. The same GPT-4o-mini model produces wildly different results based on prompt structure. Adding specific examples of good output improved quality significantly.
Streaming UX matters. The first version waited 3 minutes then dumped all output. Users abandoned before completion. Showing real-time progress kept engagement high.
Outcomes
- •Built multi-agent workflow with 4 specialized AI roles
- •Integrated GPT-4o-mini via Vercel AI SDK with streaming
- •Created organized shopping lists by store section
- •Full i18n support (6 languages)