// EXECUTION_PIPELINE

Implementation Pipeline

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

PHASE_1 // The VIP "Whales"

Identify the top 5% driving 40% of revenue. Exclude them from generic discount ladders to protect margins.

PHASE_2 // The "At-Risk" Churners

Spot users who bought monthly but haven't purchased in 60 days. Hit them with aggressive win-back flows.

PHASE_3 // The One-Hit Wonders

Isolate buyers who purchased heavily discounted items during Black Friday and never returned.

// STRATEGIC_SCENARIO

Deep Data Retrieval

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

The Engine Room: RFM Customer Scoring

How Arcli scores every customer in your database based on behavioral transaction data.

THE EXECUTIVE FILTER (ROI)

Eliminates wasted ad spend by allowing you to suppress recent buyers and aggressively bid on high-LTV lookalike seeds.

  • Fully optimized for DuckDB SQL constraints.
  • Bypasses semantic layer hallucinations via strict schema grounding.
DuckDB SQL_COMPILE
-- Generated by Arcli AI Semantic Router
WITH customer_stats AS (
    SELECT 
        customer_id,
        email,
        MAX(created_at) AS last_order_date,
        COUNT(id) AS frequency,
        SUM(total_price) AS monetary_value
    FROM tenant_workspace.shopify.orders
    WHERE financial_status = 'paid'
    GROUP BY 1, 2
)
SELECT 
    email,
    frequency,
    monetary_value,
    DATE_DIFF('day', last_order_date, CURRENT_DATE) AS recency_days,
    CASE 
        WHEN DATE_DIFF('day', last_order_date, CURRENT_DATE) > 90 AND frequency > 3 THEN 'At-Risk VIP'
        WHEN monetary_value > 1000 THEN 'Whale'
        WHEN frequency = 1 THEN 'One-Hit Wonder'
        ELSE 'Standard'
    END AS rfm_segment
FROM customer_stats
ORDER BY monetary_value DESC;