Skip to content

AI, Agents & Data Science Strategy

CostEngine (MfgIQ) is built on a "Deterministic Core, Probabilistic Edge" philosophy. While the costing math must be 100% accurate (Deterministic), the guidance and optimization layers leverage AI and Machine Learning (Probabilistic).


The Three Horizons of Intelligence

We view intelligence not as a single blob, but as three distinct layers of value:

Horizon Type Technology Goal Example
H1 Calculated Python/SQL Accuracy "The material cost is exactly ₹104.50 based on current rates."
H2 Predicted Data Science / ML Regression "Based on 5-year trends, steel prices will likely rise 5% next month."
H3 Agentic LLMs / Agents Reasoning "I noticed this part looks like the 'Bracket-A' we made last year. Should I copy that routing?"

1. Data Science & Analytics (H2)

Data Science focuses on Macro-Optimization and Risk Assessment. It runs on the historical data accumulated in the PostgreSQL fact_quotes tables.

Key Use Cases

  1. Price Prediction Models:

    • Forecast raw material trends to suggest "Rate Locks" before prices spike.
    • Tech: Time-series forecasting (Prophet/Arima) on duckdb.
  2. Win/Loss Analysis:

    • Cluster analysis to identify which "Part Geometries" or "Industry Segments" we consistently lose.
    • Insight: "We win 80% of quotes for Turned Shafts but only 10% for Prismatic Milling."
  3. Anomaly Detection:

    • Flagging outliers in manual inputs.
    • Check: "Operator input 4.5 hours for a 10mm drill operation. Average is 0.4 minutes. Flag as error."

2. Agentic Engineering (H3)

Agentic AI focuses on Micro-Orchestration and Human Augmentation. It uses Large Language Models (LLMs) to reason about the meaning of the data.

The "Costing Agent" Architecture

The Agent is not a chatbot; it is a specialized worker that has access to Tools (the Semantic Layer).

  • Role: Virtual Estimator Assistant
  • Tools:
    • lookup_material_properties(grade)
    • find_similar_parts(geometry_embedding)
    • validate_routing_logic(operations_list)

Example Workflow: The "Sanity Check" Agent

  1. Trigger: Estimator clicks "Review Quote".
  2. Observation: Agent reads the Quote JSON.
  3. Reasoning:
    • Thought: "The material is SS304 (Hard), but the cutting speed is set to 200 m/min. That seems too fast for Stainless Steel."
  4. Action: Agent flags a warning note on the specific operation line.

Integration with Core Kernel

To ensure safety, AI/ML never directly writes to the financial ledger.

  • Advisory Mode: AI suggests changes (Draft Version), Human approves (Final Version).
  • Guardrails: The Semantic Layer validates all AI outputs against physical constraints (e.g., "Yield cannot be > 100%").

3. MLOps & Observability

To move beyond "demo-ware" into a reliable production system, we implement a strict operational layer for our intelligence features.

MLOps Lifecycle (UC-905)

  • Data Drift: Monitoring if the "Excel patterns" coming from new customers differ from our training sets.
  • Shadow Mode: New agents are first deployed in "Shadow Mode"—making suggestions that only Admins see—to validate accuracy before reaching Estimators.
  • Governance: Storing the specific prompts and model versions used for every "Explainability" output for audit compliance.

The "Pulse" (Observability)

  • Unified Logging: Tracking how long an "Agentic Sanity Check" takes to ensure it doesn't slow down the Quote Generation (NFR: < 500ms).
  • Feedback Loops: Every time an Estimator chooses "Ignore Suggestion," the event is logged as a negative signal to refine the localized factory model.

Philosophy: CostEngine provides the Calculator (Math). Data Science provides the Map (Trends). Agents provide the Co-Pilot (Guidance).