💼 Data Consulting Business Analysis Agent

4-agent market research pipeline — demonstrated on a Malaysian fruit retail business (3,000 SKU transactions, September 2024)

Python 3.9+ Gemini 2.0 Flash Tavily Search API Multi-Agent System Strategic Analysis

📋 Project Overview & Problem Statement

Challenge: A Malaysian fruit retailer running 21 SKUs and RM1.88 million in monthly revenue has no way to tell which products are leaking margin, where the portfolio concentration risk sits, or which strategic move to make first. Traditional SME consulting engagements take 4–6 weeks and cost RM30,000–RM100,000. Most operators never commission the analysis because cost and wait don't match their decision window.

Solution: The Data Consulting Business Analysis Agent runs the full market analysis as a 4-agent AI pipeline — research, competitive intelligence, opportunity scoring, and executive report generation. This showcase demonstrates the pipeline applied to the fruit retail case: 3,000 September 2024 transactions feed the pipeline, which outputs a 12-section executive report with pricing-discipline flags, SKU portfolio quadrants, and a 90-day action plan — in under 15 minutes.

🎯 What the Pipeline Delivered for the Fruit Retail Case

  • Market snapshot: RM1.88M monthly revenue, 3,000 transactions, 21 SKUs, RM628.60 avg ticket
  • Revenue leaders: Top 5 SKUs identified (Guavas, Durians, Peaches, Dragon Fruits, Mangosteens = 26% of revenue)
  • Pricing-discipline finding: Every top SKU sold at both RM2 and RM10/kg — the single biggest margin-recovery lever
  • Opportunity quadrant map: 3 SKUs in "Grow", 8 in "Fix", 10 in "Monitor / Exit"
  • 90-day action plan: Phased deliverables targeting +12–18% revenue and +10–15% margin

Key Benefits

🤖 AI Capabilities & 4-Agent Architecture

🔍 Research Agent

Scans the raw data to identify market shape — demand signals, volume leaders, daily revenue variance. In the fruit retail case: surfaced RM1.88M monthly revenue, 21 SKUs, RM628.60 average ticket, ±25% daily swings around a RM62.8K baseline.

🕵️ Competitor Intelligence Agent

Maps the SKU / competitor landscape — concentration, fragmentation, pricing behaviour. In the fruit retail case: found a flat long-tail (top 5 SKUs only 26.1% of revenue) and a RM8 price gap on identical products — the market-wide pricing-discipline failure.

💡 Opportunity Analyzer Agent

Scores every SKU on a 2×2 matrix (revenue × price stability). In the fruit retail case: placed 3 SKUs in "Grow" (Papayas, Cempedak, Plums), 8 in "Fix" (top-revenue SKUs with broken pricing), and 10 in "Monitor / Exit".

📋 Strategy Report Agent

Packages the upstream analysis into an executive summary, top 3 priority list, and 90-day action plan. In the fruit retail case: output projects +12–18% revenue and +10–15% margin uplift across phased deliverables.

AI Processing Pipeline — as applied to the fruit retail case

📊 Strategic Visualizations

1. SKU Revenue & Volume Chart

Horizontal bar chart ranking all 21 SKUs by revenue. In the fruit retail case:

2. Pricing Discipline Heatmap

Visualises price variance per SKU to surface revenue leakage. In the fruit retail case:

3. Opportunity Map (2×2 Matrix)

Scatter plot placing every SKU on revenue × pricing-stability axes. In the fruit retail case:

🛠️ Technical Architecture & Implementation

AI & Analytics Stack

Google Gemini 2.0 Flash Tavily Search API Python 3.9+ Pandas & NumPy Matplotlib Seaborn NetworkX

Multi-Agent Framework

4 Specialized Agents Web Search Integration Competitive Intelligence Strategic Synthesis Auto Visualization

Deployment Options

Google Colab Jupyter Notebook Local Python Streamlit (Optional)

System Architecture

