A conversational AI nutrition assistant specializing in Indian diets. Built with FastAPI, LangGraph, and a RAG (Retrieval-Augmented Generation) pipeline powered by FAISS vector search. Delivers context-aware nutrition guidance across multiple Indian regional cuisines with a modern Next.js 16 + TypeScript frontend and PostgreSQL database backend.
- 🍛 Regional Indian Cuisine Support — North, South, East, and West Indian cuisines
- 🤖 AI-Powered Recommendations — Personalized meal suggestions using RAG + LLM
- 💬 Conversational Interface — Natural language queries like "What should I eat for lunch in South India under 500 kcal?"
- 📊 Comprehensive Nutrition Data — Calories, macros (protein, carbs, fat), and micronutrients
- 🎯 Goal-Based Planning — Weight loss, maintenance, or muscle gain
- 🌱 Dietary Preferences — Vegan, vegetarian, non-vegetarian options
- 🏥 Health Condition Awareness — Allergy tracking and medical condition considerations
- 📱 Modern Web Interface — Responsive Next.js frontend with TypeScript
- 🐳 Docker Support — Easy deployment with Docker Compose
- 🔒 User Authentication — Secure login and profile management
- FastAPI — High-performance async Python web framework
- LangGraph — Advanced workflow orchestration for AI agents
- LangChain — LLM application framework
- FAISS — Vector similarity search for RAG pipeline
- Sentence Transformers — Text embeddings (HuggingFace)
- PostgreSQL — User data and profile storage
- asyncpg — Async PostgreSQL adapter
- Pydantic — Data validation and settings management
- Next.js 16 — React framework with App Router
- React 18 — Modern UI library
- TypeScript 5.0+ — Type-safe JavaScript
- Docker & Docker Compose — Containerization with multi-container orchestration
- PostgreSQL 17 — Containerized database service
- Uvicorn — ASGI server for FastAPI
- NVIDIA API Endpoints — LLM inference (optional)
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Next.js │ HTTP │ FastAPI │ Vector │ FAISS │
│ Frontend │─────────▶│ Backend │ Search │ Index │
│ │ │ │─────────▶│ │
└─────────────┘ └──────────────┘ └─────────────┘
│
│ SQL
▼
┌──────────────┐
│ PostgreSQL │
│ Database │
└──────────────┘
RAG Pipeline Flow:
- User query → Embedding generation
- FAISS vector search → Retrieve relevant food data
- Context + Query → LLM prompt augmentation
- LLM generates personalized nutrition advice
- Response returned to user
.
├── app/ # FastAPI Backend
│ ├── routers/ # API route handlers
│ ├── services/ # Business logic layer
│ ├── models.py # SQLAlchemy database models
│ ├── database.py # Database configuration
│ └── main.py # FastAPI application entry point
│
├── frontend/ # Next.js Frontend
│ ├── src/
│ │ ├── app/ # Next.js App Router pages
│ │ ├── components/ # Reusable React components
│ │ ├── lib/ # API client & utilities
│ │ └── styles/ # Global styles
│ └── package.json # Node.js dependencies
│
├── faiss_RAG.py # RAG pipeline implementation
├── food_dataset.csv # Curated Indian food nutrition data
├── food_dataset.json # JSON format food data
├── Food_dataset_Anuvaad.xlsx # Regional dataset
├── requirements.txt # Python dependencies
├── dockerfile # Docker image definition
├── docker-compose.yml # Multi-container orchestration
├── start-servers.bat # Quick start script (Windows)
├── .gitignore # Git ignore rules
└── README.md # This file
- Python 3.9+ (3.10 or 3.11 recommended)
- Node.js 22+ and npm
- PostgreSQL 17 (or Docker for containerized deployment)
- Git
- .env file with database and API credentials (see Configuration section)
For Docker deployment: Only need Docker and Docker Compose
# Clone the repository
git clone https://github.com/theankitdash/AI-Nutritional-Health-Assistant-Personalized-Guidance-for-Indian-Diets.git
cd AI-Nutritional-Health-Assistant-Personalized-Guidance-for-Indian-Diets
# Create .env file with database credentials
cp .env.example .env # (or create manually with required variables)
# Start all services with Docker Compose
docker-compose up --buildServices will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Database: localhost:5432
- Python 3.9+
- PostgreSQL 17 (must be running before starting backend)
- Node.js 22+
# Navigate to project root
cd AI-Nutritional-Health-Assistant-Personalized-Guidance-for-Indian-Diets
# Install Python dependencies
pip install -r app/requirements.txt
# Create and configure .env file (see Configuration section below)
# Start FastAPI server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000✅ Backend running at: http://localhost:8000
📚 API Documentation: http://localhost:8000/docs
# Navigate to frontend directory
cd frontend
# Install Node.js dependencies
npm install
# Start Next.js development server
npm run dev✅ Frontend running at: http://localhost:3000
PostgreSQL must be running before starting the backend:
# On Windows (if PostgreSQL installed locally):
# PostgreSQL service should auto-start or start from Services
# On macOS/Linux:
brew services start postgresql
# or
sudo systemctl start postgresql
# Create database (optional, can be auto-created):
createdb nutrify_dbCreate a .env file in the project root with the following variables:
# Database Configuration
DB_NAME=nutrify_db
DB_USER=postgres
DB_PASSWORD=your_secure_password
DB_HOST=localhost # Use 'postgres-db' for Docker
DB_PORT=5432
# API Configuration
API_BASE_URL=http://localhost:8000
NEXT_PUBLIC_API_URL=http://localhost:8000 # For Docker: http://fastapi:8000
# LLM Configuration (Optional - for NVIDIA API integration)
NVIDIA_API_KEY=your_nvidia_api_keyWhen using Docker Compose, update the .env file to use Docker service names:
# For Docker services, use service names instead of localhost
DB_HOST=postgres-db
NEXT_PUBLIC_API_URL=http://fastapi:8000Navigate to http://localhost:3000 in your browser
- Create a new account with email and password
- Or login with existing credentials
- Password is securely hashed with bcrypt
Set up three key sections after logging in:
- Age/Date of Birth, gender, height, weight
- Waist circumference
- Activity level (sedentary, moderate, active)
- Diet type (vegan, vegetarian, non-vegetarian)
- Regional cuisines (North, South, East, West Indian)
- Preferred meal types and ingredients
- Snack and sweet preferences
- Spice tolerance
- Caffeine intake
- Hydration level
- Meal frequency and eating out frequency
- Food allergies and restrictions
- Medical conditions (diabetes, hypertension, etc.)
- Sleep quality and duration
- Supplement usage
- Fitness goals (weight loss, maintenance, muscle gain)
Ask the AI assistant questions like:
- "What should I eat for lunch in South India under 500 kcal?"
- "Give me a high-protein vegetarian dinner option"
- "I need a meal plan for weight loss with North Indian food"
- "What's a healthy breakfast option with less than 300 calories?"
- "Suggest meals for someone with dairy allergies"
- "I'm diabetic, what are safe Indian meal options?"
The assistant will provide personalized recommendations based on:
- Your dietary preferences
- Health conditions and allergies
- Fitness goals
- Regional cuisine preferences
- Nutritional requirements
The application uses curated Indian food nutrition datasets:
Data Files:
food_dataset.csv— Primary nutrition database with Indian foodsfood_dataset.json— JSON format of food dataFood_dataset_Anuvaad.xlsx— Extended regional cuisine data with translations
Data Attributes:
- Food name and aliases
- Calories and macronutrients (protein, carbohydrates, fat)
- Micronutrients (vitamins, minerals)
- Regional origin and cuisine type
- Common preparation methods
Data Sources:
- USDA FoodData Central
- Indian Food Composition Tables (IFCT)
- Regional Indian nutrition studies
FAISS Indexing:
- Food data is embedded using Sentence Transformers
- FAISS index stored in
app/food_dataset/ - Enables fast semantic search for food recommendations
Warning
Medical Disclaimer: This application is for informational and educational purposes only and is NOT intended as medical or clinical nutrition advice. Always consult licensed healthcare professionals (doctors, registered dietitians) for:
- Medical nutrition therapy
- Chronic disease management
- Severe allergies or food sensitivities
- Personalized medical treatment plans
Known Limitations:
- Data Accuracy: Nutrition data accuracy depends on dataset quality; preparation methods and ingredient sourcing affect values
- Regional Coverage: Currently focused on major Indian regions (North, South, East, West); some cuisines may have limited data
- Allergies: Always independently verify ingredients if you have severe allergies or food sensitivities
- Portion Sizes: Recommendations are approximate; actual portions depend on individual needs and cooking methods
- Individual Variation: Nutritional needs vary based on metabolism, health conditions, and medications
- LLM Limitations: AI recommendations may occasionally be inaccurate; always verify with nutritional references
- GPU Acceleration: Embeddings are faster with GPU support, but CPU execution is supported for moderate usage
Best Practices:
- Use this tool as a starting point for nutrition planning
- Cross-reference recommendations with official nutrition databases
- Keep your profile information updated for better recommendations
- Consult healthcare professionals for medical conditions
- Report any inaccurate nutritional data to help improve the system
We welcome contributions! Here's how you can help:
-
Dataset Improvements
- Add more regional Indian foods
- Improve nutrition data accuracy
- Add recipe information
-
Code Contributions
- Bug fixes
- New features (see Roadmap)
- Performance optimizations
- Test coverage
-
Documentation
- Fix typos or improve clarity
- Add examples
- Translate to other languages
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with clear, descriptive commits
- Add tests if applicable
- Update documentation
- Submit a Pull Request
Please follow coding standards and include tests for new features.
- USDA FoodData Central: Public Domain
- Indian Food Composition Tables: Check specific source licenses
Made with ❤️ for healthier Indian diets