← Back to Portfolio

🛒 Market Basket Analysis

AI-Powered Natural Language to SQL Analytics Platform

"Enabled 150+ business users to answer complex revenue and margin questions in minutes. without SQL."

⚡Executive Summary

Market Basket Analysis transformed enterprise e-commerce analytics from a SQL-gated, weeks-long process into an AI-powered conversational platform. Serving merchandising, finance, and marketing teams, it delivered $4.8M+ in annual value through optimized bundling, margin expansion, and reduced returns. accelerating decision-making by 10x while freeing data teams from repetitive query work.

📋Situation

The Core Problem

Analytics Access Bottleneck: 200+ SQL requests backlogged for months forced 150+ business users to wait 2–3 weeks for answers, directly delaying pricing, merchandising, and promotion decisions. Data engineers spent 60% of their time writing repetitive queries instead of building strategic capabilities.

Business Impact

Scale of Impact: Organizations were spending millions on data infrastructure but couldn't answer basic business questions in time to act. Market basket analysis. understanding what products customers buy together. took weeks instead of minutes, directly impacting revenue, margins, and customer satisfaction.

🎯Task

The Challenge: Democratizing E-Commerce Analytics at Enterprise Scale

The core challenge wasn't building a chatbot. it was solving an organizational data access problem that was costing millions in lost revenue, margin erosion, and operational inefficiency. Success required:

The Strategic Imperative: This wasn't about replacing SQL. it was about transforming analytics from a specialized, bottlenecked process into a self-service business capability. Success meant enabling every business team to answer their own questions in real-time, fundamentally changing how the organization leveraged data for competitive advantage. The solution needed to deliver measurable business value: increased revenue, expanded margins, reduced costs, and accelerated decision-making.

⚙️Action

The Solution Approach

Market Basket Analysis was built as a conversational AI platform that transformed how business teams accessed e-commerce insights:

Market Basket Analysis Architecture Diagram

Key Solution Components

Key Business Capabilities Enabled

Technology Stack

Amazon Bedrock Claude Sonnet Amazon Athena Apache Iceberg Amazon ECS Fargate Amazon CloudFront Amazon DynamoDB AWS Glue Data Catalog Amazon S3 AWS Cognito Streamlit (Python)

Why This Was Hard

Principal-Level Decisions

Decision: Conversational Analytics over Semantic BI Layer

Rejected: Pre-built dashboards + metric layer (Looker/Tableau approach)

Reason: Exploratory workflows required iterative questioning. dashboards would reintroduce the backlog problem. Business users needed to ask "why" and drill deeper without waiting for new reports.

Tradeoff: Less standardized metrics early, mitigated via audit trails and SQL transparency that enabled governance review.

Decision: Show Generated SQL to All Users

Rejected: Black-box AI with results-only interface

Reason: Finance and compliance teams wouldn't trust AI-generated insights for pricing decisions without query visibility. Transparency built organizational confidence and created learning opportunity.

Tradeoff: Slightly more complex UI, but dramatically accelerated adoption and reduced validation overhead.

Decision: Unified Denormalized Table over Federated Queries

Rejected: AI querying across normalized product, order, customer, return tables

Reason: Complex joins degraded AI reasoning quality and query performance. Pre-computing common metrics (margins, costs) enabled 80% of questions without joins.

Tradeoff: Higher storage costs and ETL complexity, but 10x improvement in query success rate and user experience.

Key Design Decisions

Conversational over Dashboards: Enabled exploratory workflows with iterative refinement, reducing time-to-insight from weeks to minutes.

SQL Transparency: Displayed generated queries to build trust and create organizational learning.

Unified Data Model: Pre-computed metrics and denormalized structure enabled 80% of questions without complex joins.

Streaming Responses: Real-time SQL generation improved perceived performance and user engagement.

📊Result

Quantifiable Business Outcomes

$2.4M+
Annual Revenue Impact from Optimized Product Bundling
10x
Faster Time-to-Insight (Weeks to Minutes)
35%
Increase in Cross-Sell Conversion Rate
90%
Reduction in Data Team Query Requests
18%
Improvement in Basket Margin Through Intelligent Recommendations
$850K
Annual Savings from Reduced Return Rates

Platform-Level Impact at Scale

Customer Experience & Satisfaction

Total Business Impact: Market Basket Analysis delivered $4.8M+ in measurable annual value through revenue growth ($2.4M from bundling, $1.2M from optimized promotions), cost reduction ($850K from returns, $450K from data team productivity, $180K from tool consolidation), and operational improvements (18% margin expansion, 35% cross-sell lift, 10x faster insights). The platform fundamentally transformed how the organization leveraged data. democratizing analytics access, accelerating decision-making, and enabling data-driven strategies impossible with traditional SQL-dependent approaches.

🎥Demo Video

Watch Market Basket Analysis in action - see how business users ask questions in natural language and receive instant SQL queries with actionable insights:

✨Key Capabilities

Core Features

Supported Analysis Types

💡Key Learnings & Best Practices

Business Impact Insights

Technical Insights

← Back to Portfolio