Pipeline Flow: 1. Industry Research → Web search + LLM trend extraction 2. Competitor Intelligence → Capability mapping + white-space detection 3. Opportunity Analysis → 2x2 matrix scoring (attractiveness × competition) 4. Strategic Report → Markdown report + embedded visualizations Output Package: - 1 Markdown report (~10 pages) - 3 PNG visualizations - JSON data export (optional)

📖 Development Setup & Usage Guide

Quick Start

  1. Try the AI Assistant Demo: Click "Launch AI Assistant Demo" button above — zero-setup interactive walkthrough of the 4-agent pipeline
  2. Run the full pipeline locally: Clone the repo, add GEMINI_API_KEY and TAVILY_API_KEY to a .env file
  3. Install dependencies: pip install -r requirements.txt
  4. Run Pipeline: python data_consulting_business_analyst.py
  5. Download Results: Get markdown report and 3 visualization charts

Example Usage — fruit retail case

# Run the full 4-agent pipeline on the fruit retail dataset results = run_consulting_discovery_pipeline( input_csv="fruit_sales_sept_2024.csv", output_path="fruit_retail_market_report.md" ) # The pipeline automatically: # 1. Research Agent — market shape, top SKUs, daily variance # 2. Competitor Intel Agent — SKU landscape, pricing discipline analysis # 3. Opportunity Agent — 2×2 Grow / Fix / Monitor / Exit placement # 4. Strategy Agent — executive summary + 3 priorities + 90-day plan # Output Files: # - fruit_retail_market_report.md # - sku_revenue_chart.png # - pricing_discipline_heatmap.png # - opportunity_map_2x2.png

Customization Options

# Re-run the pipeline against a different SME vertical queries = [ "Malaysian kopitiam F&B daily sales analysis", "SME retail pricing discipline benchmarks", "Bursa-listed consumer staples same-store-sales" ] # Adjust quadrant thresholds (default: median revenue × median price variance) rev_threshold = 90000 # RM per SKU per month var_threshold = 2.30 # Price std dev per SKU # Change visualization palette sns.set_palette("YlOrBr") # Amber-gold theme

Required API Keys

📊 Performance Metrics & Business Impact

10-15 min
Full Analysis Time
4
Specialized Agents
3
Strategic Charts
~$0.20
Cost Per Analysis

Business Value Demonstration

Use Cases

Real-World Impact

Traditional Manual Approach: - Time: 4-6 weeks - Cost: RM30,000-RM100,000 (SME consulting engagement) - Coverage: Limited by consultant hours and experience - Freshness: Outdated by the time the deck is delivered AI-Powered Approach: - Time: 10-15 minutes - Cost: ~RM1 per analysis (API calls only) - Coverage: Every transaction in the dataset, no sampling - Freshness: Re-runnable any time the data updates

📋 Sample Report Sections

Executive Summary Example — fruit retail case

The Malaysian fruit retail business clocks RM1.88 million in monthly revenue across 3,000 transactions and 21 SKUs (Sept 2024). The market is fragmented — no single SKU exceeds 5.5% of revenue, and the top 5 combined account for only 26.1%. Three structural opportunities identified: 1. Pricing Discipline (Impact: High, Effort: Low) - Every top SKU sold at both RM2 and RM10 per kg (5× spread) - Single biggest margin-recovery lever — no volume risk - Estimated 8–15% gross margin lift from pricing SOP alone 2. Bulk / B2B Channel Playbook (Impact: High, Effort: Medium) - Bulk orders are 27% of transactions but 44% of revenue - Avg bulk ticket RM1,042 vs retail RM479 (2.2×) - Formalising this channel could add RM150K–RM250K annually 3. Bottom-Quadrant SKU Cleanup (Impact: Medium, Effort: Low) - 10 of 21 SKUs sit in Monitor or Exit quadrants - 3 Exit SKUs (Starfruits, Honeydew, Pineapples) are clean delist candidates — freeing shelf and capital for the top 5

Strategic Recommendations Example — fruit retail case

🎯 Advanced Features & Customization

Vertical-Specific Variations

The same 4-agent pipeline adapts to any transactional SME business:

Add-On Agents (Future Enhancements)

Integration Options