All articles →

100 Exercises / Probability Statistics / 100 Exercise Points in Probability & Statistical Marketing Applications

Practical Manufacturing DI with Python | KPI, Knowledge Graphs, Optimization, and AI Agent: 10 Exercise-On Steps

Build a manufacturing decision-support prototype in Python with KPIs, validated joins, knowledge graphs, simulation, planning, and review logs.

Manufacturing DI Turning Data into ‘Decisions’: 10 Practical Exercises Connecting Orders, Quality, and Equipment

Build a small manufacturing DI (Decision Intelligence) prototype for a fictional precision-parts factory. Link orders, production, quality, and downtime, then connect KPI monitoring to possible causes, scenario comparisons, recommended actions, and execution records.

The target is No.091 to No.100. Rather than listing individual technologies, we explain according to manufacturing practices: “Which decisions to make, with which data and models, and who to execute safely?”

Note This material adapts notebooks used in corporate training by Surikobo or its representative, Wayama, and is published with the participating companies’ permission. All datasets are fictional and do not represent actual companies, factories, or results.

Introduction: Practical Challenges in Manufacturing Covered in This Article

The factory has systems for production management, quality control, equipment maintenance, and cost management. However, what we really want to know in meetings is not the individual system numbers, but rather questions like, “What caused this month’s missed delivery?” “Should recovery be achieved through overtime or outsourcing?” and “How measures affect gross profit and quality.”

Here, we address the challenge of determining the production policy for the following week by simultaneously considering the three lines producing precision valve components, including delivery deadlines, defects, stoppages, and contribution margin.

Common situations on site

  • Creating KPI materials takes time, and the data is outdated at the time of the meeting.
  • Definitions and aggregation granularity differ by department
  • Even when abnormalities are found, the relationships between orders, equipment, and quality are manually traced.
  • Simulations and optimizations stop on the analyst’s PC, leaving no execution history
  • AI proposal reasons, reference data, and approvers cannot be tracked or deployed on site.

The goal of DI is not to add more dashboards. It aims to shorten lead times from observation to judgment, execution, and learning, thereby improving the reproducibility of decision-making.

Why is this issue so difficult to judge?

Decision-making in manufacturing involves a mix of multiple time axes and objectives. Increasing equipment utilization can increase short-term production volume, but it can lead to quality deterioration or postponed maintenance. Outsourcing to meet deadlines ensures sales while reducing contribution margin.

Furthermore, actual figures carry uncertainties such as demand fluctuations, downtime, and yields. Therefore, rather than maximizing a single KPI, it is necessary to design decisions that include causality, constraints, predictive distribution, and approval rules among KPIs.

Exercise Overview

No.ThemeQuestions in this notebook
091What is Manufacturing DI?How to connect data to decisions and execution
092KPI DesignHow to connect business performance with frontline leading indicators
093Data Model DesignHow to securely combine data of different granularities
094Ontology DesignHow to standardize terminology and relationships
095knowledge graphHow to trace possible causes from KPI anomalies
096Simulation PlatformHow to compare proposals under uncertainty
097Optimization PlatformHow to choose an action plan that adheres to constraints
098Utilizing AI AgentsHow to Incorporate Proposals into Secure Business Workflows
099Design of the manufacturing version of PalantirHow to integrate data, models, and operations
100The World Aimed for by SurikoboHow to foster a decision-making foundation for continuous learning

The further you go into the latter half, the Description (what happened)→Diagnosis (why it happened)→Prediction (what will happen)→Prescription (what to do)→Execution and Learning develops.

Preparing the Python environment

It does not rely on external data; it generates fictional data using numpy and pandas and visualizes it with matplotlib. The random number generator fixes the seed. networkx will be used for the knowledge graph in the latter half.

Run the cells in order in a notebook. Each [IN: n] is paired with its [OUT: n] result. These outputs were checked with Python 3.14.4, NumPy 2.5.1, and pandas 3.0.3. Library versions can affect final digits and display formatting.

Environment and library setup ([IN: 1])
[IN: 1]
import platform
import sys

import japanize_matplotlib
import matplotlib
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
from IPython.display import display

SEED = 42
rng = np.random.default_rng(SEED)
pd.set_option("display.max_columns", 20)
pd.set_option("display.float_format", lambda x: f"{x:,.2f}")

print(f"Python      : {sys.version.split()[0]}")
print(f"OS          : {platform.system()} {platform.release()}")
print(f"numpy       : {np.__version__}")
print(f"pandas      : {pd.__version__}")
print(f"matplotlib  : {matplotlib.__version__}")
print(f"networkx    : {nx.__version__}")
[OUT: 1]
Python      : 3.14.4
OS          : Darwin 25.5.0
numpy       : 2.5.1
pandas      : 3.0.3
matplotlib  : 3.11.0
networkx    : 3.6.1

Creation of Fictional Data

We create daily performance data by line for 90 days. The primary key is date × line_id. We assign demand, planning, production, good products, defects, stoppages, overtime, power, and quantities within delivery deadlines. The L3 line is set to have deteriorating downtime and defect rates over the last 45 days, intentionally embedding changes that DI should detect.

Assume every good unit can be sold. Deduct materials for all produced units, including defects, overtime, and electricity from good-unit revenue. Fixed costs are excluded. Align definitions and revenue timing with accounting before operational use.

Synthetic-data setup code ([IN: 2])
[IN: 2]
dates = pd.date_range("2025-01-01", periods=90, freq="D")
lines = pd.DataFrame(
    {
        "line_id": ["L1", "L2", "L3"],
        "line_name": ["cutting1number", "cutting2number", "Composite processing"],
        "rated_units": [128, 116, 104],
        "product_id": ["P-A", "P-B", "P-C"],
    }
)
products = pd.DataFrame(
    {
        "product_id": ["P-A", "P-B", "P-C"],
        "product_name": [
            "Standard Valve",
            "Heat-resistant valve",
            "high-pressure valve",
        ],
        "price_yen": [8200, 10600, 14800],
        "material_yen": [3900, 5200, 7600],
    }
)

