// EXECUTION_PIPELINE

Implementation Pipeline

Our engine handles the complexity of data movement while you focus on high-level decision logic.

PHASE_1 // Order Flattening

Transforms deeply nested JSON order line items into a flat, analyzable transactional format.

PHASE_2 // Affinity Scoring (Apriori)

Measures the exact statistical correlation between any two SKUs in your catalog.

PHASE_3 // Margin Protection

Calculates the net-profit of the combined bundle to ensure COGS don't outpace the AOV gain.

// STRATEGIC_SCENARIO

Deep Data Retrieval

How Arcli grounds AI in your exact schema to generate highly-optimized, dialect-specific execution logic.

The Engine Room: Market Basket Cross-Join

How Arcli mathematically identifies product affinities using a SQL-based Apriori approximation.

THE EXECUTIVE FILTER (ROI)

Takes the guesswork out of merchandising, allowing you to deploy cross-sells and upsells that are mathematically proven to convert.

  • Fully optimized for DuckDB SQL constraints.
  • Bypasses semantic layer hallucinations via strict schema grounding.
DuckDB SQL_COMPILE
-- Generated by Arcli AI Semantic Router
WITH order_items AS (
    SELECT order_id, sku
    FROM tenant_workspace.shopify.order_lines
),
bundle_combinations AS (
    SELECT 
        a.sku AS product_a,
        b.sku AS product_b,
        COUNT(DISTINCT a.order_id) AS times_bought_together
    FROM order_items a
    JOIN order_items b ON a.order_id = b.order_id AND a.sku < b.sku
    GROUP BY 1, 2
)
SELECT 
    product_a,
    product_b,
    times_bought_together,
    -- Simple Confidence Score Proxy
    ROUND((times_bought_together * 100.0) / 
          (SELECT COUNT(DISTINCT order_id) FROM order_items), 2) AS affinity_lift_pct
FROM bundle_combinations
WHERE times_bought_together > 50
ORDER BY times_bought_together DESC
LIMIT 10;