An Analytics Story

How an Autonomous Agent Turns Fragmented Data Into Intelligent Deal Recommendations

Across five enterprise systems, 100 active opportunities, and 227 governance flags — a machine reads what humans miss. This is the story of a deal structuring engine built to surface risk, enforce compliance, and recommend the right offer, every time.

February 2026 · Deal Structuring Analytics

Chapter I

The Problem: Death by a Thousand Spreadsheets

Enterprise deal desks sit atop a mountain of disconnected data — and most of it never gets read.

Every quarter, commercial operations teams across the medical device and diagnostics industry face the same ritual: a deal arrives, a sales representative submits a discount request, and somewhere between the CRM, the ERP, the installed base registry, the contract archive, and the service log — the truth gets lost.

The information exists. It always does. Buried inside SAP pricing masters that haven't been updated since the last fiscal year. Hidden in contract end-dates that expired six months ago but still show "Active" in the system. Scattered across utilization indices that scream "this customer barely uses the instrument they have — why are we quoting them a second one?"

The typical deal desk analyst has 10 minutes per opportunity. At 100 opportunities per quarter, that's roughly 17 hours of work crammed into a process where a single overlooked flag — a deprecated SKU, a currency mismatch between CRM and ERP, a margin that dips below the regional floor — can cost the organization hundreds of thousands of euros in unrecoverable margin leakage.

This project asked a pointed question: What if an autonomous agent could read every table, enforce every rule, and generate every recommendation — before the analyst even opens the file?

Chapter II

Five Tables. One Hundred Customers. Zero Mercy.

The engine ingests data from five distinct enterprise sources — each representing a different dimension of the commercial relationship.

5
Source Tables
100
Opportunities
100
Contracts
9
Regions
6
Customer Segments

The dataset mirrors the operational reality of a mid-sized diagnostics commercial operation spanning the United States, Germany, the United Kingdom, France, Spain, Canada, the Netherlands, Italy, and Switzerland.

Source Data Architecture

Table Records Key Fields System of Origin Purpose
Opportunities 100 OPP ID, Customer, SKU, Discount %, Stage CRM (Salesforce) Active pipeline with pricing requests
SAP Pricing 100 SKU, List Price, Standard Cost, Deprecated Flag ERP (SAP) Official pricing & cost basis
Installed Base 100 Customer ID, SKU, Install Year, Utilization Index Asset Registry What the customer already owns
Contracts 100 Contract ID, Start/End Date, Status, Service Level Contract Management Service agreement status
Service Cases 100 Case ID, Cases/12m, Resolution Days, SLA Breach % Service Desk Instrument reliability & support history

Each table is loaded, cross-referenced, and normalized at ingestion. The opportunities table holds the sales pipeline — SKUs being quoted, discount levels being requested, contract term lengths, and competitive pressure signals. It is then joined to the SAP pricing master to derive instrument-level economics: list price, standard cost, and the net price after discounting.

But the real power emerges when you cross tables. A customer requesting a 24% instrument discount might seem acceptable in isolation. But cross-reference against their installed base — a DX-Legacy instrument from 2018 with a utilization index of 0.11 — and a different picture emerges. Or check their contract: end-date three months ago, still marked "Active." Ghost contracts. The kind of data debt that compounds silently until a CFO asks why projected margins never materialize.

Chapter III

The Engine: Seven Stages of Autonomous Analysis

From raw CSV to executive-ready approval packet in under three seconds.

Ingest
Load 5 CSVs from enterprise systems
Normalize
Clean, validate, produce Parquet snapshots
Economics
Derive baseline revenue, cost, and margin
Scenarios
Generate 3 structured offers per deal
Governance
Apply 8+ rules, flag violations
Risk & Recommend
Score risk, select best scenario
Deliver
Produce approval packets & UI summary

Stage one is deceptively simple: read five CSV files. But what happens next is where the intelligence lives. The engine joins the opportunities table against SAP pricing to construct baseline economics — instrument revenue (after discounting), consumables revenue (projected annually over the contract term), and service revenue. A total cost basis is derived from standard costs, consumable cost ratios, and service delivery costs.

With the economics established, the engine generates exactly three deal scenarios for each of the 100 opportunities — 300 scenarios in total:

Scenario Generation Logic

Scenario Strategy Discount Approach Term Objective
A — Win Now Aggressive Requested + 5% additional Same as requested Maximize win probability
B — Balanced Moderate Requested discount, 10% service reduction Same as requested Balance margin and competitiveness
C — Value-Based Conservative Requested − 5%, 20% service reduction +1 year extension Maximize lifetime profit