rows = []
for day_no, date in enumerate(dates):
    weekday_factor = 0.90 if date.dayofweek >= 5 else 1.00
    for rec in lines.itertuples(index=False):
        demand = max(55, int(rng.normal(rec.rated_units * 0.91 * weekday_factor, 12)))
        planned = min(
            int(rec.rated_units * weekday_factor), demand + int(rng.integers(2, 11))
        )
        stop_mean = 42 if (rec.line_id == "L3" and day_no >= 45) else 24
        downtime = max(0, rng.normal(stop_mean, 10))
        overtime = max(0, demand - planned) * 0.12 + rng.uniform(0, 1.8)
        availability = np.clip(1 - downtime / 480, 0.70, 1.00)
        produced = max(0, int(planned * availability + overtime * 5 + rng.normal(0, 3)))
        defect_base = {"L1": 0.018, "L2": 0.025, "L3": 0.028}[rec.line_id]
        if rec.line_id == "L3" and day_no >= 45:
            defect_base += 0.025
        defective = rng.binomial(produced, min(0.15, defect_base + downtime / 12000))
        good = produced - defective
        on_time = min(
            good, max(0, int(demand - max(0, rng.normal(downtime / 18 - 1, 3))))
        )
        rows.append(
            [
                date,
                rec.line_id,
                rec.product_id,
                demand,
                planned,
                produced,
                good,
                defective,
                downtime,
                overtime,
                produced * rng.uniform(2.7, 3.3),
                on_time,
            ]
        )

daily = pd.DataFrame(
    rows,
    columns=[
        "date",
        "line_id",
        "product_id",
        "demand_units",
        "planned_units",
        "produced_units",
        "good_units",
        "defect_units",
        "downtime_min",
        "overtime_h",
        "energy_kwh",
        "on_time_units",
    ],
).merge(products, on="product_id", validate="many_to_one")
daily["sales_yen"] = daily["good_units"] * daily["price_yen"]
daily["contribution_yen"] = (
    daily["sales_yen"]
    - daily["produced_units"] * daily["material_yen"]
    - daily["overtime_h"] * 3_200
    - daily["energy_kwh"] * 24
)
daily["defect_rate"] = daily["defect_units"] / daily["produced_units"].clip(lower=1)
daily["otd_rate"] = daily["on_time_units"] / daily["demand_units"].clip(lower=1)

print(
    f"Daily Line Performance: {len (daily ):,}rows / Period: {daily ['date'].min ().date ()}〜{daily ['date'].max ().date ()}"
)
display(daily.head())
[OUT: 2]
Daily Line Performance: 270rows / Period: 2025-01-01〜2025-03-31
date line_id product_id demand_units planned_units produced_units good_units defect_units downtime_min overtime_h energy_kwh on_time_units product_name price_yen material_yen sales_yen contribution_yen defect_rate otd_rate
0 2025-01-01 L1 P-A 120 127 119 113 6 31.50 1.26 377.42 113 Standard Valve 8200 3900 926600 449,424.96 0.05 0.94
1 2025-01-01 L2 P-B 105 110 112 109 3 15.47 0.67 332.20 101 Heat-resistant valve 10600 5200 1155400 562,891.46 0.03 0.96
2 2025-01-01 L3 P-C 84 86 90 86 4 14.41 1.49 295.42 84 high-pressure valve 14800 7600 1272800 576,942.82 0.04 1.00
3 2025-01-02 L1 P-A 114 120 118 118 0 19.72 0.35 366.96 112 Standard Valve 8200 3900 967600 497,471.84 0.00 0.98
4 2025-01-02 L2 P-B 131 116 125 123 2 18.88 2.47 373.18 123 Heat-resistant valve 10600 5200 1303800 636,949.88 0.02 0.94

No.091: What is Manufacturing DI — Turning Observation to Execution into a Single Decision Loop

Practical Purpose

While BI visualizes “what happened,” DI connects that information to cause analysis, option evaluation, recommendations, approvals, execution, and effectiveness verification. In manufacturing, it is important not only to display red for missed deliveries, but also to identify the contribution of stoppages and defects, and to design whether to use overtime, maintenance, or outsourcing.

Method and Assumptions

Place the smallest decision loop as Observe → Diagnose → Predict → Decide → Act → Learn. First, we aggregate the on-time delivery rate (OTD), defect rate, downtime time, and contribution margin at the same granularity for each line.

OTD=On-time unitsDemand unitsDefect rate=defective quantityproduction quantity\begin{gathered} \mathrm{OTD}=\frac{\text{On-time units}}{\text{Demand units}}\\ \mathrm{Defect\ rate}=\frac{\text{defective quantity}}{\text{production quantity}} \end{gathered}

Check with Python

The most recent 30 days are considered the decision-making period, and multiple KPIs are compared on the same scorecard.

[IN: 3]
recent = daily[daily["date"] >= daily["date"].max() - pd.Timedelta(days=29)]
di_scorecard = recent.groupby("line_id").agg(
    demand=("demand_units", "sum"),
    good_quantity=("good_units", "sum"),
    quantity_on_delivery=("on_time_units", "sum"),
    production_volume=("produced_units", "sum"),
    number_of_defects=("defect_units", "sum"),
    stop_time=("downtime_min", "sum"),
    contribution_yen=("contribution_yen", "sum"),
)
di_scorecard["On-time delivery rate"] = (
    di_scorecard["quantity_on_delivery"] / di_scorecard["demand"]
)
di_scorecard["defect_rate"] = (
    di_scorecard["number_of_defects"] / di_scorecard["production_volume"]
)
display(
    di_scorecard[
        [
            "demand",
            "good_quantity",
            "On-time delivery rate",
            "defect_rate",
            "stop_time",
            "contribution_yen",
        ]
    ]
)

