Zing Forum

Reading

CulinaX: A Pakistani Smart Cooking Assistant Fusing Rule Engines and Generative AI

CulinaX is a smart cooking assistant designed specifically for Pakistani cuisine, innovatively combining deterministic rule engines with generative AI to deliver a complete cooking experience from pantry management to AI chef conversations.

FlutterFirebase生成式AIGeminiOpenAI烹饪助手规则引擎Pantry管理巴基斯坦料理混合智能
Published 2026-05-28 07:45Recent activity 2026-05-28 07:49Estimated read 7 min
CulinaX: A Pakistani Smart Cooking Assistant Fusing Rule Engines and Generative AI
1

Section 01

Introduction: CulinaX—A Pakistani Smart Cooking Assistant Fusing Rule Engines and Generative AI

CulinaX is a smart cooking assistant designed specifically for Pakistani cuisine, innovatively combining deterministic rule engines with generative AI to deliver a complete cooking experience from pantry management to AI chef conversations. The project is developed using the Flutter framework, with a backend based on Firebase, integrating Google Gemini and OpenAI's generative AI capabilities to create a hybrid intelligent system that balances precision and creativity.

2

Section 02

Project Background and Basic Information

Original Author and Source

  • Original Author/Maintainer: tahanawab4848
  • Source Platform: GitHub
  • Release Date: May 27, 2026

Project Overview

CulinaX is positioned as a smart cooking assistant exclusive to Pakistani cuisine. Its core innovation lies in a layered architecture design that clearly separates deterministic rule engines from generative AI intelligence, ensuring both the reliability of core functions and a creative user experience.

3

Section 03

Two-Engine Architecture Design: Combining Deterministic and Generative Intelligence

Rule Engine Layer (Deterministic Layer)

Responsible for precise calculation and consistent functions:

  • Pantry inventory management (recording ingredient storage time, shelf life, and expiration reminders)
  • Smart ingredient matching (calculating the match between recipes and available ingredients)
  • Recipe ranking (recommendations sorted by ingredient match degree)
  • Automatic shopping list generation (listing items to buy when ingredients are missing)
  • Meal plan scheduling

AI Intelligence Layer (Generative Layer)

Provides creative services via Gemini/OpenAI API:

  • AI Chef chatbot (natural language interaction)
  • Smart recipe generation (creating original recipes based on available ingredients)
  • Explanation of recommendation reasons (illustrating the principles of ingredient pairing)
  • Ingredient substitution suggestions
  • Step-by-step cooking guidance (real-time prompts + voice broadcast)
  • Smart meal suggestions (based on eating habits and pantry status)
4

Section 04

Technical Implementation Details: Tech Stack and Data Model

Tech Stack

  • Frontend: Flutter (Provider state management)
  • Backend: Firebase (Authentication, Firestore, Storage)
  • AI Integration: google_generative_ai package (Gemini) + http package (OpenAI as alternative)
  • Rule Engine: services/recipe_engine.dart
  • Device Features: Barcode scanning, image recognition (on-device)

Data Model

Core Firestore Collections:

  • users (user information)
  • pantry_items (ingredient list + shelf life)
  • recipes (recipe database)
  • grocery_list (shopping list)
  • meal_plans (meal plans)
  • ai_interactions (AI conversation history)
5

Section 05

Typical Usage Flow: From Ingredient Management to AI Cooking Guidance

  1. Login Initialization: After registration, add pantry items (e.g., chicken, rice) and set their shelf life
  2. Smart Recommendations: The homepage displays AI-selected recipes and their recommendation reasons
  3. AI Conversation: Use natural language to ask for cooking advice in the AI Chef interface
  4. Recipe Generation: Generate original recipes based on available ingredients (suitable for scenarios like dorm dinners)
  5. Recipe Details: View recommendation reasons and one-click ingredient substitution function
  6. Cooking Mode: Step-by-step guidance + AI prompts + voice broadcast support
6

Section 06

Significance of Hybrid Intelligence: Balancing Reliability and Creativity

Advantages of Rule Engines

  • Precise calculation and predictable results
  • High efficiency in structured data processing
  • Offline availability
  • Good data privacy (local processing of pantry data)

Advantages of Generative AI

  • Flexible natural language understanding
  • Creative content generation (new recipes, substitution suggestions)
  • Personalized explanations and conversations
  • Continuous learning and improvement capabilities

Combining the two ensures both reliable core functions and a creative experience, which serves as a reference for other smart assistant applications.

7

Section 07

Project Insights: How Developers Can Balance the Boundaries Between Rules and AI

CulinaX demonstrates a case of reasonably dividing the boundaries between deterministic logic and generative AI in mobile applications:

  • Not all functions require large models, nor are all functions suitable for rule-based implementation
  • Finding the optimal combination point between the two is essential to building applications that are both reliable and intelligent

For developers, this is a reference example for hybrid intelligent system design.