Inspiration
The idea came from a simple frustration: finding recipes that actually match what you need is harder than it should be. Want something high-protein, under 500 calories, that you can make in 20 minutes with the chicken in your fridge? Not as easy as it sounds. Generally you need to browse multiple categories, scroll through endless results, and manually check nutrition labels. For people managing health conditions, following specific diets, or just trying to eat better with limited time, this friction adds up. The goal was to build an AI agent that understands natural food queries and returns precise, actionable results—not a chatbot, but a nutrition-aware search system that actually works.
What It Does
NutriQ is an AI agent system built on Elasticsearch Agent Builder that transforms natural language food queries into structured recipe searches. Users speak naturally—"quick vegan dinner under 400 calories"—and NutriQ parses the intent, identifies constraints and returns matching recipes from a database of recipes with full nutritional data.
The system includes five specialized ES|QL tools: nutrition filtering (calories, protein, carbs, time), dietary tag filtering (vegan, keto, gluten-free), technique search (grilling, braising, sautéing), popularity ranking (most-rated recipes), and meal plan candidates (30 options for weekly planning). The agent selects which tool(s) to use based on query intent.
NutriPlan, the companion web app, showcases these capabilities in a complete meal planning workflow—weekly calendar, shopping lists, pantry management, and nutrition tracking.
How It Was Built
NutriQ was built on Elasticsearch and Kibana Agent Builder following a data-first approach. The recipe dataset (231,637 recipes) was processed through a Python pipeline that expanded nutrition arrays into named fields and created full-text ingredient matching. Three Elasticsearch indices store recipes, user interactions, and aggregated popularity metrics.
Five ES|QL tools were built with typed parameters—each a JSON configuration with a query template. The agent's LLM reads tool descriptions and selects the appropriate tool based on user queries. NutriPlan connects via the Kibana Agent Builder API, with PostgreSQL handling user data and localStorage as a guest fallback.
Challenges
Multi-constraint queries ("popular vegan high-protein quick dinner") required tools with overlapping parameters and clear descriptions so the agent could combine them intelligently. Missing popularity data was solved by building an ingestion pipeline aggregating user ratings into a queryable index.
Key Learnings
ES|QL parameterized queries eliminate prompt engineering complexity for numeric constraints. Multi-index architecture enables specialized tools for different query types. Tool descriptions matter as much as the queries—clear descriptions help the agent select correctly. Building NutriPlan revealed integration edge cases that pure agent testing missed.
The Agent System
NutriQ is a single AI agent with five specialized tools:
| Tool | Purpose |
|---|---|
filter_by_nutrition |
Calorie, protein, carb, time filtering |
filter_by_dietary_tags |
Vegan, gluten-free, keto, paleo |
search_by_technique |
Find recipes by cooking method |
rank_by_popularity |
Surface proven, highly-rated recipes |
meal_plan_candidates |
Generate 30 options for weekly planning |
Who It Helps
Health-focused individuals managing calories or conditions like diabetes. Dietary restriction followers needing compliant recipes. Busy professionals finding quick meals. Meal preppers planning weekly batches. Home cooks learning techniques. Caregivers preparing meals for others with special needs.
Dataset Source: Food.com Recipes (Kaggle)
Built With
- elasticsearch-agent-builder
- es|ql
- kibana
- node.js
- postgresql
Log in or sign up for Devpost to join the conversation.