ax = di_scorecard[["On-time delivery rate", "defect_rate"]].plot.bar(
    figsize=(8, 4), color=["#2a6fbb", "#d95f02"]
)
ax.set_title("Line scorecard for the last 30 days")
ax.set_xlabel("Line")
ax.set_ylabel("ratio")
ax.grid(axis="y", alpha=0.3)
ax.legend(loc="best")
plt.tight_layout()
plt.show()
[OUT: 3]
demand good_quantity On-time delivery rate defect_rate stop_time contribution_yen
line_id
L1 3357 3404 0.98 0.02 604.76 14,029,536.88
L2 3009 3009 0.96 0.03 675.35 15,451,285.92
L3 2621 2517 0.94 0.06 1,226.47 16,692,984.85

No.091: What is Manufacturing DI — Turning Observation to Execution into a Single Decision Loop: result chart

Interpreting the Results

L3 has a lower on-time delivery rate and higher defect rates than other lines, and it has been confirmed that downtime is also significant. Since multiple KPIs are worsening simultaneously rather than a single red flag, diagnosis from the perspective of equipment and quality should be prioritized over simple production increases. In DI, this scorecard serves as the entry point for the next cause search and countermeasure comparison.

No.092: KPI Design — Breaking down management results into actionable metrics on the ground

Practical Purpose

With just sales and profits, the field doesn’t know what needs to change today. On the other hand, chasing only the easily measurable utilization rate can lead to overproduction or postponed maintenance. It is necessary to connect lagging and leading indicators with causal hypotheses, and to define responsible persons and update frequencies.

Method and Assumptions

Here, performance KPIs are defined as contribution margin and on-time delivery rate, while leading KPIs are defect rate, downtime rate, and overtime hours. Standardize achievement from goals in a directional way to create a weighted health score.

S=100∑kwkak∑kwk=1\begin{gathered} S=100\sum_k w_k a_k\\ \sum_k w_k=1 \end{gathered}

For higher-is-better KPIs, use ak=max⁡(0,min⁡(xk/tk,1))a_k=\max(0,\min(x_k/t_k,1)). For nonnegative lower-is-better KPIs, use ak=min⁡(tk/xk,1)a_k=\min(t_k/x_k,1), setting achievement to one at xk=0x_k=0. Targets are positive. Clipping prevents negative profit from producing a score below zero. Also show individual KPIs.

Check with Python

[IN: 4]
kpi = di_scorecard.copy()
kpi["stop rate"] = kpi["stop_time"] / (30 * 480)
kpi["overtime hours"] = recent.groupby("line_id")["overtime_h"].sum()
kpi["Profit Achievement"] = (kpi["contribution_yen"] / 12_000_000).clip(
    lower=0, upper=1
)
kpi["OTDachieve"] = (kpi["On-time delivery rate"] / 0.97).clip(upper=1)
kpi["Quality Achievement"] = (
    (0.025 / kpi["defect_rate"].replace(0, np.nan)).clip(upper=1).fillna(1)
)
kpi["stop achievement"] = (
    (0.07 / kpi["stop rate"].replace(0, np.nan)).clip(upper=1).fillna(1)
)
kpi["KPIhealth level"] = 100 * (
    0.35 * kpi["Profit Achievement"]
    + 0.30 * kpi["OTDachieve"]
    + 0.20 * kpi["Quality Achievement"]
    + 0.15 * kpi["stop achievement"]
)
display(
    kpi[
        [
            "On-time delivery rate",
            "defect_rate",
            "stop rate",
            "overtime hours",
            "contribution_yen",
            "KPIhealth level",
        ]
    ].round(3)
)

fig, ax = plt.subplots(figsize=(8, 4))
kpi["KPIhealth level"].sort_values().plot.barh(
    ax=ax, color=["#d95f02", "#e6ab02", "#1b9e77"]
)
ax.axvline(90, color="black", linestyle="--", label="Review threshold: 90 points")
ax.set_title("Combined business and operational KPI score")
ax.set_xlabel("KPIHealth Level (0〜100)")
ax.set_ylabel("Line")
ax.grid(axis="x", alpha=0.3)
ax.legend()
plt.tight_layout()
plt.show()
[OUT: 4]
On-time delivery rate defect_rate stop rate overtime hours contribution_yen KPIhealth level
line_id
L1 0.98 0.02 0.04 33.80 14,029,536.88 100.00
L2 0.96 0.03 0.05 28.95 15,451,285.92 96.68
L3 0.94 0.06 0.09 33.77 16,692,984.85 85.44

No.092: KPI Design — Breaking down management results into actionable metrics on the ground: result chart

Interpreting the Results

The reason L3 health is low is not only OTD but also a combination of quality and failure to meet downtime targets. In practice, weights are not determined solely by analysts; instead, factory managers, manufacturing, quality, and maintenance agree on these points, and definitions, units, aggregation granularity, update frequency, responsible persons, and target values are recorded in the KPI ledger.

No.093: Data Model Design — Determining aggregation granularity and primary key first

Practical Purpose

Orders are received by the item, manufacturing by the lot, equipment by the second, and quality by the inspection unit. If you combine these without checking the key, the rows multiply, and sales and defects are double-counted. A good data model supports the idea that “the same questions get the same answers” rather than just analysis speed.

Method and Assumptions

Separate facts from product and line dimensions. Each line makes one product here, so the daily fact key is date × line_id. Treat product_id as a dimension reference, require unique dimension keys, and check row counts and quantity/profit totals after joins.

Check with Python

