{"slug": "a-meal-planner-grocery-shopping-agent-in-typescript-with-hazeljs", "title": "A Meal Planner & Grocery Shopping Agent in Typescript with HazelJS", "summary": "A developer built a meal planning and grocery shopping agent using HazelJS, a TypeScript framework for AI-native applications. The agent uses multi-agent orchestration, retrieval-augmented generation (RAG) for recipe search, and supervisor routing to handle dietary intake, meal planning, and shopping list generation. The project demonstrates production-ready patterns including retries, circuit breakers, and observability via the HazelJS Inspector.", "body_md": "In this post, we'll build a practical AI-powered meal planning agent using HazelJS. This agent helps users create personalized meal plans, discover recipes, and generate shopping lists—all while demonstrating HazelJS's powerful agent orchestration, RAG capabilities, and production-ready patterns.\n\n##\nWhat We're Building\n\nOur meal planning agent handles the complete meal planning workflow:\n\n-\n**Dietary Intake**: Extracts dietary restrictions, budget, cooking time, and preferences\n-\n**Recipe Search**: Finds recipes using RAG over a recipe database\n-\n**Meal Planning**: Creates day-by-day meal plans with balanced nutrition\n-\n**Shopping Lists**: Generates organized grocery lists with cost estimates\n-\n**Nutrition Coaching**: Orchestrates the entire workflow via supervisor routing\n\n##\nWhy HazelJS?\n\nHazelJS provides a production-ready framework for building AI-native applications. For this project, we leverage:\n\n-\n**Multi-agent orchestration** with `@Agent`\n\n, `@Tool`\n\n, and `@Delegate`\n\ndecorators\n-\n**RAG (Retrieval-Augmented Generation)** for semantic recipe search\n-\n**Supervisor routing** to delegate tasks to specialized agents\n-\n**Production resilience** with retries, circuit breakers, and rate limiting\n-\n**Built-in observability** via the HazelJS Inspector\n-\n**Guardrails** for safer AI recommendations\n\n##\nProject Architecture\n\n##\nAgent Implementation\n\n###\nDietary Intake Agent\n\nThe [DietaryIntakeAgent] extracts structured information from natural language:\n\n###\nRecipe Search Agent with RAG\n\nThe [RecipeSearchAgent] uses RAG to find recipes semantically:\n\n###\nNutrition Coach with Supervisor\n\nThe [NutritionCoachAgent] orchestrates the workflow using delegation:\n\n##\nRAG Implementation\n\nWe use `MemoryVectorStore`\n\nand `RAGPipeline`\n\nfor semantic recipe search:\n\n##\nProduction Configuration\n\nThe `AgentModule`\n\nis configured with production-ready features:\n\n##\nRunning the Project\n\n##\nTesting the API\n\n##\nHazelJS Inspector\n\nAccess the built-in inspector at `http://localhost:3000/__hazel`\n\nfor:\n\n- Real-time agent execution traces\n- Tool call logs\n- Performance metrics\n- Circuit breaker status\n- Rate limiter status\n\n##\nKey Takeaways\n\n-\n**Multi-agent architecture**: Each agent has a focused responsibility, making the system maintainable and testable\n-\n**RAG for knowledge retrieval**: Semantic search over recipe database provides accurate, context-aware results\n-\n**Supervisor routing**: The orchestrator agent delegates tasks to specialists, enabling complex workflows\n-\n**Production resilience**: Built-in retries, circuit breakers, and rate limiting ensure reliability\n-\n**Observability**: The inspector provides deep insights into agent behavior and performance\n-\n**Guardrails**: PII redaction and content safety protect users from inappropriate recommendations\n\n##\nWhat's Next?\n\nFor a production deployment, you would:\n\n- Replace the local LLM provider with OpenAI, Anthropic, or Google Generative AI\n- Add persistent storage with @hazeljs/memory for user preferences and meal history\n- Implement @hazeljs/flow for advanced workflow orchestration\n- Add @hazeljs/pubsub for async meal planning notifications\n- Connect to real recipe APIs for dynamic content\n\n##\nConclusion\n\nThis meal planning agent demonstrates how [HazelJS](https://hazeljs.ai/) enables building sophisticated AI applications with production-ready patterns. The combination of multi-agent orchestration, RAG, and resilience features makes it easy to create reliable, observable, and scalable AI-native applications.\n\nComplete project is available here: [Meal Planning Agent](https://github.com/nisafatimaa/meal-planning-agent)\n\nSee you next time!", "url": "https://wpnews.pro/news/a-meal-planner-grocery-shopping-agent-in-typescript-with-hazeljs", "canonical_source": "https://dev.to/nisa_fatima_bcd75fa085b76/a-meal-planner-grocery-shopping-agent-in-typescript-with-hazeljs-43b1", "published_at": "2026-06-13 16:33:41+00:00", "updated_at": "2026-06-13 16:44:31.911138+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "developer-tools", "natural-language-processing", "generative-ai"], "entities": ["HazelJS", "HazelJS Inspector", "DietaryIntakeAgent", "RecipeSearchAgent", "NutritionCoachAgent", "MemoryVectorStore", "RAGPipeline", "AgentModule"], "alternates": {"html": "https://wpnews.pro/news/a-meal-planner-grocery-shopping-agent-in-typescript-with-hazeljs", "markdown": "https://wpnews.pro/news/a-meal-planner-grocery-shopping-agent-in-typescript-with-hazeljs.md", "text": "https://wpnews.pro/news/a-meal-planner-grocery-shopping-agent-in-typescript-with-hazeljs.txt", "jsonld": "https://wpnews.pro/news/a-meal-planner-grocery-shopping-agent-in-typescript-with-hazeljs.jsonld"}}