{
  "nbformat": 4,
  "nbformat_minor": 5,
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.13.0"
    },
    "blog_metadata": {
      "topic": "The best enterprise AI case studies aren’t about chat — they’re about decision velocity under uncertainty",
      "slug": "the-best-enterprise-ai-case-studies-aren-t-about-chat-they-r",
      "generated_by": "LinkedIn Post Generator + Azure OpenAI",
      "generated_at": "2026-09-23T00:42:54.493Z"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# The best enterprise AI case studies aren’t about chat — they’re about decision velocity under uncertainty\n",
        "\n",
        "This notebook turns the article into a hands-on validation workflow. The focus is not conversational UX, but how teams ingest disruption signals, assemble evidence, apply policy, route decisions, and measure outcomes under uncertainty.\n",
        "\n",
        "You can run each section independently to explore ranking, routing, escalation, and feedback patterns that make enterprise AI governable."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "%pip install pandas matplotlib"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "from dataclasses import dataclass, asdict\n",
        "from statistics import mean\n",
        "import json\n",
        "import pandas as pd\n",
        "import matplotlib.pyplot as plt"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Context and operating pattern\n",
        "\n",
        "The article argues that strong enterprise AI case studies center on decision-ready workflows. A practical pattern is: ingest disruption signals, normalize them against operational data, score uncertainty and impact, assemble an evidence pack, apply policy thresholds, route low-risk cases automatically, escalate high-risk cases to a human, and log outcomes for improvement.\n",
        "\n",
        "The flow below captures that operating model in notebook form."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "workflow_steps = [\n",
        "    \"Signals arrive: market, ops, compliance, customer\",\n",
        "    \"Normalize against operational data\",\n",
        "    \"Score uncertainty and impact\",\n",
        "    \"Assemble evidence pack\",\n",
        "    \"Apply policy thresholds and guardrails\",\n",
        "    \"Route to auto-execution or human review\",\n",
        "    \"Execute action\",\n",
        "    \"Capture outcome and feedback\",\n",
        "    \"Update thresholds, policies, and models\"\n",
        "]\n",
        "\n",
        "for i, step in enumerate(workflow_steps, start=1):\n",
        "    print(f\"{i}. {step}\")"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Rank decisions by expected value adjusted for uncertainty\n",
        "\n",
        "This example converts the article’s idea into a simple prioritization function. Decisions with high expected value can still rank poorly if confidence is low and blast radius is large, which reflects the article’s emphasis on accountable speed rather than raw automation."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "from dataclasses import dataclass\n",
        "\n",
        "@dataclass\n",
        "class Decision:\n",
        "    name: str\n",
        "    expected_value: float\n",
        "    confidence: float\n",
        "    blast_radius: float\n",
        "\n",
        "def priority_score(d: Decision) -> float:\n",
        "    uncertainty_penalty = (1 - d.confidence) * d.blast_radius\n",
        "    return d.expected_value - uncertainty_penalty\n",
        "\n",
        "decisions = [\n",
        "    Decision(\"reroute shipment\", 12000, 0.82, 2000),\n",
        "    Decision(\"approve refund batch\", 4000, 0.96, 500),\n",
        "    Decision(\"pause vendor\", 18000, 0.55, 9000),\n",
        "]\n",
        "\n",
        "ranked = sorted(decisions, key=priority_score, reverse=True)\n",
        "for d in ranked:\n",
        "    print(d.name, round(priority_score(d), 2))\n",
        "\n",
        "pd.DataFrame([\n",
        "    {\n",
        "        \"name\": d.name,\n",
        "        \"expected_value\": d.expected_value,\n",
        "        \"confidence\": d.confidence,\n",
        "        \"blast_radius\": d.blast_radius,\n",
        "        \"priority_score\": round(priority_score(d), 2)\n",
        "    }\n",
        "    for d in ranked\n",
        "])"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Policy gate: auto-action vs human escalation\n",
        "\n",
        "This is the core routing logic from the article. The point is not the syntax itself, but the policy intent: regulated decisions require higher confidence, high-impact decisions escalate sooner, and medium-confidence cases can request more evidence instead of forcing a bad binary choice."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "def route_decision(confidence: float, blast_radius: float, regulated: bool) -> str:\n",
        "    if regulated and confidence < 0.98:\n",
        "        return \"human_review\"\n",
        "    if blast_radius > 10000 and confidence < 0.90:\n",
        "        return \"human_review\"\n",
        "    if confidence >= 0.85:\n",
        "        return \"auto_execute\"\n",
        "    return \"request_more_evidence\"\n",
        "\n",
        "cases = [\n",
        "    {\"confidence\": 0.93, \"blast_radius\": 3000, \"regulated\": False},\n",
        "    {\"confidence\": 0.91, \"blast_radius\": 15000, \"regulated\": False},\n",
        "    {\"confidence\": 0.97, \"blast_radius\": 500, \"regulated\": True},\n",
        "]\n",
        "\n",
        "for c in cases:\n",
        "    print(c, \"=>\", route_decision(**c))\n",
        "\n",
        "pd.DataFrame([\n",
        "    {**c, \"route\": route_decision(**c)} for c in cases\n",
        "])"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Sequence simulation: signals, evidence, policy, human review, execution, outcome\n",
        "\n",
        "The article describes the handoff between AI and accountable operations as the evidence pack. This code simulates that sequence in Python by creating a small evidence service, applying policy, and recording the resulting action path."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "def build_evidence(case_id, signals, recommendation, confidence, blast_radius, regulated, assumptions, reviewer, downstream_systems):\n",
        "    return {\n",
        "        \"case_id\": case_id,\n",
        "        \"recommendation\": recommendation,\n",
        "        \"confidence\": confidence,\n",
        "        \"estimated_business_impact\": blast_radius,\n",
        "        \"triggering_signals\": signals,\n",
        "        \"assumptions_used\": assumptions,\n",
        "        \"policy_checks_applied\": {\n",
        "            \"regulated\": regulated,\n",
        "            \"high_blast_radius\": blast_radius > 10000,\n",
        "            \"confidence_threshold_for_auto\": 0.85,\n",
        "            \"confidence_threshold_for_regulated\": 0.98,\n",
        "        },\n",
        "        \"required_reviewer\": reviewer,\n",
        "        \"affected_downstream_systems\": downstream_systems,\n",
        "    }\n",
        "\n",
        "signal_event = {\n",
        "    \"case_id\": \"SC-1001\",\n",
        "    \"signals\": [\"supplier alert\", \"port delay\", \"demand spike\"],\n",
        "    \"recommendation\": \"reroute shipment\",\n",
        "    \"confidence\": 0.91,\n",
        "    \"blast_radius\": 15000,\n",
        "    \"regulated\": False,\n",
        "    \"assumptions\": [\"inventory snapshot < 30 min old\", \"alternate carrier available\"],\n",
        "    \"reviewer\": \"regional-ops-manager@company.com\",\n",
        "    \"downstream_systems\": [\"TMS\", \"ERP\", \"customer ETA service\"],\n",
        "}\n",
        "\n",
        "evidence_pack = build_evidence(\n",
        "    case_id=signal_event[\"case_id\"],\n",
        "    signals=signal_event[\"signals\"],\n",
        "    recommendation=signal_event[\"recommendation\"],\n",
        "    confidence=signal_event[\"confidence\"],\n",
        "    blast_radius=signal_event[\"blast_radius\"],\n",
        "    regulated=signal_event[\"regulated\"],\n",
        "    assumptions=signal_event[\"assumptions\"],\n",
        "    reviewer=signal_event[\"reviewer\"],\n",
        "    downstream_systems=signal_event[\"downstream_systems\"],\n",
        ")\n",
        "\n",
        "route = route_decision(\n",
        "    confidence=evidence_pack[\"confidence\"],\n",
        "    blast_radius=evidence_pack[\"estimated_business_impact\"],\n",
        "    regulated=evidence_pack[\"policy_checks_applied\"][\"regulated\"],\n",
        ")\n",
        "\n",
        "execution_record = {\n",
        "    \"case_id\": evidence_pack[\"case_id\"],\n",
        "    \"route\": route,\n",
        "    \"executed\": route == \"auto_execute\",\n",
        "    \"human_required\": route == \"human_review\",\n",
        "    \"outcome_logged\": True,\n",
        "}\n",
        "\n",
        "print(\"Evidence Pack:\")\n",
        "print(json.dumps(evidence_pack, indent=2))\n",
        "print(\"\\nExecution Record:\")\n",
        "print(json.dumps(execution_record, indent=2))"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Compute a simple decision velocity KPI in Python\n",
        "\n",
        "The original article included a PowerShell example for average decision latency. Here it is translated into Python so the notebook stays in one language and lets you validate the core KPI directly: time from signal to decision."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "items = [\n",
        "    {\"Id\": 1, \"Created\": pd.Timestamp(\"2026-09-23T09:00:00\"), \"Resolved\": pd.Timestamp(\"2026-09-23T09:07:00\")},\n",
        "    {\"Id\": 2, \"Created\": pd.Timestamp(\"2026-09-23T09:02:00\"), \"Resolved\": pd.Timestamp(\"2026-09-23T09:20:00\")},\n",
        "    {\"Id\": 3, \"Created\": pd.Timestamp(\"2026-09-23T09:05:00\"), \"Resolved\": pd.Timestamp(\"2026-09-23T09:09:00\")},\n",
        "]\n",
        "\n",
        "df_latency = pd.DataFrame(items)\n",
        "df_latency[\"decision_latency_min\"] = (df_latency[\"Resolved\"] - df_latency[\"Created\"]).dt.total_seconds() / 60\n",
        "\n",
        "avg_latency = df_latency[\"decision_latency_min\"].mean()\n",
        "print(f\"Average decision latency (min): {avg_latency:.2f}\")\n",
        "df_latency"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Trigger escalation when uncertainty rises faster than throughput falls\n",
        "\n",
        "This example mirrors the article’s stress signal. It shows how an operations leader can monitor whether the workflow is staying safe and effective under pressure, rather than asking whether users liked the assistant."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "from statistics import mean\n",
        "\n",
        "uncertainty = [0.22, 0.28, 0.31, 0.45, 0.52]\n",
        "throughput = [120, 118, 117, 110, 108]\n",
        "\n",
        "uncertainty_trend = uncertainty[-1] - uncertainty[0]\n",
        "throughput_drop = throughput[0] - throughput[-1]\n",
        "\n",
        "if uncertainty_trend > 0.20 and throughput_drop > 10:\n",
        "    action = \"open_war_room\"\n",
        "elif uncertainty_trend > 0.10:\n",
        "    action = \"tighten_thresholds\"\n",
        "else:\n",
        "    action = \"continue_normal_ops\"\n",
        "\n",
        "print(\"avg_uncertainty=\", round(mean(uncertainty), 2))\n",
        "print(\"throughput_drop=\", throughput_drop)\n",
        "print(\"recommended_action=\", action)\n",
        "\n",
        "stress_df = pd.DataFrame({\"step\": list(range(1, len(uncertainty) + 1)), \"uncertainty\": uncertainty, \"throughput\": throughput})\n",
        "stress_df"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Visualize the stress signal\n",
        "\n",
        "A quick chart makes the pattern easier to inspect. Rising uncertainty combined with falling throughput is a useful operational warning that thresholds, staffing, or escalation posture may need to change."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "fig, ax1 = plt.subplots(figsize=(8, 4))\n",
        "\n",
        "ax1.plot(stress_df[\"step\"], stress_df[\"uncertainty\"], marker=\"o\", label=\"Uncertainty\")\n",
        "ax1.set_xlabel(\"Observation\")\n",
        "ax1.set_ylabel(\"Uncertainty\")\n",
        "ax1.set_ylim(0, max(stress_df[\"uncertainty\"]) + 0.1)\n",
        "\n",
        "ax2 = ax1.twinx()\n",
        "ax2.plot(stress_df[\"step\"], stress_df[\"throughput\"], marker=\"s\", linestyle=\"--\", label=\"Throughput\", color=\"orange\")\n",
        "ax2.set_ylabel(\"Throughput\")\n",
        "\n",
        "plt.title(\"Rising uncertainty vs falling throughput\")\n",
        "plt.tight_layout()\n",
        "plt.show()"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Build an evidence pack for a human-in-the-loop decision\n",
        "\n",
        "The article says trust depends on the quality of the evidence pack. This Python version of the original PowerShell example creates a compact packet with recommendation, confidence, blast radius, signals, escalation status, and named reviewer."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "decision = {\n",
        "    \"CaseId\": \"INC-4821\",\n",
        "    \"Recommendation\": \"Pause supplier payouts\",\n",
        "    \"Confidence\": 0.74,\n",
        "    \"BlastRadius\": 250000,\n",
        "    \"Signals\": [\"invoice anomalies\", \"sanctions watchlist hit\", \"bank mismatch\"],\n",
        "}\n",
        "\n",
        "evidence_pack = {\n",
        "    \"Summary\": f\"{decision['Recommendation']} for {decision['CaseId']}\",\n",
        "    \"Escalate\": (decision[\"Confidence\"] < 0.85 or decision[\"BlastRadius\"] > 100000),\n",
        "    \"Signals\": \"; \".join(decision[\"Signals\"]),\n",
        "    \"Reviewer\": \"risk-ops@company.com\",\n",
        "}\n",
        "\n",
        "print(json.dumps(evidence_pack, indent=2))"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Log outcomes to improve thresholds instead of optimizing for chat quality\n",
        "\n",
        "The article emphasizes that outcome logging is what makes the system improve. This example calculates a few simple metrics that help teams learn whether automation is working safely and when human review is still necessary."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "history = [\n",
        "    {\"decision\": \"reroute shipment\", \"auto\": True, \"success\": True},\n",
        "    {\"decision\": \"pause vendor\", \"auto\": False, \"success\": True},\n",
        "    {\"decision\": \"approve refund batch\", \"auto\": True, \"success\": False},\n",
        "]\n",
        "\n",
        "auto_total = sum(1 for h in history if h[\"auto\"])\n",
        "auto_success = sum(1 for h in history if h[\"auto\"] and h[\"success\"])\n",
        "human_total = sum(1 for h in history if not h[\"auto\"])\n",
        "\n",
        "metrics = {\n",
        "    \"automation_rate\": auto_total / len(history),\n",
        "    \"auto_success_rate\": auto_success / auto_total if auto_total else 0.0,\n",
        "    \"human_review_rate\": human_total / len(history),\n",
        "}\n",
        "\n",
        "for k, v in metrics.items():\n",
        "    print(k, round(v, 2))\n",
        "\n",
        "pd.DataFrame([metrics])"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Sample scorecard for decision velocity with accountability\n",
        "\n",
        "A useful case-study scorecard starts with baseline operating friction, then measures whether the intervention improves speed and safety. The key metric is decision latency with accountability, supported by human review rate, data-quality blocks, reversal rate, and service or cost impact by decision class."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "scorecard = {\n",
        "    \"baseline\": \"Disruption handling depends on spreadsheets, side conversations, and inconsistent definitions\",\n",
        "    \"intervention\": \"Standardize evidence assembly, define routing thresholds, and instrument decision timing\",\n",
        "    \"measured_outcomes\": {\n",
        "        \"time_from_signal_to_decision_min\": round(avg_latency, 2),\n",
        "        \"percent_routed_to_human_review\": round(metrics[\"human_review_rate\"] * 100, 1),\n",
        "        \"percent_blocked_by_data_quality_issues\": 12.5,\n",
        "        \"reversal_rate_after_execution\": 8.3,\n",
        "        \"service_or_cost_impact_by_decision_class\": {\n",
        "            \"reroute_shipment\": 12000,\n",
        "            \"pause_vendor\": 18000,\n",
        "            \"approve_refund_batch\": 4000\n",
        "        }\n",
        "    }\n",
        "}\n",
        "\n",
        "print(json.dumps(scorecard, indent=2))"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Lessons and executive question\n",
        "\n",
        "Key lessons from the article: chat is not the point, semantics and governance belong upstream, human review should be explicit, automation should be earned, and outcome logging is what makes the system improve.\n",
        "\n",
        "A practical executive question is not whether the interface feels conversational, but whether the team can see trusted context, compare scenarios quickly, preserve assumptions, route correctly, approve with confidence, and measure outcomes."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {},
      "source": [
        "maturity_questions = [\n",
        "    \"Can your team see trusted context quickly?\",\n",
        "    \"Can it compare scenarios under time pressure?\",\n",
        "    \"Are assumptions preserved in the evidence pack?\",\n",
        "    \"Are routing thresholds explicit and governed?\",\n",
        "    \"Are outcomes logged for feedback and tuning?\"\n",
        "]\n",
        "\n",
        "print(\"Decision-velocity maturity self-check\")\n",
        "for i, q in enumerate(maturity_questions, start=1):\n",
        "    print(f\"{i}. {q}\")\n",
        "\n",
        "print(\"\\nRate your team's decision-velocity maturity from 1 to 5.\")\n",
        "print(\"What is the one bottleneck slowing it down right now?\")"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Next Steps\n",
        "\n",
        "This notebook validated the article’s main claim: the strongest enterprise AI patterns are about governed decision workflows, not chat-first interfaces. You explored ranking under uncertainty, policy-based routing, evidence pack construction, escalation signals, latency measurement, and outcome logging.\n",
        "\n",
        "Next steps:\n",
        "1. Replace the toy inputs with real disruption, inventory, and service-level data.\n",
        "2. Externalize routing thresholds into a policy configuration layer.\n",
        "3. Add data-quality checks before evidence assembly.\n",
        "4. Track reversals and business impact over time to tune thresholds.\n",
        "5. Pilot selective automation only inside a clearly approved policy envelope."
      ]
    }
  ]
}