[IN: 5]
fact = daily[
    ["date", "line_id", "product_id", "good_units", "defect_units", "contribution_yen"]
].copy()
dim_line = lines[["line_id", "line_name", "rated_units"]].copy()
dim_product = products.copy()

assert not fact.duplicated(["date", "line_id"]).any()
assert dim_line["line_id"].is_unique
assert dim_product["product_id"].is_unique

model = fact.merge(dim_line, on="line_id", validate="many_to_one").merge(
    dim_product, on="product_id", validate="many_to_one"
)
assert len(model) == len(fact)
assert model["good_units"].sum() == fact["good_units"].sum()
assert np.isclose(model["contribution_yen"].sum(), fact["contribution_yen"].sum())

quality_contract = pd.DataFrame(
    {
        "Inspection items": [
            "Fact Primary Key Overlap",
            "Difference in row count before and after joining",
            "Difference in the number of good products",
            "contribution margin difference",
        ],
        "Results": [
            fact.duplicated(["date", "line_id"]).sum(),
            len(model) - len(fact),
            model["good_units"].sum() - fact["good_units"].sum(),
            model["contribution_yen"].sum() - fact["contribution_yen"].sum(),
        ],
        "Passing Requirements": ["0", "0", "0", "0"],
    }
)
display(quality_contract)
display(model.head(3))
[OUT: 5]
Inspection items Results Passing Requirements
0 Fact Primary Key Overlap 0.00 0
1 Difference in row count before and after joining 0.00 0
2 Difference in the number of good products 0.00 0
3 contribution margin difference 0.00 0
date line_id product_id good_units defect_units contribution_yen line_name rated_units product_name price_yen material_yen
0 2025-01-01 L1 P-A 113 6 449,424.96 cutting1number 128 Standard Valve 8200 3900
1 2025-01-01 L2 P-B 109 3 562,891.46 cutting2number 116 Heat-resistant valve 10600 5200
2 2025-01-01 L3 P-C 86 4 576,942.82 Composite processing 104 high-pressure valve 14800 7600

Interpreting the Results

All four test results were zero, confirming that there was no double counting due to dimension coupling. In practice, this inspection is automated during pipeline execution, and if violations occur, dashboard updates and optimization execution are halted. Rather than “just joining for now,” the starting point is to manage granularity and primary keys as data contracts.

No.094: Ontology Design — Making Business Terms and Relationships Machine-Readable

Practical Purpose

Even with the same “stop,” if there are departments that include planned stoppages and those that do not, a comparison of meetings cannot be made. Ontology defines concepts and relationships such as equipment, products, KPIs, events, and countermeasures as common vocabulary, serving as a blueprint connecting data and operations.

Method and Assumptions

Represent relationships as subject–relation–object triples, such as “line produces product,” “downtime event occurs on equipment,” and “KPI is calculated from production records.” Include KPI formulas and data lineage in the same semantic layer.

Check with Python

[IN: 6]
triples = pd.DataFrame(
    [
        ("L3", "type", "ProductionLine"),
        ("L3", "produces", "P-C"),
        ("P-C", "type", "Product"),
        ("DT-L3", "type", "DowntimeEvent"),
        ("DT-L3", "occursOn", "L3"),
        ("DT-L3", "affects", "Availability"),
        ("Availability", "contributesTo", "OTD"),
        ("DefectRate", "contributesTo", "OTD"),
        ("OTD", "calculatedFrom", "DailyLineFact"),
        ("MaintenanceAction", "mitigates", "DT-L3"),
    ],
    columns=["subject", "predicate", "object"],
)

ontology_summary = (
    triples.groupby("predicate").size().rename("relationship_count").to_frame()
)
display(triples)
display(ontology_summary)
[OUT: 6]
subject predicate object
0 L3 type ProductionLine
1 L3 produces P-C
2 P-C type Product
3 DT-L3 type DowntimeEvent
4 DT-L3 occursOn L3
5 DT-L3 affects Availability
6 Availability contributesTo OTD
7 DefectRate contributesTo OTD
8 OTD calculatedFrom DailyLineFact
9 MaintenanceAction mitigates DT-L3
relationship_count
predicate
affects 1
calculatedFrom 1
contributesTo 2
mitigates 1
occursOn 1
produces 1
type 3

Interpreting the Results

The triples connect L3 downtime events, availability, OTD, and maintenance actions. This allows queries about affected KPIs even when table or screen names change. Start with the vocabulary needed for one decision and maintain versions as definitions evolve.

No.095: Knowledge Graph — Tracing Causes and Countermeasures from KPIs

Practical Purpose

Conducting operations that ask experts every time KPIs are abnormal becomes dependent on individuals and lengthens the investigation time. The knowledge graph traces the relationships among equipment, events, KPIs, causes, and countermeasures, supporting the initial diagnosis response. However, the path is not a proof of causality, but an investigative hypothesis.

Method and Assumptions

If ontologies are blueprints of meaning, knowledge graphs store specific objects and relationships. Search for sources of impact from abnormal KPIs in reverse and connect to countermeasure candidates. You can prioritize candidates with short graph distances, but separate time series consistency and statistical verification are performed.

Check with Python

[IN: 7]
edges = [
    ("spindle wear", "defect_rate", "increases"),
    ("spindle wear", "sudden stop", "causes"),
    ("sudden stop", "availability", "decreases"),
    ("availability", "On-time delivery rate", "improves"),
    ("defect_rate", "On-time delivery rate", "decreases"),
    ("preventive maintenance", "spindle wear", "mitigates"),
    ("Conditional Correction", "defect_rate", "mitigates"),
    ("overtime", "On-time delivery rate", "improves"),
]
G = nx.DiGraph()
for source, target, relation in edges:
    G.add_edge(source, target, relation=relation)

