Prerequisites: Completed the Deploy Your First Agent tutorial
What You’ll Build
In this tutorial, you’ll create a recipe creator agent that:- Generates personalized recipes from available ingredients
- Considers dietary restrictions and preferences
- Respects time constraints for meal preparation
- Provides detailed cooking instructions
- Supports both sync and streaming responses
The Recipe Creation Challenge
Creating recipes that match available ingredients is challenging:- Ingredient matching: Finding recipes that use what you have
- Dietary restrictions: Accommodating allergies and preferences
- Time constraints: Creating recipes that fit your schedule
- Personalization: Adapting recipes to individual tastes
- Instructions: Providing clear, step-by-step guidance
Architecture Overview
The recipe creator agent uses a simple but powerful architecture:Step 1: Understanding the Agent Structure
The recipe creator agent provides two entrypoints: Entrypoints:recipe_create: Synchronous recipe generationrecipe_stream: Streaming recipe generation for real-time display
- Ingredient-based recipe generation
- Dietary restriction handling
- Time limit consideration
- Detailed cooking instructions
- Nutritional information (optional)
Step 2: Agent Configuration
The agent is configured usingrunagent.config.json:
Step 3: Core Agent Logic (Gist)
The agent generates recipes based on multiple inputs:Step 4: Backend Integration
The Flask backend provides REST API endpoints:Step 5: Frontend Integration
The React frontend provides a user-friendly interface: Key Features:- Ingredient input (text or list)
- Dietary restrictions selector
- Time limit input
- Recipe display with formatting
- Streaming recipe generation
- Example recipe suggestions
- Recipe history (optional)
Step 6: Deployment
Local Deployment
Production Deployment
The agent can be deployed to RunAgent Cloud:What You’ve Accomplished
You’ve built a complete recipe creation system:🍳 Recipe Generation
Creates personalized recipes from available ingredients
⚡ Real-Time Streaming
Streams recipe generation for better user experience
🥗 Dietary Support
Handles dietary restrictions and preferences
⏱️ Time-Aware
Considers time constraints for meal preparation
Key Features
Ingredient-Based Generation
- Analyzes available ingredients
- Suggests complementary ingredients
- Creates recipes that maximize ingredient usage
- Provides ingredient substitutions when needed
Dietary Restriction Handling
- Supports vegetarian, vegan, gluten-free, etc.
- Accommodates allergies and intolerances
- Suggests alternative ingredients
- Maintains recipe quality with restrictions
Time-Aware Recipes
- Respects time constraints
- Suggests quick recipes for busy schedules
- Provides prep and cook time estimates
- Offers time-saving tips
Streaming Support
- Real-time recipe generation
- Progressive display of information
- Better user experience
- Immediate feedback
Example Usage
Example Recipes
The agent can generate various types of recipes: Quick Meals:- 15-minute pasta dishes
- One-pan meals
- Quick stir-fries
- Vegan alternatives
- Gluten-free options
- Low-carb meals
- Recipes using specific ingredients
- Leftover transformations
- Seasonal ingredient recipes
Next Steps
Add Features
Add features like nutritional info and meal planning
Enhance AI
Improve recipe quality with better prompts
Production Deployment
Deploy to production with proper scaling
View Full Example
Explore the complete example code
Repository
View the complete example code and documentation: Repository: https://github.com/runagent-dev/runagent/tree/main/examples/recipe_creator The repository includes:- Complete agent implementation
- Flask backend API with streaming support
- React frontend application
- Example recipe queries
- Configuration files
🎉 Great job! You’ve learned how to build a practical recipe creation system using RunAgent. This demonstrates how AI agents can solve everyday problems with personalized solutions!
Still have a question?
- Join our Discord Community
- Email us: [email protected]
- Follow us on X
- New here? Sign up