Skip to content
BSKLab.ai
Research noteIndustrial AI Agents

Industrial AI Agents — Godínez Phase 1 Research Note

We built Godínez, a LangGraph-based agent that turns natural-language questions about production data into verified OEE, trend, bottleneck and cost analysis — deterministic math, LLM only for routing.

Research question

Can an LLM-agent workflow reliably answer industrial-engineering questions on plant data without the LLM doing the math?

Godínez pipeline: the LLM only routes; every number comes from deterministic, tested math.

Background

Most manufacturing AI demos let the LLM generate the analysis. That works in a demo and fails in a plant: a hallucinated OEE figure or a mis-cited bottleneck is worse than no answer. Godínez is our answer to the question of how to build an industrial agent where the LLM is never in the trust path for a number.

What We Built

A LangGraph state machine agent ("Godínez IndustrialEngineer") with an explicit graph, not a chain:

intake → classify → router → analyze → response → END

  • **Three-tier intent classifier** with graceful degradation: local vLLM model (DGX) → local Ollama model → deterministic keyword matching. The agent always answers, even fully offline.
  • **Orchestrator analysis node** that dispatches to multiple specialist handlers per query and merges their structured results (one question can ask for OEE + trends + bottleneck at once).
  • **Deterministic analysis engines** (pure pandas/math, no LLM): OEE calculation with rating classification, trend analysis (linear regression, z-score anomaly detection, 7/30/60/90-day forecasts, timeseries decomposition), bottleneck detection (line balance, cycle-time variance, Theory-of-Constraints severity scoring), and cost analysis (scrap/rework/downtime cost with ROI projections).
  • **Structured outputs everywhere** — every node result flows through a typed Pydantic schema; no free-text parsing anywhere in the pipeline.
  • **API + persistence layer** — FastAPI (`POST /api/query`, data upload, session history), SQLite/PostgreSQL persistence via SQLAlchemy + Alembic, and a full CLI.
  • **Verification:** 297 automated tests, including security tests (SQL injection, path traversal, XSS) and edge-case suites for every analysis engine.

What It Does

A plant engineer asks in plain language — "Where is the line losing time this week, and what is it costing us?" — and the agent:

1. Classifies intent (trend + bottleneck + cost, multi-intent) 2. Routes to the matching analysis engines 3. Runs the deterministic math on the production CSV data 4. Returns a formatted report with OEE components, trend/forecast charts, constraint identification, and a cost-of-waste breakdown with ROI projections

The LLM's job is exactly one: understand the question and pick the tools. The numbers, the severity ratings, and the recommendations all come from code that can be unit-tested and audited.

Why a Plant Engineer Should Care

  • **Verified numbers.** OEE, cycle-time statistics, and cost figures are computed, not generated. If the answer is wrong, there is a bug to find — not a model to re-prompt.
  • **Works offline.** The whole stack runs on on-prem hardware (DGX Spark + local Ollama). Production data never leaves the plant network.
  • **Multi-intent in one question.** IE work is rarely single-metric. Asking OEE + bottleneck + cost in one query and getting a merged report matches how the work actually happens.
  • **Graceful degradation.** If the local GPU model is busy or down, the classifier steps down to keyword routing instead of failing.

Links & References

  • Internal project: Godínez IndustrialEngineer (workspace project, planning doc in repo)
  • `langchain-ai/langgraph` — stateful orchestration framework
  • `NVIDIA-AI-Blueprints/aiq-research-assistant` — reference blueprint (orchestrator → planner → researcher pattern)
  • Theory of Constraints (Goldratt) — bottleneck severity model
  • Lean Six Sigma cost-of-quality framework — cost analysis structure

Limitations

  • **Safety audit is incomplete.** The OSHA compliance analysis and human-in-the-loop review gate (Phase 5) are designed but not yet implemented; only OEE, trend, bottleneck, and cost are live.
  • **Data input is CSV.** No live MES/ERP connectors yet — real factory integration is the next step.
  • **Recommendations are rule-based.** Deterministic by design (fully auditable, zero hallucination), but less nuanced than LLM-generated advice could be.
  • **Small-scale validation.** 297 tests and synthetic/sample data; not yet validated against a production plant's full dataset.

Next steps

  • Ship Phase 5: safety audit node with a local-embedding OSHA knowledge base and a human review gate for critical findings.
  • Add live data connectors (MES/ERP) beyond CSV import.
  • Validate against real factory data from a partner line.
  • Explore LLM-synthesized recommendations layered on top of the deterministic core, with the deterministic output as ground truth.

Related labs

Appeared in