paths = []
for source in ["spindle wear", "sudden stop", "defect_rate", "availability"]:
    if nx.has_path(G, source, "On-time delivery rate"):
        path = nx.shortest_path(G, source, "On-time delivery rate")
        paths.append(
            {
                "Candidate cause": source,
                "distance": len(path) - 1,
                "Explanation Route": " → ".join(path),
            }
        )
display(pd.DataFrame(paths).sort_values("distance"))

pos = nx.spring_layout(G, seed=SEED)
plt.figure(figsize=(9, 6))
nx.draw_networkx(
    G,
    pos,
    node_color="#d9edf7",
    edge_color="#777777",
    node_size=1900,
    font_size=9,
    font_family=plt.rcParams["font.family"][0],
    arrows=True,
    arrowsize=16,
)
edge_labels = nx.get_edge_attributes(G, "relation")
nx.draw_networkx_edge_labels(
    G,
    pos,
    edge_labels=edge_labels,
    font_size=7,
    font_family=plt.rcParams["font.family"][0],
)
plt.title(
    "Knowledge graph focusing on on-time delivery rates and causes and countermeasures"
)
plt.xlabel(
    "Relationships between concepts (placement itself has no quantitative meaning)"
)
plt.ylabel(
    "Relationships between concepts (placement itself has no quantitative meaning)"
)
plt.grid(alpha=0.15)
plt.tight_layout()
plt.show()
[OUT: 7]
Candidate cause distance Explanation Route
2 defect_rate 1 defect_rate → On-time delivery rate
3 availability 1 availability → On-time delivery rate
0 spindle wear 2 spindle wear → defect_rate → On-time delivery ...
1 sudden stop 2 sudden stop → availability → On-time delivery ...

No.095: Knowledge Graph — Tracing Causes and Countermeasures from KPIs: result chart

Interpreting the Results

We were able to list candidates for defect rates and availability, which directly contribute to on-time delivery rates, as well as upstream spindle wear and sudden shutdowns. Preventive maintenance is linked to spindle wear, and process-setting adjustments is linked to defect rates. The next investigation will check the L3 maintenance records, vibration values, and machining conditions. Simply having a path in the graph does not definitively identify the cause; approval conditions are based on physical inspection and data verification.

No.096: Simulation Platform — Comparing Proposals Based on Result Distribution Rather Than Average

Practical Purpose

Even if you understand that “maintenance reduces downtime” or “overtime increases production,” demand, stoppages, and yields are not always the same, so you cannot judge the safety of a plan based solely on expected values. The simulation platform records assumptions, random seeds, model versions, and execution results, allowing for reproducible comparison of the proposal.

Method and Assumptions

Run 2,000 weekly trials for current operation, two hours of daily overtime, and maintenance on L3. Round demand to units, recognize revenue only for shipped goods, and charge materials for all production including defects. Overtime costs 44,800 yen (two hours × seven days × 3,200 yen); maintenance costs 180,000 yen once weekly. Quality and downtime effects are hypothetical. Surplus good units are not carried to the next day and receive no terminal inventory value.

P(service≥95%)≈1N∑i=1NI(servicei≥0.95)P(\mathrm{service}\geq 95\%)\approx\frac{1}{N}\sum_{i=1}^{N} I(\mathrm{service}_i\geq0.95)

Check with Python

[IN: 8]
sim_rng = np.random.default_rng(SEED)
scenarios = {
    "Current operation": {
        "capacity": 104,
        "stop_mean": 42,
        "defect": 0.055,
        "fixed_cost": 0,
    },
    "2 hours of overtime": {
        "capacity": 114,
        "stop_mean": 42,
        "defect": 0.058,
        "fixed_cost": 44_800,
    },
    "preventive maintenance": {
        "capacity": 104,
        "stop_mean": 18,
        "defect": 0.030,
        "fixed_cost": 180_000,
    },
}
sim_rows = []
for scenario, p in scenarios.items():
    for run in range(2_000):
        demand = np.rint(sim_rng.normal(99, 11, size=7).clip(60)).astype(int)
        stop = sim_rng.normal(p["stop_mean"], 9, size=7).clip(0, 120)
        gross = np.floor(p["capacity"] * (1 - stop / 480)).astype(int)
        good = sim_rng.binomial(gross, 1 - p["defect"])
        shipped = np.minimum(good, demand)
        service = shipped.sum() / demand.sum()
        # Charge materials for every unit produced, including defects and surplus.
        contribution = shipped.sum() * 14_800 - gross.sum() * 7_600 - p["fixed_cost"]
        sim_rows.append([scenario, run, service, contribution])
sim = pd.DataFrame(
    sim_rows, columns=["scenario", "run", "service_rate", "contribution_yen"]
)
sim_summary = sim.groupby("scenario").agg(
    **{
        "mean_fill_rate": ("service_rate", "mean"),
        "fulfillment_rate_5th_percentile": ("service_rate", lambda x: x.quantile(0.05)),
        "probability_service_at_least_95pct": (
            "service_rate",
            lambda x: (x >= 0.95).mean(),
        ),
        "mean_contribution_yen": ("contribution_yen", "mean"),
    }
)
display(sim_summary)

fig, ax = plt.subplots(figsize=(8, 4))
for name, group in sim.groupby("scenario"):
    ax.hist(group["service_rate"], bins=28, alpha=0.45, label=name)
ax.axvline(0.95, color="black", linestyle="--", label="95% service target")
ax.set_title("Demand fulfillment rate simulation for the following week")
ax.set_xlabel("Demand fill rate")
ax.set_ylabel("Number of trials")
ax.grid(alpha=0.3)
ax.legend()
plt.tight_layout()
plt.show()
[OUT: 8]
mean_fill_rate fulfillment_rate_5th_percentile probability_service_at_least_95pct mean_contribution_yen
scenario
2 hours of overtime 0.95 0.90 0.48 4,157,541.00
Current operation 0.89 0.84 0.03 4,096,103.60
preventive maintenance 0.94 0.90 0.43 4,165,961.40

