Zing Forum

Reading

AI Nutrition Assistant: A Personalized Nutrition Consultation System Based on Knowledge Graph and Generative AI

This project builds an intelligent nutrition consultation system combining knowledge graph and generative AI, which constructs a structured graph by automatically extracting knowledge from medical texts to provide safe and verifiable nutrition advice for chronic diseases.

知识图谱生成式AI营养咨询慢性病管理GraphRAG医疗AINeo4jLlama信息抽取越南语NLP
Published 2026-05-25 10:43Recent activity 2026-05-25 10:53Estimated read 6 min
AI Nutrition Assistant: A Personalized Nutrition Consultation System Based on Knowledge Graph and Generative AI
1

Section 01

AI Nutrition Assistant Project Overview

This project is a personalized nutrition consultation system combining knowledge graph and generative AI. It addresses the dietary management needs of chronic disease patients and provides safe, verifiable nutrition advice via the GraphRAG architecture. Core technologies include knowledge graph construction (EDC framework), multi-modal input (text + image recognition), and zero-hallucination design. Developed by Vietnamese student Lê Quang Huy, it was released on GitHub in May 2026.

2

Section 02

Project Background and Core Issues

This project was developed by Vietnamese student Lê Quang Huy (student ID: 223571) as a course design for the second semester of the 2025-2026 academic year. Core research question: How to automatically extract knowledge from unstructured medical texts to build a structured graph, and combine GraphRAG to provide safe and verifiable nutrition advice for chronic disease patients?

3

Section 03

Technical Architecture and Knowledge Graph Construction

Technology Stack: Frontend React18 + Vite, Backend FastAPI + Python3.11, Database Neo4j5.16, Gateway Nginx1.29, LLM Service Groq API (Llama3.3 70B/4 Scout17B), Embedding Model Jina AI Embeddings v3. Knowledge Graph Construction (EDC Framework):

  1. Preprocessing: LLM standardizes format → cleaning and sentence splitting → chunking → coreference resolution;
  2. EDC three stages: Extract (open information extraction) → Define (relationship semantic definition) → Canonicalize (schema normalization);
  3. Cleaning and deduplication: rule-based filtering + semantic deduplication; The final graph contains 4 types of nodes (Food/Disease/Nutrient/Other), 12 relationship types, about 800 nodes, and over 1200 triples.
4

Section 04

GraphRAG Query Flow and Core Functions

Query Flow: User input (text/image) → image recognition (if any) → Neo4j precise search → semantic mapping (dialect to standard name) → circuit breaker mechanism (intercept if no data) → LLM generates advice → output verified advice + micronutrient chart. Core Functions:

  • Nutrition query: Input food to get 16 micronutrient indicators + advice;
  • Image recognition: Llama4 Scout recognizes food (86% accuracy);
  • GraphRAG: Based on real data, no fabrication;
  • Circuit breaker mechanism: Intercept non-existent foods to avoid hallucinations;
  • Vietnamese support: Understand slang and dialects.
5

Section 05

Supported Diseases and Deployment Access

Supported Diseases: Diabetes (blood sugar management), Hypertension (sodium restriction), Kidney disease (protein control), Obesity (calorie control). Deployment Links:

6

Section 06

Innovation Points and Project Significance

Innovation Points:

  1. Zero-hallucination design: Circuit breaker mechanism intercepts foods with no data to avoid false advice;
  2. Dialect understanding: Semantic mapping layer handles Vietnamese slang (e.g., "trái thơm" → "dứa");
  3. Verifiable sources: Advice can be traced back to original medical literature;
  4. Multi-modal input: Supports text + image recognition. Project Significance: Helps chronic disease patients make informed food choices and avoid dietary mistakes; Provides a GraphRAG architecture reference for medical AI; The pipeline design can be extended to more diseases, data, and languages.
7

Section 07

Limitations and Improvement Directions

Current Limitations: Knowledge coverage (800 nodes need expansion), disease scope (only 4 types), regional limitation (based on Vietnamese literature). Future Improvements: Expand the knowledge graph to more authoritative databases; Add multi-language support; Combine user health data to enhance personalization; Develop native mobile applications.