archie0732/healthy-diet-ai-agent

Healthy Diet AI Agent is a Bun + TypeScript backend for nutrition chat, food-image analysis, RAG document ingestion, and knowledge-grounded diet guidance.

What it solves

This project provides a specialized AI backend for nutrition and healthy diet support. It addresses the challenge of providing accurate dietary advice by combining conversational AI with structured knowledge retrieval, food image analysis, and synchronization with official health data (such as from the Ministry of Health and Welfare).

How it works

Built with Bun and TypeScript, the system operates as an AI agent using LangChain and LangGraph. It employs several key mechanisms to ensure accuracy:

  • RAG (Retrieval-Augmented Generation): It searches through ingested nutrition documents and guidelines to provide grounded answers.
  • Version-Aware RAG: A specialized engine designed to resolve conflicts between different versions of dietary guidelines over time.
  • Knowledge Graph: It extracts and searches structured relations between health and diet concepts.
  • Multimodal Analysis: It processes food images to understand meals and provide nutrition-guided interactions.
  • Data Synchronization: A pipeline automatically imports public health clarifications and reference content from the MOHW.

Who it’s for

  • Users seeking personalized dietary advice and meal planning.
  • Developers looking for a deployable AI agent framework for health and nutrition.
  • Nutritionists or health administrators who need a tool to manage and query structured dietary knowledge bases.

Highlights

  • Flexible Deployment: Supports both a standalone mode (using SQLite) and an integration mode (using Supabase).
  • Policy-Aware RAG: Includes a framework for parameterizable retrieval rules to handle evolving health policies.
  • PDF Processing: Features a tool to convert official guideline PDFs into structured Markdown while preserving table data.
  • Dual Interface: Provides both a REST HTTP API and a terminal CLI for interacting with the agent.
  • Knowledge Management: Includes tools for document ingestion, re-indexing, and knowledge graph extraction.

Related

  • Project
  • Project
  • Project
  • Project
  • Project