No.096: Simulation Platform — Comparing Proposals Based on Result Distribution Rather Than Average: result chart

Interpreting the Results

Both maintenance and overtime improve target achievement over current operation. Here overtime has the highest simulated probability of reaching 95% service (48.25%), while maintenance has a slightly higher mean contribution. Neither reaches the service target in most trials. Compare the lower service quantile, costs, and omitted operational constraints before selecting a plan.

No.097: Optimization Foundation — Balancing Profit and Delivery While Meeting Constraints

Practical Purpose

While simulation evaluates the results of candidates, optimization searches for good ideas from many combinations. On site, rather than a ‘mathematical optimal solution,’ it is important to have a plan that can be explained and corrected to meet actual constraints such as capacity, demand, minimum supply, contracts, arrangements, and personnel.

Method and Assumptions

Enumerate quantities xpx_p in increments of ten, with xpx_p measured in units. Maximize contribution under 720 processing minutes, product demand caps, and at least 60 units of P-C.

max⁡x∑pmpxps.t.∑ptpxp≤720,0≤xp≤dp,xP−C≥60,xp∈{0,10,20,…}.\begin{aligned} \max_x\quad &\sum_p m_p x_p\\ \mathrm{s.t.}\quad &\sum_p t_p x_p\le720,\\ &0\le x_p\le d_p,\quad x_{\mathrm{P-C}}\ge60,\\ &x_p\in\{0,10,20,\ldots\}. \end{aligned}

Check with Python

[IN: 9]
planning = pd.DataFrame(
    {
        "product_id": ["P-A", "P-B", "P-C"],
        "demand": [100, 90, 80],
        "minutes_per_unit": [2.1, 2.8, 3.6],
        "margin_per_unit": [4300, 5400, 7200],
    }
)

candidates = []
for a in range(0, 101, 10):
    for b in range(0, 91, 10):
        for c in range(60, 81, 10):
            qty = np.array([a, b, c])
            used = float(qty @ planning["minutes_per_unit"].to_numpy())
            if used <= 720:
                margin = int(qty @ planning["margin_per_unit"].to_numpy())
                candidates.append([a, b, c, used, 720 - used, margin])
plans = pd.DataFrame(
    candidates,
    columns=[
        "P-A",
        "P-B",
        "P-C",
        "portion used",
        "spare_minutes",
        "contribution_yen",
    ],
)
best_plans = plans.sort_values(
    ["contribution_yen", "spare_minutes"], ascending=[False, True]
).head(8)
display(best_plans)

fig, ax = plt.subplots(figsize=(8, 4))
ax.scatter(
    plans["portion used"],
    plans["contribution_yen"] / 10_000,
    alpha=0.25,
    label="Feasible plan",
)
best = best_plans.iloc[0]
ax.scatter(
    best["portion used"],
    best["contribution_yen"] / 10_000,
    color="red",
    s=90,
    label="best plan",
)
ax.set_title("Feasible production plans and contribution margin")
ax.set_xlabel("Usage time consumed (minutes)")
ax.set_ylabel("Contribution margin (10,000 yen)")
ax.grid(alpha=0.3)
ax.legend()
plt.tight_layout()
plt.show()
[OUT: 9]
P-A P-B P-C portion used spare_minutes contribution_yen
326 100 90 70 714.00 6.00 1420000
269 80 90 80 708.00 12.00 1406000
296 90 80 80 701.00 19.00 1395000
322 100 70 80 694.00 26.00 1384000
298 90 90 70 693.00 27.00 1377000
324 100 80 70 686.00 34.00 1366000
239 70 90 80 687.00 33.00 1363000
266 80 80 80 680.00 40.00 1352000

No.097: Optimization Foundation — Balancing Profit and Delivery While Meeting Constraints: result chart

Interpreting the Results

By leaving not only optimal proposals but also higher-level ones, the field can reflect factors outside the model, such as planning and the skills of the person in charge. The practical platform stores input snapshots, constraints, objective functions, solver versions, adoption proposals, and manual revision reasons. If the optimization returns an unexecutable result, it does not silently remove the constraints and presents which constraint mitigations are needed.

No.098: Leveraging AI Agents — Connecting Analysis Results to Secure Proposals and Approvals

Practical Purpose

AI agents can monitor KPIs, collect potential causes, run simulations, and summarize recommendations. However, because automatically executing equipment shutdowns or ordering can have significant impact, permission boundaries, rationale, approvals, and audit logs are essential.

Method and Assumptions

Fixed rules, without an external LLM, combine KPIs and simulations into a proposal log: trigger, evidence, scenario, simulated target-achievement probability, and reviewers. This probability does not measure model validity or confidence in a recommendation. The example only reads results and prepares a proposal.

Check with Python

[IN: 10]
l3 = kpi.loc["L3"]
recommended_scenario = sim_summary["probability_service_at_least_95pct"].idxmax()
target_probability = float(
    sim_summary.loc[recommended_scenario, "probability_service_at_least_95pct"]
)

agent_log = pd.DataFrame(
    [
        {
            "agent_run_id": "AGENT-20250331-001",
            "Detection": "L3 KPIHealth level90less than a point",
            "basis": f"OTD={l3 ['On-time delivery rate']:.1%}, defect_rate={l3 ['defect_rate']:.1%}, stop rate={l3 ['stop rate']:.1%}",
            "proposal": f"{recommended_scenario }: prepare an implementation plan",
            "Target achievement probability": target_probability,
            "automatic execution": False,
            "Required approval": "Manufacturing Section Manager / Security Section Manager",
            "Reference Model": "weekly-simulation:v1.0",
        }
    ]
)
display(agent_log.T.rename(columns={0: "value"}))

