NomAI tackles a challenging problem in AI-powered nutrition tracking: how to ensure that the insights generated by large language models (LLMs) are grounded in reliable, up-to-date information rather than hallucinations. It does this by orchestrating a multi-step pipeline that integrates image recognition, web search, and LLM synthesis into a seamless user experience across mobile platforms.
What NomAI does and how it is built
At its core, NomAI is a cross-platform mobile application built with Flutter and Dart, paired with a FastAPI backend that handles AI inference and data orchestration. The mobile client targets iOS, Android, and Web, following a modular, feature-based architecture with BLoC (Business Logic Component) state management to keep UI and logic cleanly separated.
The backend serves as an AI gateway, exposing REST APIs through FastAPI routers that cover nutrition analysis, chat interactions, agent coordination, and diet plan generation. This separation keeps the AI-heavy logic off-device, enabling richer processing without overburdening mobile resources.
Under the hood, NomAI implements a sophisticated multi-step pipeline for nutrition analysis. It employs a ReAct agent architecture based on LangChain to coordinate multiple specialized tools:
- Food image recognition using Google Gemini Vision
- Text-based food description parsing
- Web-grounded nutritional research using either Exa or DuckDuckGo search providers
This pipeline is designed to produce hallucination-free nutritional data by grounding LLM responses in real-time web search results from trusted sources such as the USDA and FDA.
NomAI supports dual LLM providers: Google Gemini and OpenRouter/Claude, allowing flexibility depending on user preference or API availability. User data and meal tracking information are persisted in Firebase Firestore, enabling real-time sync and secure storage.
The app also includes personalized diet plan generation, implementing carb cycling logic and tracking macro-nutrient variety over weekly periods. This feature highlights NomAI’s focus on delivering actionable, user-specific guidance rather than generic nutrition advice.
What makes NomAI’s AI pipeline distinctive
The standout technical feature is the 3-step nutrition analysis pipeline that chains food extraction, web search, and LLM synthesis. This design addresses a common problem with LLMs: hallucination or confident but incorrect outputs. By grounding the AI responses in live web data from authoritative sources, NomAI improves trustworthiness and accuracy.
The ReAct agent architecture in LangChain orchestrates the process, deciding when to invoke image recognition, parse textual inputs, or query the web. This approach separates concerns cleanly and enables the system to adapt to different input types effectively.
The tradeoff is complexity: coordinating multiple LLM calls, search queries, and tool invocations adds latency and requires careful error handling. It also depends heavily on external APIs and search providers, which can introduce variability in performance and availability.
From a code quality perspective, the backend is organized around FastAPI routers that map well to functional domains, improving maintainability. The Flutter client adopts industry-standard BLoC patterns, supporting modularity and testability.
One limitation is the dependency on Firebase Firestore for data persistence, which ties the app to a specific cloud provider and may pose challenges for those seeking a fully self-hosted or privacy-centric solution.
Quick start
The README provides a clear setup path focusing on backend deployment and Firebase configuration:
## ๐ Setup & Deployment
### 1. Backend Configuration
The backend acts as the AI Gateway for the app.
- **Source**: https://github.com/Pavel401/NomAI
- **Deployment**: We recommend **Railway** or **GCP Cloud Run**.
- **Environment Variables**:
- `PROVIDER_TYPE`: `gemini` or `openrouter`.
- `GOOGLE_API_KEY`: For Gemini Vision analysis.
- `SEARCH_PROVIDER`: `exa` or `duckduckgo` for web grounding.
- `FIRESTORE_DATABASE_ID`: Set to `mealai`.
### 2. Firebase Core Services
NomAI relies on Firebase for real-time sync and security.
- **Authentication**: Enable Email and Google providers.
- **Firestore**: Initialize in production mode.
- **Remote Config**: Add the `base_url` key pointing to your deployed backend.
### 3. Client Execution (FVM)
NomAI works on **iOS, Android, and Web**.
This setup reflects a typical modern mobile + cloud AI stack, with clear guidance on environment variables and cloud services.
verdict
NomAI is relevant for developers interested in building cross-platform AI-powered nutrition or health tracking applications with a focus on grounded, reliable LLM outputs. Its combination of Flutter for UI, FastAPI for backend orchestration, and a multi-step ReAct agent pipeline demonstrates a practical architecture for integrating vision, text, and web search AI tools.
The tradeoff is the system’s complexity and external API dependencies, which can complicate deployment and affect latency. Also, reliance on Firebase Firestore may not suit all privacy requirements.
Still, the code is well-structured, and the project provides a solid reference for anyone tackling AI hallucination issues in nutrition or other domains requiring factual grounding. It’s worth exploring if you want a real-world example of chaining LLMs with live web data and multi-modal inputs in a mobile app environment.
Related Articles
- mhabit: a cross-platform Flutter micro habit tracker with self-hosted WebDAV sync โ mhabit is a Flutter/Dart app for micro habit tracking across 5 platforms, featuring WebDAV sync, Material3 dynamic themi
- Memex: a local-first AI-native knowledge management app with custom multi-agent orchestration โ Memex is a Flutter-based local-first personal knowledge app using multi-agent AI to organize and extract insights. It su
- Jan: a local-first desktop app for large language models with Tauri and Rust โ Jan is an open-source desktop app that runs large language models locally using Tauri, Node.js, and Rust. It offers priv
- Blackbox Node: offline AI assistant over LoRa mesh with local llama.cpp and ecash payments โ Blackbox Node runs a local llama.cpp LLM over a Meshtastic LoRa mesh, enabling offline AI queries and ecash payments via
- Navigating free-tier LLM APIs with the awesome-free-llm-apis catalog โ A curated catalog of free-tier LLM APIs compatible with OpenAI SDK, detailing rate limits, model specs, and providers to
โ GitHub Repo: Pavel401/NomAI-App โญ 103 ยท Dart