NomAI is a powerful AI Agent that brings nutrition and food intelligence to life. Whether you're analyzing meals through images, chatting with an AI nutrition assistant, or generating personalized weekly diet plans β NomAI handles the heavy lifting with a sophisticated multi-step LLM pipeline backed by real-time web research.
| Feature | Description |
|---|---|
| π§ AI Nutrition Analysis | Analyze food from images or text descriptions with a 3-step pipeline: food extraction β web search β LLM synthesis |
| π¬ Conversational AI Chatbot | LangChain-powered agent that understands dietary preferences, allergies, and health goals |
| π½οΈ Weekly Diet Planner | Generate 7-day personalized meal plans with carb cycling, variety tracking, and macro targets |
| π Meal Alternatives | Get 5 AI-suggested alternative meals respecting your dietary profile |
| π Nutrition Tracking | Mark meals as eaten, update plans on the fly, and track diet history |
| π Dual LLM Support | Seamlessly switch between Google Gemini and OpenRouter (Claude) providers |
| π Web-Grounded Analysis | Nutrition data enriched with web search results from Exa or DuckDuckGo |
| π’οΈ Firestore Persistence | Chat history and diet plans stored in Google Firestore |
Get your AI gateway running in seconds:
Backend Repository: https://github.com/Pavel401/NomAI
Below is a gallery of the current screenshots in static/screenshots/.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
NomAI is architected as a high-performance distributed system, separating the cross-platform Flutter client from a sophisticated AI orchestration backend.
The following diagram illustrates the flow from the client through the FastAPI gateway to the AI engines and persistence layers.
graph TD
Client["π± Client (Mobile / Web)"]
Main["main.py β FastAPI App"]
Client --> Main
Main --> NutritionRouter["/api/v1/nutrition"]
Main --> ChatRouter["/api/v1/users"]
Main --> AgentRouter["/api/v1/chat"]
Main --> DietRouter["/api/v1/diet"]
NutritionRouter --> NutritionServiceV2
AgentRouter --> LangChainAgent["π€ LangChain Agent"]
LangChainAgent --> AgentTools["Tools: analyse_image\nanalyse_food_description"]
AgentTools --> NutritionServiceV2
ChatRouter --> ChatFirestore
DietRouter --> DietService
NutritionServiceV2 --> FoodExtractor["FoodExtractorService"]
NutritionServiceV2 --> SearchService
NutritionServiceV2 --> LLMProvider["LLM Provider\n(Gemini / OpenRouter)"]
DietService --> LLMProvider
DietService --> DietFirestoreDB["DietFirestore"]
FoodExtractor --> LLMProvider
SearchService --> ExaAPI["π Exa / DuckDuckGo"]
ChatFirestore --> Firestore["π₯ Firestore DB"]
DietFirestoreDB --> Firestore
The backend operates as a Reasoning + Acting (ReAct) agent. It doesn't just respond; it evaluates user intent, selects specialized tools, and iterates to find the most accurate facts.
graph TD
User["π€ User Input\n(Chat/Image)"] --> Context["π Context Builder\n(Preferences + Allergies + Goals)"]
Context --> Brain["π§ LLM Controller\n(ReAct State Graph)"]
Brain --> Decision{"Is this food-related?"}
Decision -- "No / Simple Q&A" --> Direct["Direct Friendly Answer"]
Decision -- "Yes / Needs Analysis" --> ToolSelection["π οΈ Tool Selection"]
ToolSelection -- "Image Provided" --> ToolA["πΈ analyse_image"]
ToolSelection -- "Text Description" --> ToolB["π analyse_food_description"]
ToolA --> Pipe["π§ͺ Nutrition Pipeline"]
ToolB --> Pipe
Pipe --> Observation["π Tool Observation\n(Structured Data)"]
Observation --> Brain
Brain --> Final["π Final Personalized Response"]
To ensure "hallucination-free" data, NomAI uses a web-grounded pipeline:
- Identification: Detection of food items & generation of enriched search queries.
- Web Grounding: Targeted searches (Exa/DuckDuckGo) for authoritative USDA/FDA or brand data.
- Multimodal Synthesis: Synthesis of Actual Image + Web Facts + User Prompt into structured nutritional data.
The system applies metabolic variety patterns rather than static targets.
graph TD
Input["π₯ DietInput Payload"] --> Calc["βοΈ Target Calculator"]
Calc --> Patterns["π Carb Cycling Logic\n(Cyclical Macro Variation)"]
Patterns --> Loop["π 7-Day Generation Loop"]
Loop --> DayPrompt["π Prompt + Used Foods Tracking"]
DayPrompt --> LLMCall["π€ LLM Provider"]
LLMCall --> Variety["π₯ Update Diversity Score"]
Variety -- "Next Day" --> Loop
Variety -- "End" --> Aggregator["π Weekly Aggregator"]
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:geminioropenrouter.GOOGLE_API_KEY: For Gemini Vision analysis.SEARCH_PROVIDER:exaorduckduckgofor web grounding.FIRESTORE_DATABASE_ID: Set tomealai.
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_urlkey pointing to your deployed backend.
NomAI works on iOS, Android, and Web.
# 1. SDK Isolation
fvm use 3.35.0
# 2. Platform Configs
# - Android: google-services.json
# - iOS: GoogleService-Info.plist
# - Web: firebase-config script
# 3. Compile & Run
fvm flutter pub get
fvm flutter run # Mobile
fvm flutter run -d chrome # Webfvm flutter build apk --release # Android
fvm flutter build ios --release # iOS
fvm flutter build web --release # Weblib/
βββ app/
β βββ components/ # Reusable UI components (Buttons, Modals, Inputs)
β βββ constants/ # Application theme, colors, and API endpoints
β βββ models/ # Base data models and JSON serialization
β βββ modules/ # Feature-centric modular architecture
β β βββ Analytics/ # Data visualization and dietary metrics
β β βββ Auth/ # Firebase Authentication flows
β β βββ Chat/ # Conversational AI Assistant
β β βββ DashBoard/ # Core metrics and daily logging summary
β β βββ Diet/ # Weekly plan generation and alternates
β β βββ Onboarding/ # User profiling and goal setting
β β βββ Scanner/ # Real-time food recognition using Vision AI
β βββ providers/ # Infrastructure services (RemoteConfig, BLoC)
β βββ repo/ # Data layer: Firebase SDKs and FastAPI integrations
β βββ services/ # State monitoring and global domain logic
β βββ utility/ # Helper utilities (Registry, Haptics, Formatting)
βββ firebase_options.dart # Platform-specific Firebase settings
βββ main.dart # App entry point
assets/
βββ lottie/ # High-performance micro-animations
βββ png/ # Branding assets
βββ svg/ # Resolution-independent iconography