guardrails = pd.DataFrame(
    {
        "operation": [
            "KPIReading",
            "Cause Candidate Search",
            "Simulation Execution",
            "Issuance of Maintenance Orders",
            "equipment shutdown",
        ],
        "Agent Privileges": [
            "permission",
            "permission",
            "permission",
            "After approval",
            "prohibit",
        ],
    }
)
display(guardrails)
[OUT: 10]
value
agent_run_id AGENT-20250331-001
Detection L3 KPIHealth level90less than a point
basis OTD=94.3%, defect_rate=5.6%, stop rate=8.5%
proposal 2 hours of overtime: prepare an implementation...
Target achievement probability 0.48
automatic execution False
Required approval Manufacturing Section Manager / Security Secti...
Reference Model weekly-simulation:v1.0
operation Agent Privileges
0 KPIReading permission
1 Cause Candidate Search permission
2 Simulation Execution permission
3 Issuance of Maintenance Orders After approval
4 equipment shutdown prohibit

Interpreting the Results

The proposal log records L3’s missed targets, evidence, model reference, and recommendation. The permission table illustrates a design; this code does not enforce access control or approvals. Production services must implement permission checks, approval gates, limits, and execution logs.

No.099: Designing Palantir for Manufacturing — Integrating Data, Models, and Business Objects

Practical Purpose

If the analytics platform, simulation, and workflow are separate, proposals are transcribed to emails or spreadsheets, and execution results do not return to the model. Here, the “manufacturing version of Palantir” refers not to imitating specific products, but to a design philosophy that consistently connects data, semantic layers, models, decision-making, and business actions.

Method and Assumptions

A DecisionCase links the line, KPI issue, evidence, model run, options, approval, action, and effect. In the formula, V,F,R,KV,F,R,K are one-to-five ratings of value, feasibility, reusability, and risk. Weights are illustrative; higher risk reduces priority.

Priority=0.40V+0.25F+0.20R−0.15K\mathrm{Priority}=0.40V+0.25F+0.20R-0.15K

Check with Python

[IN: 11]
use_cases = pd.DataFrame(
    {
        "use_cases": [
            "Delivery recovery",
            "Predictive maintenance",
            "Quality settings",
            "Inventory replenishment",
            "Energy Optimization",
        ],
        "value": [5, 5, 4, 4, 3],
        "feasibility": [5, 3, 4, 4, 3],
        "reusability": [5, 4, 4, 3, 3],
        "Risks": [2, 3, 4, 2, 3],
    }
)
use_cases["priority"] = (
    0.40 * use_cases["value"]
    + 0.25 * use_cases["feasibility"]
    + 0.20 * use_cases["reusability"]
    - 0.15 * use_cases["Risks"]
)
display(use_cases.sort_values("priority", ascending=False))

fig, ax = plt.subplots(figsize=(8, 5))
scatter = ax.scatter(
    use_cases["feasibility"],
    use_cases["value"],
    s=use_cases["reusability"] * 180,
    c=use_cases["Risks"],
    cmap="YlOrRd",
    alpha=0.75,
)
for row in use_cases.itertuples(index=False):
    ax.annotate(
        row.use_cases,
        (row.feasibility, row.value),
        xytext=(5, -20) if row.use_cases == "Inventory replenishment" else (5, 8),
        textcoords="offset points",
        fontsize=8,
    )
ax.set_title("DI use-case value, feasibility, and reusability")
ax.set_xlabel("Feasibility (1–5 scale)")
ax.set_ylabel("Value (1–5 scale)")
ax.set_xlim(2.5, 5.5)
ax.set_ylim(2.5, 5.5)
ax.grid(alpha=0.3)
plt.colorbar(scatter, ax=ax, label="Risks (1–5 scale)")
plt.tight_layout()
plt.show()
[OUT: 11]
use_cases value feasibility reusability Risks priority
0 Delivery recovery 5 5 5 2 3.95
1 Predictive maintenance 5 3 4 3 3.10
3 Inventory replenishment 4 4 3 2 2.90
2 Quality settings 4 4 4 4 2.80
4 Energy Optimization 3 3 3 3 2.10

No.099: Designing Palantir for Manufacturing — Integrating Data, Models, and Business Objects: result chart

Interpreting the Results

Recovery on delivery dates offers high value, feasibility, and reusability, making it suitable as the first Decision Case. Parts such as lines, products, KPIs, simulations, and approvals maintained here can be reused for predictive maintenance and inventory replenishment. Rather than collecting company-wide data first, it is realistic to make a single high-frequency decision closed-loop and increase common components.

No.100: The World Surikobo Aims For — Toward a Factory Where Decision-Making Continuously Learns

Practical Purpose

Combine operational knowledge with data, statistics, simulation, and optimization so staff can make timely decisions and assess their exposure to variation. Feed execution results back into the models and operating rules.

Method and Assumptions

Maturity is considered at the stages of visualization, common KPIs, diagnosis, scenario comparison, optimization, and semi-automated execution. Value is measured not only by increasing sales but also by shortening decision-making time, reducing out-of-stock, defects, and stoppages, and minimizing dependence. Here, we present a hypothetical roadmap in which as DI maturity increases, losses from missed deliveries and judgment man-hours decrease.

Check with Python