Each scenario is then evaluated against a configurable set of governance rules. The engine operates like a compliance analyst with perfect memory — it never forgets to check, never overlooks a field, never gets tired at opportunity number 87.

Chapter IV

The Governance Gauntlet: 227 Flags Across 100 Deals

Every opportunity is evaluated against eight rule families — from margin floors to expired contracts.

8
RED Flags
119
AMBER Flags
100
GREEN (Compliant)
227
Total Issues Logged

Governance Rules Engine

Rule ID Severity Description Threshold Recommended Action
R_MISSING_COST RED Standard cost missing from SAP master Must be > 0 Update SAP master data
R_NEG_MARGIN RED Deal produces negative gross margin Must be > 0% Reject or restructure
R_LOW_MARGIN RED Margin below regional floor 33–36% by region Increase price or bundle
R_HIGH_DISC RED Discount exceeds hard cap of 30% ≤ 30% Require CFO approval
R_MED_DISC AMBER Discount between 20–30% ≤ 20% Require VP approval
R_DEPRECATED_SKU AMBER Opportunity references a deprecated product Must not be deprecated Suggest current model upgrade
R_CURR_MISMATCH AMBER Currency differs between CRM and ERP Must match Align currencies before quoting
R_EXPIRED_ACTIVE AMBER Contract past end date but marked Active Active date must be future Close out or renew in CRM

The governance engine is the heart of the system. It evaluates every opportunity against eight distinct rule families, cross-referencing data across all five source tables. Regional margin floors are not uniform — the European Union floor is 33%, the US floor is 36%. A deal that passes in the Netherlands may fail in New York.

Consider a deal where a sales representative requests a 24% instrument discount. Rule R_MED_DISC flags this as AMBER — the discount exceeds the 20% threshold for standard authority. The approval now routes to the VP of Sales. But the same opportunity also references a SKU marked as deprecated in the SAP pricing master — R_DEPRECATED_SKU fires, adding a second AMBER flag. And when the engine cross-references the CRM quote currency (CAD) against the SAP master currency (EUR), a third flag emerges: R_CURR_MISMATCH.

Each rule evaluation generates an entry in the immutable audit trail — a JSONL file containing the rule ID, the input values at evaluation time, and a UUID-stamped timestamp. If a regulator, an auditor, or a deal desk manager asks "why was this deal flagged?" — the answer is traceable to the exact data point, rule, and moment.

The engine doesn't just flag problems. It explains them, traces them, and tells you exactly what to do about each one.
Chapter V

The Recommendation: Machine Judgment at Scale

For each opportunity, the engine selects the optimal scenario — or escalates when no compliant path exists.

300
Scenarios Evaluated
100
Recommendations Made
90%
Avg Confidence Score

The recommendation engine follows a precise decision hierarchy. First, it filters the three scenarios to identify which ones are compliant — meaning they don't trigger any RED-level governance violations. RED violations include negative margins, margins below the regional floor, and discounts exceeding the 30% hard cap.

Among compliant scenarios, the engine selects the one that maximizes lifetime gross profit — the total revenue minus total cost over the full contract term. This isn't just about margin percentage; it's about absolute economic value. A deal with a 36% margin on €1.2M of revenue is worth more than a 48% margin on €200K.

When no scenario passes the compliance filter, the engine escalates. It selects the highest-margin option available and marks the recommendation with escalation_required: true. These deals require CFO or executive sign-off and are routed accordingly through the approval workflow.

Case Study: The Margin Floor Flip

OPP-2000 — HealthCenter 0 (Netherlands)

Scenario A offers the highest win probability — the most aggressive discount, the shortest path to a signed contract. But at a 10.0% gross margin, it craters below the EU floor of 33%. The engine rejects Scenario A and recommends Scenario B instead: a balanced approach yielding 36.3% margin and €245.6K in lifetime gross profit. Three AMBER flags remain (high discount, deprecated SKU, currency mismatch), but the deal is compliant and routes to VP Sales for approval.

"Scenario A provides highest win probability but violates margin floor policy. Scenario B recommended instead to maintain compliance."

Chapter VI

Risk Scoring: Three Dimensions of Deal Health

Every deal is scored across win probability, margin integrity, and compliance posture.

The risk model evaluates each opportunity across three independent dimensions:

Risk Dimensions

Dimension Inputs Low Medium High
Win Risk Competitor pressure + discount depth Score < 3 Score 3–5 Score ≥ 6
Margin Risk Baseline gross margin % ≥ 45% 35–45% < 35%
Compliance Risk Count of RED-severity issues Zero RED flags Any RED flag

