Building an AI Nutritionist Agent with Google Gemini and LangGraph

3 minutes

read

In an era where Generative AI is transforming every field—from healthcare to education—I wanted to explore its applications in personalized nutrition science. This capstone project combines Google Gemini, LangChain, and LangGraph to create a smart nutritionist agent that can:

  • Identify biomolecules in any fruit or vegetable
  • Estimate calorie content per 100g
  • Respond dynamically to different food queries

All of this was built entirely inside Kaggle using Google’s cutting-edge Gemini API.

Technologies Used

Tool / LibraryPurpose
Google Gemini ProCore LLM for nutrition analysis
LangChain + LangGraphAgent framework to modularize logic
Kaggle NotebooksExecution environment
Kaggle SecretsAPI key management

What Does the AI Agent Do?

The AI agent asks the user for a fruit or vegetable name (like “spinach” or “mango”), and then:

  1. Sends a prompt to Gemini Pro asking for:
    • Key biomolecules (carbs, proteins, fiber, etc.)
    • Estimated calories per 100g
  2. Receives structured, clean, and readable nutritional data
  3. Displays the results like a virtual dietitian.

Sample Output

Input: mango
Gemini Output:

  • Carbohydrates: ~15g
  • Fiber: ~1.6g
  • Protein: ~0.8g
  • Fats: ~0.4g
  • Vitamins: A, C, E
  • Calories: ~60 kcal per 100g

Gen AI Capabilities Demonstrated

  • Agents using LangGraph
  • Few-shot prompting to control output
  • Structured generation with bullet-point responses
  • Long-context LLM (Gemini 1.5 Pro)
  • Google Cloud (via Vertex AI + Generative AI API)

Real-World Use Cases

This type of AI agent can power:

  • Personalized diet apps
  • Voice nutrition assistants
  • Smart grocery shopping tools
  • Health-focused education

View the Project

👉 Explore the full code and logic on Kaggle

https://www.kaggle.com/code/garima0186/googlecapstoneproject-garima0186

Disclaimer: All information provided on www.academicbrainsolutions.com is for general educational purposes only. While we strive to provide accurate and up-to-date information, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability of the information contained on the blog/website for any purpose. Any reliance you place on such information is therefore strictly at your own risk. The information provided on www.academicbrainsolutions.com is not intended to be a substitute for professional educational advice, diagnosis, or treatment. Always seek the advice of your qualified educational institution, teacher, or other qualified professional with any questions you may have regarding a particular subject or educational matter. In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this blog/website. Our blog/website may contain links to external websites that are not provided or maintained by us. We do not guarantee the accuracy, relevance, timeliness, or completeness of any information on these external websites. Comments are welcome and encouraged on www.academicbrainsolutions.com is but please note that we reserve the right to edit or delete any comments submitted to this blog/website without notice due to: Comments deemed to be spam or questionable spam, Comments including profanity, Comments containing language or concepts that could be deemed offensive, Comments that attack a person individually.By using www.academicbrainsolutions.com you hereby consent to our disclaimer and agree to its terms. This disclaimer is subject to change at any time without prior notice

Leave a comment