[IN: 12]
roadmap = pd.DataFrame(
    {
        "stage": [
            "Current Status",
            "commonKPI",
            "Exploring the Causes",
            "Scenario Comparison",
            "Optimized Integration",
            "Execution with Approval",
        ],
        "DImaturity": [0, 1, 2, 3, 4, 5],
        "monthly_assessment_hours_h": [180, 145, 110, 78, 58, 42],
        "monthly_opportunity_loss_ten_thousand_yen": [920, 780, 610, 460, 350, 280],
        "accumulated_investment_ten_thousand_yen": [0, 180, 420, 760, 1180, 1650],
    }
)
roadmap["monthly_improvement_amount_ten_thousand_yen"] = (
    roadmap.loc[0, "monthly_opportunity_loss_ten_thousand_yen"]
    - roadmap["monthly_opportunity_loss_ten_thousand_yen"]
)
roadmap["Simple Collection Months"] = np.where(
    roadmap["monthly_improvement_amount_ten_thousand_yen"] > 0,
    roadmap["accumulated_investment_ten_thousand_yen"]
    / roadmap["monthly_improvement_amount_ten_thousand_yen"],
    np.nan,
)
display(roadmap)

fig, ax1 = plt.subplots(figsize=(9, 4.5))
ax1.plot(
    roadmap["stage"],
    roadmap["monthly_assessment_hours_h"],
    marker="o",
    color="#2a6fbb",
    label="Judgment time",
)
ax1.set_title("Illustrative DI roadmap and assumed benefits")
ax1.set_xlabel("Implementation Phase")
ax1.set_ylabel("Monthly Assessment Time (hours)", color="#2a6fbb")
ax1.tick_params(axis="x", rotation=20)
ax1.grid(alpha=0.3)
ax2 = ax1.twinx()
ax2.plot(
    roadmap["stage"],
    roadmap["monthly_opportunity_loss_ten_thousand_yen"],
    marker="s",
    color="#d95f02",
    label="Missed opportunity",
)
ax2.set_ylabel("Monthly opportunity loss (10,000 yen)", color="#d95f02")
lines1, labels1 = ax1.get_legend_handles_labels()
lines2, labels2 = ax2.get_legend_handles_labels()
ax1.legend(lines1 + lines2, labels1 + labels2, loc="best")
plt.tight_layout()
plt.show()
[OUT: 12]
stage DImaturity monthly_assessment_hours_h monthly_opportunity_loss_ten_thousand_yen accumulated_investment_ten_thousand_yen monthly_improvement_amount_ten_thousand_yen Simple Collection Months
0 Current Status 0 180 920 0 0 NaN
1 commonKPI 1 145 780 180 140 1.29
2 Exploring the Causes 2 110 610 420 310 1.35
3 Scenario Comparison 3 78 460 760 460 1.65
4 Optimized Integration 4 58 350 1180 570 2.07
5 Execution with Approval 5 42 280 1650 640 2.58

No.100: The World Surikobo Aims For — Toward a Factory Where Decision-Making Continuously Learns: result chart

Interpreting the Results

The improvements are assumed inputs, not measured results. Simple payback divides cumulative investment by continuing monthly improvement, omitting implementation time, operating costs, and discounting. Measure actual decision time and KPI changes before investing in the next stage.

Using the Results in Practice

  1. The starting point is decision-making, not data.: Decide first—who chooses, when, what, and which KPIs will evaluate the results.
  2. Define KPI meanings and granularity before model accuracy: If double counting or definitional differences between departments remain, advanced AI spreads errors more quickly.
  3. Semantic layers create reusability: Ontology and knowledge graphs allow cross-departmental reuse of equipment, quality, and delivery schedules.
  4. Simulation and optimization have different roles.: Combinations that create candidates through optimization and verify variability tolerance through simulation are effective.
  5. Include access control in agent design: The proposal can only be put into operations when the rationale, approval, execution limit, audit log, and suspension measures are all present.
  6. Measuring effectiveness in a closed loop: Revert recommendations and execution results, update models, constraints, and business rules.

Operational Requirements

1. Choose one decision item

Rather than broad themes like “factory DX,” select projects with clear responsibilities, frequency, options, and deadlines, such as “decide on a delivery recovery plan every morning within 30 minutes.”

2. Establish data contracts and KPI ledgers

Manage primary keys, granularity, units, missing items, update times, responsible persons, calculation formulas, and target values. If input quality falls below the standard, a mechanism is also needed to stop model execution.

3. Design model operations and business operations simultaneously

It determines not only the accuracy, version, and reproducibility of the model, but also who reviews proposals, how to make corrections in case of exceptions, and who approves them. Record adoption rates, reasons for overwriting, and effectiveness of implementation.

4. Incorporate Security and Safety

We prepare for minimum privileges, separation of duties, operation logs, approval limits, protection of personal information and trade secrets, manual operation during failures, and rollbacks. Direct operation with OT requires a validation environment and phased authorization.

5. Measure effectiveness comparably

Decide time, OTD, defect rate, downtime time, and profit before implementation are saved as baselines and compared to post-implementation. We also consider seasonality and differences in demand structure, and avoid overestimating based on mere before-and-after comparisons.

Conclusion

From No.091 to No.100, manufacturing DI is viewed not merely as visualization or AI implementation, but as a business foundation centered on decision-making. Using hypothetical data, we reviewed KPI design, data models, ontologies, knowledge graphs, simulations, optimization, AI agents, integrated architecture, and a maturity roadmap in a single flow.

If you want to start small, choose one decision that is frequent and high-value, establish common KPIs and data contracts, and record everything from proposal to approval and execution results. This closed loop forms the intelligence foundation for manufacturing, which can be reused for the next use case.

Consulting Services

At Surikobo, you can consult on everything from planning decision-making infrastructure in manufacturing—including KPI and data model design, demand, quality, and equipment analysis, simulation/mathematical optimization, knowledge graphs, and AI agents—to PoC, business implementation, and support for internal teams.

Even at stages like “We have data but it doesn’t lead to decisions,” “We want to embed individual PoCs into our operations,” or “We want to continue running simulations and optimizations on-site,” we support you from organizing the decisions you need to make.

📩 Contact Us: www.surikobo.co.jp/contact
Please feel free to consult us first.