The win risk score captures competitive dynamics. A deal facing "High" competitor pressure with a discount below 10% is at maximum risk of being lost — the customer has alternatives and we aren't pricing to win. The margin risk dimension ensures that even winnable deals maintain economic viability. And compliance risk serves as the hard stop: any deal with a RED-level governance violation is immediately flagged for escalation regardless of its commercial attractiveness.

Chapter VII

The Outputs: From Data to Decision

The engine produces 12 output artifacts — from normalized data snapshots to executive-ready approval packets.

Output Artifacts

Artifact Format Description
normalized_*.parquet Parquet × 5 Cleaned, validated snapshots of all 5 source tables
scenarios.csv CSV (300 rows) 3 structured deal scenarios per opportunity
issues_log.csv CSV (227 rows) Every governance flag with severity, rule, and action
opportunity_risk_scores.csv CSV (100 rows) Win, margin, and compliance risk per deal
recommended_offer.csv CSV (100 rows) Best scenario selection with rationale
approval_packets.jsonl JSONL Complete approval-ready packet per deal
audit_trail.jsonl JSONL Immutable log of every rule evaluation
ui_summary.json JSON Pre-rendered summary powering this dashboard

The final enrichment layer adds executive-narrative summaries to every deal. For deals where an LLM is available, the narrative is generated by a language model prompted with the full deal context. When running offline, a deterministic template engine produces equally precise summaries — calculating currency-appropriate profit figures, referencing specific rule violations, and articulating exactly why one scenario was chosen over another.

The confidence score reflects the engine's own assessment of recommendation quality: deals with no red flags and margins above the floor score 90%. Deals requiring escalation score 45%. The score is visible in the dashboard, giving deal desk managers an immediate signal of which deals need human attention.

Chapter VIII

The Interface: Where Data Becomes Action

A single-page dashboard surfaces every insight, every flag, every recommendation — with full traceability to source.

The dashboard is designed for the analyst who has 30 seconds, not 30 minutes. Each opportunity appears as a card showing the customer name, region, and risk posture at a glance. Clicking "Run Scenario" triggers the agent orchestrator — a live visualization showing the AI system's decision flow in real time.

The orchestrator is problem-driven, not fixed. A central planner analyzes the deal and selects only the tools and agents needed for that specific case. Available data extractors pull from five source tables (opportunities, SAP pricing, installed base, contracts, service cases). Available analytical agents include a Pricing & Scenarios Agent (baseline economics and three offer structures), a Compliance & Governance Agent (margin floors, discount caps, SKU and currency checks), a Risk Scoring Agent (win, margin, and compliance risk), and a Recommendation Agent (optimal compliant scenario or escalation). The planner chooses a minimal set — for example, a straightforward deal might need fewer steps than one with multiple flags. Selected tools run first; then the chosen agents run in parallel. Their outputs converge in a guardrails check and a final synthesizer that produces the unified recommendation.

Below the orchestrator, the full deal dashboard unfolds: metric cards showing complexity status and confidence scores. A scenario comparison table with margin percentages and lifetime profit projections. An issues summary with severity-coded flags and actionable remediation steps. And an executive narrative that reads like a deal memo, not a data dump.

Every insight links back to the audit trail. Every recommendation can be traced to the exact governance rule, the exact data field, the exact value that triggered the decision. This is not a black box — it is a glass box.

One hundred deals. Five source systems. Three hundred scenarios. Two hundred twenty-seven governance flags. Zero human readings missed. This is what autonomous deal intelligence looks like.
Chapter IX

What This Means

The implications for commercial operations, regulatory compliance, and enterprise AI adoption.

This engine is not a prototype. It is a working system that ingests real-world data structures, applies enterprise-grade governance rules, and produces auditable, explainable recommendations at scale. It demonstrates three capabilities that are typically discussed in theory but rarely shown in practice:

1. Cross-system data reconciliation. The engine doesn't just read one table — it cross-references five. Currency mismatches between CRM and ERP, deprecated SKUs still being quoted, contracts that expired months ago — these are the kinds of issues that live in the gaps between systems. The engine finds them because it reads everything.

2. Policy-aware recommendation. The engine doesn't simply maximize revenue. It recommends the best compliant scenario — respecting regional margin floors, discount authority limits, and tender regulations. When no compliant path exists, it escalates transparently and explains why.

3. Full audit traceability. Every decision is traceable. Every flag is explainable. Every recommendation links to the specific data value, governance rule, and timestamp that produced it. In regulated industries — medical devices, pharmaceuticals, financial services — this is not a nice-to-have. It is a requirement.

The gap between "data-driven organization" and "organization that actually uses its data" remains enormous. Most enterprises have more data than they know what to do with. The problem was never access — it was comprehension. An autonomous agent that can read, reconcile, evaluate, and explain reduces that gap from months to seconds.