Download validation.jsonl from Softsasi/Insight-1-ERP-Analytics-Dataset: direct link, hf CLI and curl.
- Browser
- Download file 101 kB
-
https://huggingface.co/datasets/Softsasi/Insight-1-ERP-Analytics-Dataset/resolve/main/validation.jsonl
- Command line
-
hf download hf://datasets/Softsasi/Insight-1-ERP-Analytics-Dataset/validation.jsonl
-
curl -L -o validation.jsonl https://huggingface.co/datasets/Softsasi/Insight-1-ERP-Analytics-Dataset/resolve/main/validation.jsonl
101 kB
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Assistant, an expert business intelligence analyst grounded in the company's live ERP financials, CRM pipeline, projects, inventory, and HR metrics. Give concise, quantitative, actionable answers.\n\n--- COMPANY CONTEXT ---\nYou are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Bengal Digital Craft (Digital Agency & IT Services)\nANALYSIS DATE: 2026-09-10 15:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $712,427.08\n• Total Expenses: $569,187.16\n• Net Profit: $143,239.92\n• Outstanding Receivables: $95,309.43 (Overdue: $21,721.73)\n• Outstanding Payables: $103,428.03\n• Bank Balance: $184,675.00\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-11,936.66\n• Cash Flow Volatility (Jitter): 21.5% (Level: Medium (Variable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 190 (New: 16)\n• Pipeline Value: $359,005.00\n• Conversion Rate: 28.4%\n• Customer Segments (RFM):\n - Champion: 5 customers\n - Loyal Customer: 14 customers\n - New Potential: 16 customers\n - At Risk: 1 customers\n - Cant Lose Them: 1 customers\n - Hibernating: 3 customers\n• RFM Insight: 1 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $193,780.17\n• Predicted Growth: 8.8%\n• Overall Risk Score: 0/100 (Low)\n• Inventory Risks: 4 items arriving at stockout levels soon.\n• Employee Retention: 1 employees flagged as flight risks.\n• Supply Chain: 4 bottleneck issues detected.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 20.1%\n• Current Ratio: 1.79\n• On-Time Delivery: 78.7%\n• Revenue Per Employee: $47,495.14\n"}, {"role": "user", "content": "We have 4 stockout-risk SKUs and 4 supply-chain bottlenecks. How should procurement balance stockout protection against cash preservation?"}, {"role": "assistant", "content": "Use **ABC-Velocity Reordering** instead of blanket restocking:\n\n1. **Prioritize High-Velocity Margin SKUs:** Fund POs first for the **4 stockout-risk items** generating active invoice velocity (using 30-day demand + supplier lead-time safety buffer).\n2. **De-risk Bottlenecks (4 flagged):** Qualify secondary vendors for single-source, high-spend suppliers and split orders into smaller, higher-frequency batches so cash isn't locked in warehouse deadstock.\n3. **Liquidating Slow Stock:** Run bundled promotions on slow-moving warehouse SKUs to convert idle inventory back into bank balance (currently **$184,675.00**)."}]} | |
| {"messages": [{"role": "system", "content": "You are a structured Business Intelligence API engine for Softsasi ERP. Respond strictly with valid JSON matching the requested analytics schema, with accurate calculations and no surrounding markdown."}, {"role": "user", "content": "Return strict JSON (`company`, `health_grade`, `cash_risk`, `kpis`, `top_bottlenecks`, `recommended_actions`) summarizing this ERP snapshot for TechBazaar Electronics:\nRevenue=$528,614.36, Expenses=$433,996.89, NetProfit=$94,617.47, AR=$77,888.94 (Overdue=$26,697.64), AP=$58,041.05, Bank=$149,612.32, Runway=Healthy, Benford=Low, Pipeline=$133,979.14, Conv=22.6%, OnTime=60.8%, Stockouts=0, AtRiskRFM=1, CantLoseRFM=2, RiskScore=0."}, {"role": "assistant", "content": "{\"company\": \"TechBazaar Electronics\", \"health_grade\": \"A\", \"cash_risk\": \"low\", \"kpis\": {\"profit_margin_pct\": 17.9, \"current_ratio\": 2.58, \"dso_days\": 54, \"conversion_rate_pct\": 22.6, \"on_time_delivery_pct\": 60.8, \"risk_score\": 0}, \"top_bottlenecks\": [\"Overdue receivables ($26,697.64)\", \"Low delivery rate (60.8%)\"], \"recommended_actions\": [{\"priority\": \"P0\", \"owner\": \"Finance\", \"action\": \"Collect 50% of overdue AR ($26,697.64)\", \"expected_cash_impact\": 13348.82}, {\"priority\": \"P1\", \"owner\": \"Sales\", \"action\": \"Engage 3 At-Risk/Cant-Lose RFM accounts & close $133,979.14 pipeline\", \"expected_revenue_impact\": 30279.29}]}"}]} | |
| {"messages": [{"role": "system", "content": "You are an expert ERP Analytics SQL & Data Engineer for Softsasi ERP (MySQL Laravel ERP schema and PostgreSQL/Prisma next-erp schema). Write accurate, multi-tenant-safe, production-ready analytical queries using exact schema tables and columns."}, {"role": "user", "content": "Write a MySQL query to compute monthly Revenue vs. Paid Bills (Cash Expenses) over the last 12 months for `created_by = ?` in Softsasi ERP."}, {"role": "assistant", "content": "```sql\nWITH months AS (\n SELECT DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL n MONTH), '%Y-%m') AS ym\n FROM (SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3\n UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10 UNION ALL SELECT 11) nums\n),\nrev AS (\n SELECT DATE_FORMAT(i.issue_date, '%Y-%m') AS ym,\n SUM((ip.price * ip.quantity) - COALESCE(ip.discount, 0)) AS revenue\n FROM invoices i\n JOIN invoice_products ip ON ip.invoice_id = i.id\n WHERE i.created_by = ? AND i.status = 4\n AND i.issue_date >= DATE_SUB(CURDATE(), INTERVAL 12 MONTH)\n GROUP BY ym\n),\nexp AS (\n SELECT DATE_FORMAT(b.bill_date, '%Y-%m') AS ym,\n SUM((bp.price * bp.quantity) - COALESCE(bp.discount, 0)) AS expenses\n FROM bills b\n JOIN bill_products bp ON bp.bill_id = b.id\n WHERE b.created_by = ? AND b.status = 4\n AND b.bill_date >= DATE_SUB(CURDATE(), INTERVAL 12 MONTH)\n GROUP BY ym\n)\nSELECT m.ym AS month,\n ROUND(COALESCE(r.revenue, 0), 2) AS revenue,\n ROUND(COALESCE(e.expenses, 0), 2) AS expenses,\n ROUND(COALESCE(r.revenue, 0) - COALESCE(e.expenses, 0), 2) AS net_cash_margin\nFROM months m\nLEFT JOIN rev r ON r.ym = m.ym\nLEFT JOIN exp e ON e.ym = m.ym\nORDER BY m.ym ASC;\n```"}]} | |
| {"messages": [{"role": "system", "content": "You are an expert ERP Analytics SQL & Data Engineer for Softsasi ERP (MySQL Laravel ERP schema and PostgreSQL/Prisma next-erp schema). Write accurate, multi-tenant-safe, production-ready analytical queries using exact schema tables and columns."}, {"role": "user", "content": "Write a MySQL query to evaluate vendor spend concentration and dependency risk across paid bills for `created_by = ?`."}, {"role": "assistant", "content": "```sql\nWITH vendor_spend AS (\n SELECT\n v.id AS vendor_id,\n v.name AS vendor_name,\n COUNT(DISTINCT b.id) AS bill_count,\n ROUND(SUM((bp.price * bp.quantity) - COALESCE(bp.discount, 0)), 2) AS total_spend\n FROM bills b\n JOIN venders v ON v.id = b.vender_id\n JOIN bill_products bp ON bp.bill_id = b.id\n WHERE b.created_by = ? AND b.status = 4\n GROUP BY v.id, v.name\n)\nSELECT\n vendor_id,\n vendor_name,\n bill_count,\n total_spend,\n ROUND(total_spend * 100.0 / NULLIF(SUM(total_spend) OVER (), 0), 1) AS spend_share_pct,\n CASE\n WHEN (total_spend * 100.0 / NULLIF(SUM(total_spend) OVER (), 0)) > 50 THEN 'High'\n WHEN (total_spend * 100.0 / NULLIF(SUM(total_spend) OVER (), 0)) > 30 THEN 'Medium'\n ELSE 'Low'\n END AS dependency_risk\nFROM vendor_spend\nORDER BY total_spend DESC;\n```"}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Assistant, an expert business intelligence analyst grounded in the company's live ERP financials, CRM pipeline, projects, inventory, and HR metrics. Give concise, quantitative, actionable answers.\n\n--- COMPANY CONTEXT ---\nYou are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Bengal Digital Craft (Digital Agency & IT Services)\nANALYSIS DATE: 2026-07-04 19:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $1,004,920.90\n• Total Expenses: $933,756.95\n• Net Profit: $71,163.95\n• Outstanding Receivables: $189,817.83 (Overdue: $63,334.22)\n• Outstanding Payables: $202,516.52\n• Bank Balance: $159,438.37\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-5,930.33\n• Cash Flow Volatility (Jitter): 59.5% (Level: High (Unstable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n• Expense Optimization: Found 3 uncategorized items totaling $6,543.30.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 111 (New: 16)\n• Pipeline Value: $380,744.12\n• Conversion Rate: 16.0%\n• Customer Segments (RFM):\n - Champion: 18 customers\n - Loyal Customer: 38 customers\n - New Potential: 16 customers\n - At Risk: 1 customers\n - Cant Lose Them: 2 customers\n - Hibernating: 23 customers\n• RFM Insight: 1 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $260,525.74\n• Predicted Growth: 3.7%\n• Overall Risk Score: 35/100 (Medium)\n• Inventory Risks: 1 items arriving at stockout levels soon.\n• Supply Chain: 2 bottleneck issues detected.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 7.1%\n• Current Ratio: 0.79\n• On-Time Delivery: 72.4%\n• Revenue Per Employee: $21,846.11\n"}, {"role": "user", "content": "Give me a strict 14-day cash survival and payables prioritization plan based on our current numbers."}, {"role": "assistant", "content": "**Cash Position Snapshot:** Bank **$159,438.37** | Payables **$202,516.52** (Shortfall $43,078.15) | Overdue AR **$63,334.22** | Runway **Unlimited (Profitable) months**.\n\n**Days 1–3 (Freeze & Visibility):**\n- Freeze all non-essential discretionary spend and defer unapproved purchases.\n- Build a 13-week rolling cash ledger matching daily inflows against payroll and critical suppliers.\n\n**Days 4–9 (Accelerate Inflows):**\n- Target the top 10 invoices driving **$63,334.22** overdue AR with daily collection calls and instant payment links.\n- Require 30–50% upfront deposits on new pipeline deals ($380,744.12 active).\n\n**Days 10–14 (Restructure Outflows):**\n- Tier payables into **Tier 1 (Payroll/Tax/Core Inventory)** and **Tier 2 (Negotiable vendors)**—request net-30/45 extensions on Tier 2."}]} | |
| {"messages": [{"role": "system", "content": "You are a quantitative financial & operations analyst. Compute business metrics, unit economics, forecasts, and inventory/working-capital formulas accurately step by step, then state a clear management takeaway."}, {"role": "user", "content": "Compute Unit Contribution Margin, Contribution Margin Ratio, and Monthly Break-Even Units & Revenue: Monthly Fixed Costs=$41,705.28, Selling Price=$133.99/unit, Variable Cost=$73.07/unit."}, {"role": "assistant", "content": "**Break-Even Analysis:**\n1. **Unit Contribution Margin:** `$133.99 - $73.07` = **$60.92/unit**\n2. **Contribution Margin Ratio:** `(60.92 / 133.99) × 100` = **45.5%**\n3. **Break-Even Volume:** `ceil(41,705.28 / 60.92)` = **685 units/month**\n4. **Break-Even Revenue:** `685 × $133.99` = **$91,783.15/month**\n\n**Management Takeaway:** Every unit sold above **685** contributes **$60.92** directly to operating profit."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Business Analyst, an elite financial strategist, operational controller, and BI advisor. Analyze structured ERP telemetry accurately, reference exact figures without inventing data, and deliver direct, high-impact executive guidance."}, {"role": "user", "content": "You are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Metro Hardware & Tools (Industrial Supply)\nANALYSIS DATE: 2026-08-08 08:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $739,974.89\n• Total Expenses: $827,552.77\n• Net Profit: $-87,577.88\n• Outstanding Receivables: $230,745.04 (Overdue: $164,517.41)\n• Outstanding Payables: $306,851.15\n• Bank Balance: $112,129.77\n• Cash Runway: 15.4 months (Status: Moderate)\n• Monthly Burn Rate: $7,298.16\n• Cash Flow Volatility (Jitter): 47.2% (Level: High (Unstable))\n• Financial Forensics (Benford's Law): Risk Level High. Detected unnatural patterns in invoice amounts: leading digit 5 appears 27.5% vs expected 7.9%.\n• Expense Optimization: Found 12 uncategorized items totaling $18,752.74.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 135 (New: 11)\n• Pipeline Value: $354,207.09\n• Conversion Rate: 13.2%\n• Customer Segments (RFM):\n - Champion: 5 customers\n - Loyal Customer: 15 customers\n - New Potential: 12 customers\n - At Risk: 2 customers\n - Cant Lose Them: 1 customers\n - Hibernating: 9 customers\n• RFM Insight: 2 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $149,104.94\n• Predicted Growth: -19.4%\n• Overall Risk Score: 100/100 (High)\n• Inventory Risks: 4 items arriving at stockout levels soon.\n• Employee Retention: 4 employees flagged as flight risks.\n• Supply Chain: 2 bottleneck issues detected.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: -11.8%\n• Current Ratio: 0.37\n• On-Time Delivery: 66.0%\n• Revenue Per Employee: $6,491.01\n\n---\n\nBased on this expanded data, provide a comprehensive strategic analysis.\nIMPORTANT: Specifically address the Cash Runway, Fraud Risks (Benford), and Customer Segmentation (RFM) in your insights if they show concerning values.\nProvide:\n1. **Executive Summary** (Holistic health check)\n2. **Critical Alerts** (Immediate attention items)\n3. **Strategic Opportunities** (Growth & Optimization)\n4. **Risk Mitigation** (Financial, Operational, & Talent)\n5. **30-60-90 Day Plan**\nUse markdown. Be sharp, direct, and professional.\n\nIMPORTANT: Write your ENTIRE response in Bangla. All headings, analysis, recommendations, and text must be in Bangla."}, {"role": "assistant", "content": "## ১. নির্বাহী সারসংক্ষেপ (Executive Summary)\n**Metro Hardware & Tools**-এর সামগ্রিক বিশ্লেষণে দেখা যাচ্ছে, মোট আয় **$739,974.89** এবং ব্যয় **$827,552.77**; কোম্পানিটি বর্তমানে **$87,577.88 নিট লোকসানে** (মার্জিন -11.8%) পরিচালিত হচ্ছে। ব্যাংক ব্যালেন্স **$112,129.77**, যেখানে কারেন্ট রেশিও **0.37x** এবং ঝুঁকি স্কোর **100/100 (High)**। আগামী ৩ মাসের প্রক্ষেপিত আয় **$149,104.94** (প্রবৃদ্ধি **-19.4%**)।\n\n## ২. জরুরি সতর্কবার্তা (Critical Alerts)\n- **ক্যাশ রানওয়ে ও তারল্য:** বর্তমান অবস্থা **Moderate** (15.4 months, মাসিক বার্ন $7,298.16)। বকেয়া প্রাপ্য (Receivables) **$230,745.04**, যার মধ্যে **$164,517.41** মেয়াদোত্তীর্ণ। ৫০% বকেয়া আদায় করলে তাৎক্ষণিক **$82,258.71** নগদ প্রবাহ বাড়বে।\n- **আর্থিক ফরেনসিক (Benford's Law):** বেনফোর্ডের সূত্র (Benford's Law) অনুযায়ী ইনভয়েস অঙ্কে **High ঝুঁকি** শনাক্ত হয়েছে: **5** অঙ্ক দিয়ে শুরু হওয়া ইনভয়েস **27.5%** (প্রত্যাশিত 7.9%)। ভুয়া বিল, স্প্লিট ইনভয়েস বা রাউন্ড-ফিগার এন্ট্রি যাচাই করতে অবিলম্বে অডিট করুন।\n- **ক্যাশ ফ্লো অস্থিরতা (Jitter):** অস্থিরতা সূচক **47.2% (High (Unstable))**।\n- **ইনভেন্টরি ও সাপ্লাই চেইন:** 4টি পণ্যে স্টক শেষ হওয়ার ঝুঁকি এবং 2টি সরবরাহ চেইন জটিলতা রয়েছে।\n\n## ৩. কৌশলগত সুযোগ (Strategic Opportunities)\n- **সেলস পাইপলাইন রূপান্তর:** সক্রিয় পাইপলাইন **$354,207.09** (কনভার্সন রেট **13.2%**, প্রত্যাশিত আয় ~**$46,755.34**) এবং **135**টি লিড ফলো-আপ করে বিক্রয় বাড়ানো সম্ভব।\n- **RFM গ্রাহক ধরে রাখা:** **5** জন চ্যাম্পিয়ন ও **15** জন বিশ্বস্ত গ্রাহককে আপসেল করুন এবং ঝুঁকিতে থাকা **3** জন গুরুত্বপূর্ণ গ্রাহকের সাথে সরাসরি যোগাযোগ করুন।\n\n## ৪. ঝুঁকি প্রশমন (Risk Mitigation)\n- **অর্থ ও বকেয়া ব্যবস্থাপনা:** মেয়াদোত্তীর্ণ ইনভয়েসে ৭/১৫/৩০ দিনের স্বয়ংক্রিয় রিমাইন্ডার চালু করুন এবং প্রদেয় বিলের (Payables: $306,851.15) সাথে নগদ আদায়ের সময়সূচি সমন্বয় করুন।\n- **অপারেশন ও কর্মী ব্যবস্থাপনা:** অন-টাইম ডেলিভারি (**66.0%**) বাড়াতে বিলম্বিত প্রজেক্টগুলো পুনর্মূল্যায়ন করুন এবং ঝুঁকিতে থাকা **4** জন কর্মীর সাথে রিটেনশন আলোচনা করুন।\n\n## ৫. ৩০-৬০-৯০ দিনের কর্মপরিকল্পনা\n- **প্রথম ৩০ দিন:** মেয়াদোত্তীর্ণ বকেয়ার অন্তত ৪০% আদায় ($65,806.96), ঝুঁকিপূর্ণ গ্রাহকদের সাথে যোগাযোগ ও প্রয়োজনীয় অডিট সম্পন্ন করা।\n- **৩১–৬০ দিন:** পাইপলাইন ডিল ক্লোজিং গতি বাড়ানো, অশ্রেণিবদ্ধ খরচ সমন্বয় এবং ভেন্ডর পেমেন্ট শর্ত পুনর্নির্ধারণ।\n- **৬১–৯০ দিন:** ৩ মাসের আয় লক্ষ্যমাত্রা (**$149,104.94**) অর্জন এবং মাসিক ক্যাশ-ফ্লো ও RFM ড্যাশবোর্ড পর্যালোচনা স্থায়ী করা।"}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Assistant, an expert business intelligence analyst grounded in the company's live ERP financials, CRM pipeline, projects, inventory, and HR metrics. Give concise, quantitative, actionable answers.\n\n--- COMPANY CONTEXT ---\nYou are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: CarePlus Pharma Supply (Healthcare & Medical Distribution)\nANALYSIS DATE: 2026-01-16 14:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $1,082,783.33\n• Total Expenses: $894,327.56\n• Net Profit: $188,455.77\n• Outstanding Receivables: $483,450.02 (Overdue: $345,463.26)\n• Outstanding Payables: $249,201.64\n• Bank Balance: $186,242.72\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-15,704.65\n• Cash Flow Volatility (Jitter): 23.6% (Level: Medium (Variable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 241 (New: 39)\n• Pipeline Value: $380,521.01\n• Conversion Rate: 22.1%\n• Customer Segments (RFM):\n - Champion: 19 customers\n - Loyal Customer: 14 customers\n - New Potential: 7 customers\n - At Risk: 3 customers\n - Cant Lose Them: 0 customers\n - Hibernating: 9 customers\n• RFM Insight: 3 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $301,284.46\n• Predicted Growth: 11.3%\n• Overall Risk Score: 45/100 (Medium)\n• Inventory Risks: 1 items arriving at stockout levels soon.\n• Employee Retention: 1 employees flagged as flight risks.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 17.4%\n• Current Ratio: 0.75\n• On-Time Delivery: 81.4%\n• Revenue Per Employee: $32,811.62\n"}, {"role": "user", "content": "Looking at our RFM breakdown (19 Champions, 14 Loyal, 3 At Risk, 0 Cant Lose Them, 9 Hibernating), how should Sales allocate effort this month?"}, {"role": "assistant", "content": "Allocate sales capacity using a **50 / 30 / 20 revenue-protection rule**:\n\n1. **Protect Core Revenue (50% effort — 3 accounts):** Immediately assign account owners to the **0 'Cant Lose Them'** and **3 'At Risk'** buyers. Retention is 5x cheaper than replacing lost volume.\n2. **Expand Active Base (30% effort — 33 accounts):** Run bundle/annual-contract upsells across your **19 Champions** and **14 Loyal** buyers to boost average order value.\n3. **Automated Win-Back (20% effort — 9 accounts):** Place the **9 Hibernating** accounts on an automated email/WhatsApp reactivation campaign rather than manual rep hours."}]} | |
| {"messages": [{"role": "system", "content": "You are a quantitative financial & operations analyst. Compute business metrics, unit economics, forecasts, and inventory/working-capital formulas accurately step by step, then state a clear management takeaway."}, {"role": "user", "content": "Calculate DIO, DSO, DPO, and the Cash Conversion Cycle (CCC) using 365 days: Annual Revenue=$1,245,156.30, COGS=$718,697.16, Average Inventory=$168,260.90, Accounts Receivable=$237,767.75, Accounts Payable=$57,921.38."}, {"role": "assistant", "content": "**Step-by-Step Working Capital Calculation:**\n1. **DIO (Days Inventory Outstanding):** `(168,260.90 / 718,697.16) × 365` = **85.5 days**\n2. **DSO (Days Sales Outstanding):** `(237,767.75 / 1,245,156.30) × 365` = **69.7 days**\n3. **DPO (Days Payable Outstanding):** `(57,921.38 / 718,697.16) × 365` = **29.4 days**\n4. **Cash Conversion Cycle (CCC):** `85.5 + 69.7 - 29.4` = **125.8 days**\n\n**Management Takeaway:** Cash is tied up for **125.8 days** per operating cycle. Every 5-day reduction in DSO releases roughly **$17,056.94** in cash."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Business Analyst, an elite financial strategist, operational controller, and BI advisor. Analyze structured ERP telemetry accurately, reference exact figures without inventing data, and deliver direct, high-impact executive guidance."}, {"role": "user", "content": "You are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Meghna Builders & Infra (Construction & Engineering)\nANALYSIS DATE: 2026-09-08 12:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $1,211,846.78\n• Total Expenses: $963,969.71\n• Net Profit: $247,877.07\n• Outstanding Receivables: $454,852.37 (Overdue: $303,273.73)\n• Outstanding Payables: $289,011.86\n• Bank Balance: $200,321.45\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-20,656.42\n• Cash Flow Volatility (Jitter): 27.6% (Level: Medium (Variable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 310 (New: 44)\n• Pipeline Value: $647,532.14\n• Conversion Rate: 27.8%\n• Customer Segments (RFM):\n - Champion: 14 customers\n - Loyal Customer: 9 customers\n - New Potential: 10 customers\n - At Risk: 16 customers\n - Cant Lose Them: 1 customers\n - Hibernating: 20 customers\n• RFM Insight: 16 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $324,169.01\n• Predicted Growth: 7.0%\n• Overall Risk Score: 45/100 (Medium)\n• Inventory Risks: 2 items arriving at stockout levels soon.\n• Employee Retention: 1 employees flagged as flight risks.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 20.5%\n• Current Ratio: 0.69\n• On-Time Delivery: 88.0%\n• Revenue Per Employee: $80,789.79\n\n---\n\nBased on this expanded data, provide a comprehensive strategic analysis.\nIMPORTANT: Specifically address the Cash Runway, Fraud Risks (Benford), and Customer Segmentation (RFM) in your insights if they show concerning values.\nProvide:\n1. **Executive Summary** (Holistic health check)\n2. **Critical Alerts** (Immediate attention items)\n3. **Strategic Opportunities** (Growth & Optimization)\n4. **Risk Mitigation** (Financial, Operational, & Talent)\n5. **30-60-90 Day Plan**\nUse markdown. Be sharp, direct, and professional."}, {"role": "assistant", "content": "## 1. Executive Summary\nMeghna Builders & Infra shows accounting profitability ($247,877.07, 20.5% margin) but faces a **working-capital squeeze**: bank cash ($200,321.45) does not cover outstanding payables ($289,011.86, Current Ratio 0.69x) because $454,852.37 is tied up in receivables (~137 DSO). Over the trailing window, revenue stands at **$1,211,846.78** against expenses of **$963,969.71** ($80,789.79/employee across ~15 staff), while 3-month revenue is projected at **$324,169.01** (7.0% growth trend).\n\n## 2. Critical Alerts\n- **Payables Coverage Gap ($88,690.41):** Outstanding payables ($289,011.86) exceed cash on hand ($200,321.45), pushing Current Ratio to 0.69x.\n- **Receivables Delinquency (66.7% Overdue):** $303,273.73 of $454,852.37 total AR is past due. Collecting just 50% unlocks **$151,636.86** in immediate liquidity.\n- **Imminent Inventory Stockouts (2 SKUs):** Replenishment orders must be triggered immediately to avoid lost invoiced revenue.\n\n## 3. Strategic Opportunities\n- **Pipeline Conversion Capture:** Closing active pipeline ($647,532.14) at your current 27.8% rate yields ~**$180,013.93**; lifting conversion by 5 percentage points adds **$32,376.61** without extra marketing spend.\n- **RFM Revenue Expansion & Retention:** Mobilize 14 Champions and 9 Loyal accounts for annual/bundled upsells while deploying executive outreach to 1 'Cant Lose Them' and 16 'At Risk' customers.\n- **Hibernating Reactivation:** Target 20 hibernating accounts with a time-boxed win-back offer tied to your highest-margin SKUs.\n\n## 4. Risk Mitigation\n- **Financial & Working Capital:** Enforce automated dunning at +7/+15/+30 days overdue, offer 1.5–2% early-settlement discounts on invoices >30 days old, and align vendor payment schedules with receivables inflows.\n- **Controls & Forensics:** Maintain monthly Benford leading-digit checks and quarterly chart-of-accounts expense reviews.\n- **Operations & Talent:** Pre-position safety stock on the 2 stockout-risk SKUs and qualify backup suppliers for the 0 bottleneck vendors. Conduct stay-interviews and workload rebalancing for the 1 flight-risk staff.\n\n## 5. 30-60-90 Day Plan\n- **Days 1–30 (Stabilize & Recover):** Collect ≥40% of $303,273.73 overdue AR ($121,309.49), issue POs for 2 stockout-risk items, and contact all 17 At-Risk / Can't-Lose customers.\n- **Days 31–60 (Optimize & Convert):** Lift lead-to-deal and closing velocity on $647,532.14 active pipeline, renegotiate payment terms with top vendors to improve Current Ratio above 1.5x, and stabilize cash jitter below 20%.\n- **Days 61–90 (Scale & Institutionalize):** Hit 3-month revenue forecast ($324,169.01) or better, raise On-Time Delivery from 88.0% to ≥88%, and formalize quarterly rolling cash-flow & RFM retention scorecards across Finance, Sales, Operations, and HR."}]} | |
| {"messages": [{"role": "system", "content": "You are a quantitative financial & operations analyst. Compute business metrics, unit economics, forecasts, and inventory/working-capital formulas accurately step by step, then state a clear management takeaway."}, {"role": "user", "content": "Calculate DIO, DSO, DPO, and the Cash Conversion Cycle (CCC) using 365 days: Annual Revenue=$1,004,822.68, COGS=$691,424.36, Average Inventory=$165,306.59, Accounts Receivable=$120,839.50, Accounts Payable=$143,897.53."}, {"role": "assistant", "content": "**Step-by-Step Working Capital Calculation:**\n1. **DIO (Days Inventory Outstanding):** `(165,306.59 / 691,424.36) × 365` = **87.3 days**\n2. **DSO (Days Sales Outstanding):** `(120,839.50 / 1,004,822.68) × 365` = **43.9 days**\n3. **DPO (Days Payable Outstanding):** `(143,897.53 / 691,424.36) × 365` = **76.0 days**\n4. **Cash Conversion Cycle (CCC):** `87.3 + 43.9 - 76.0` = **55.2 days**\n\n**Management Takeaway:** Cash is tied up for **55.2 days** per operating cycle. Every 5-day reduction in DSO releases roughly **$13,764.69** in cash."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Business Analyst, an elite financial strategist, operational controller, and BI advisor. Analyze structured ERP telemetry accurately, reference exact figures without inventing data, and deliver direct, high-impact executive guidance."}, {"role": "user", "content": "You are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Chittagong Freightways (Logistics & Supply Chain)\nANALYSIS DATE: 2026-04-03 15:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $448,222.22\n• Total Expenses: $342,462.49\n• Net Profit: $105,759.73\n• Outstanding Receivables: $93,599.04 (Overdue: $34,721.79)\n• Outstanding Payables: $63,856.54\n• Bank Balance: $101,573.66\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-8,813.31\n• Cash Flow Volatility (Jitter): 27.5% (Level: Medium (Variable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n• Expense Optimization: Found 4 uncategorized items totaling $1,698.24.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 299 (New: 73)\n• Pipeline Value: $172,947.57\n• Conversion Rate: 30.0%\n• Customer Segments (RFM):\n - Champion: 18 customers\n - Loyal Customer: 25 customers\n - New Potential: 15 customers\n - At Risk: 1 customers\n - Cant Lose Them: 1 customers\n - Hibernating: 25 customers\n• RFM Insight: 1 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $120,123.55\n• Predicted Growth: 7.2%\n• Overall Risk Score: 0/100 (Low)\n• Inventory Risks: 4 items arriving at stockout levels soon.\n• Employee Retention: 2 employees flagged as flight risks.\n• Supply Chain: 4 bottleneck issues detected.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 23.6%\n• Current Ratio: 1.59\n• On-Time Delivery: 76.1%\n• Revenue Per Employee: $3,966.57\n\n---\n\nBased on this expanded data, provide a comprehensive strategic analysis.\nIMPORTANT: Specifically address the Cash Runway, Fraud Risks (Benford), and Customer Segmentation (RFM) in your insights if they show concerning values.\nProvide:\n1. **Executive Summary** (Holistic health check)\n2. **Critical Alerts** (Immediate attention items)\n3. **Strategic Opportunities** (Growth & Optimization)\n4. **Risk Mitigation** (Financial, Operational, & Talent)\n5. **30-60-90 Day Plan**\nUse markdown. Be sharp, direct, and professional."}, {"role": "assistant", "content": "## 1. Executive Summary\nChittagong Freightways is operating from a position of healthy profitability ($105,759.73 net profit; 23.6% margin) and strong short-term liquidity (Current Ratio 1.59x, $101,573.66 cash vs. $63,856.54 payables). Over the trailing window, revenue stands at **$448,222.22** against expenses of **$342,462.49** ($3,966.57/employee across ~113 staff), while 3-month revenue is projected at **$120,123.55** (7.2% growth trend).\n\n## 2. Critical Alerts\n- **Receivables Delinquency (37.1% Overdue):** $34,721.79 of $93,599.04 total AR is past due. Collecting just 50% unlocks **$17,360.90** in immediate liquidity.\n- **Imminent Inventory Stockouts (4 SKUs):** Replenishment orders must be triggered immediately to avoid lost invoiced revenue.\n\n## 3. Strategic Opportunities\n- **Pipeline Conversion Capture:** Closing active pipeline ($172,947.57) at your current 30.0% rate yields ~**$51,884.27**; lifting conversion by 5 percentage points adds **$8,647.38** without extra marketing spend.\n- **RFM Revenue Expansion & Retention:** Mobilize 18 Champions and 25 Loyal accounts for annual/bundled upsells while deploying executive outreach to 1 'Cant Lose Them' and 1 'At Risk' customers.\n- **Smart Expense & Tax Recovery:** Classifying the 4 uncategorized bills ($1,698.24) sharpens cost-center visibility and prevents missed tax deductions.\n- **Hibernating Reactivation:** Target 25 hibernating accounts with a time-boxed win-back offer tied to your highest-margin SKUs.\n\n## 4. Risk Mitigation\n- **Financial & Working Capital:** Enforce automated dunning at +7/+15/+30 days overdue, offer 1.5–2% early-settlement discounts on invoices >30 days old, and align vendor payment schedules with receivables inflows.\n- **Controls & Forensics:** Maintain monthly Benford leading-digit checks and quarterly chart-of-accounts expense reviews.\n- **Operations & Talent:** Pre-position safety stock on the 4 stockout-risk SKUs and qualify backup suppliers for the 4 bottleneck vendors. Conduct stay-interviews and workload rebalancing for the 2 flight-risk staff.\n\n## 5. 30-60-90 Day Plan\n- **Days 1–30 (Stabilize & Recover):** Collect ≥40% of $34,721.79 overdue AR ($13,888.72), issue POs for 4 stockout-risk items, and contact all 2 At-Risk / Can't-Lose customers.\n- **Days 31–60 (Optimize & Convert):** Lift lead-to-deal and closing velocity on $172,947.57 active pipeline, categorize all $1,698.24 uncategorized expenses, renegotiate payment terms with top vendors to improve Current Ratio above 1.5x, and stabilize cash jitter below 20%.\n- **Days 61–90 (Scale & Institutionalize):** Hit 3-month revenue forecast ($120,123.55) or better, raise On-Time Delivery from 76.1% to ≥88%, and formalize quarterly rolling cash-flow & RFM retention scorecards across Finance, Sales, Operations, and HR."}]} | |
| {"messages": [{"role": "system", "content": "You are an expert ERP Analytics SQL & Data Engineer for Softsasi ERP (MySQL Laravel ERP schema and PostgreSQL/Prisma next-erp schema). Write accurate, multi-tenant-safe, production-ready analytical queries using exact schema tables and columns."}, {"role": "user", "content": "Write a MySQL query to compute Benford's Law first-digit observed percentages vs. expected Benford probabilities across all non-draft invoices for `created_by = ?`."}, {"role": "assistant", "content": "```sql\nWITH inv_totals AS (\n SELECT i.id,\n SUM((ip.price * ip.quantity) - COALESCE(ip.discount, 0)) AS total_amount\n FROM invoices i\n JOIN invoice_products ip ON ip.invoice_id = i.id\n WHERE i.created_by = ? AND i.status != 0\n GROUP BY i.id\n HAVING total_amount >= 1\n),\ndigits AS (\n SELECT CAST(LEFT(REPLACE(CAST(FLOOR(total_amount) AS CHAR), '0', ''), 1) AS UNSIGNED) AS first_digit\n FROM inv_totals\n),\ncounts AS (\n SELECT first_digit, COUNT(*) AS cnt, SUM(COUNT(*)) OVER () AS total_cnt\n FROM digits\n WHERE first_digit BETWEEN 1 AND 9\n GROUP BY first_digit\n)\nSELECT c.first_digit,\n c.cnt AS invoice_count,\n ROUND(c.cnt * 100.0 / c.total_cnt, 1) AS observed_pct,\n ROUND(LOG10(1 + 1.0 / c.first_digit) * 100.0, 1) AS expected_benford_pct,\n ROUND(ABS((c.cnt * 100.0 / c.total_cnt) - (LOG10(1 + 1.0 / c.first_digit) * 100.0)), 1) AS abs_deviation_pct\nFROM counts c\nORDER BY c.first_digit;\n```"}]} | |
| {"messages": [{"role": "system", "content": "You are a structured Business Intelligence API engine for Softsasi ERP. Respond strictly with valid JSON matching the requested analytics schema, with accurate calculations and no surrounding markdown."}, {"role": "user", "content": "Score RFM and output JSON (`customer`, `rfm_scores`, `segment`, `churn_risk`, `recommended_action`) using Softsasi ERP thresholds: Customer='Client-989', DaysSinceLastPurchase=53, PaidInvoices=12, TotalRevenue=$486.36."}, {"role": "assistant", "content": "{\"customer\": \"Client-989\", \"rfm_scores\": {\"R\": 4, \"F\": 5, \"M\": 1}, \"segment\": \"Loyal Customer\", \"churn_risk\": \"low\", \"recommended_action\": \"Pitch cross-sell product bundle\"}"}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Assistant, an expert business intelligence analyst grounded in the company's live ERP financials, CRM pipeline, projects, inventory, and HR metrics. Give concise, quantitative, actionable answers.\n\n--- COMPANY CONTEXT ---\nYou are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Horizon EdTech Ltd. (Subscription EdTech)\nANALYSIS DATE: 2026-07-18 12:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $630,590.63\n• Total Expenses: $901,232.17\n• Net Profit: $-270,641.54\n• Outstanding Receivables: $116,020.97 (Overdue: $60,107.28)\n• Outstanding Payables: $307,624.61\n• Bank Balance: $57,352.05\n• Cash Runway: 2.5 months (Status: Critical)\n• Monthly Burn Rate: $22,553.46\n• Cash Flow Volatility (Jitter): 41.8% (Level: High (Unstable))\n• Financial Forensics (Benford's Law): Risk Level Medium. Detected unnatural patterns in invoice amounts: leading digit 5 appears 28.3% vs expected 7.9%.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 68 (New: 10)\n• Pipeline Value: $391,014.32\n• Conversion Rate: 15.5%\n• Customer Segments (RFM):\n - Champion: 5 customers\n - Loyal Customer: 16 customers\n - New Potential: 7 customers\n - At Risk: 3 customers\n - Cant Lose Them: 0 customers\n - Hibernating: 7 customers\n• RFM Insight: 3 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $136,680.52\n• Predicted Growth: -13.3%\n• Overall Risk Score: 75/100 (High)\n• Inventory Risks: 1 items arriving at stockout levels soon.\n• Employee Retention: 2 employees flagged as flight risks.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: -42.9%\n• Current Ratio: 0.19\n• On-Time Delivery: 63.5%\n• Revenue Per Employee: $18,016.88\n"}, {"role": "user", "content": "Benford's Law risk is Medium (Detected unnatural patterns in invoice amounts: leading digit 5 appears 28.3% vs expected 7.9%.). What specific ERP audit checks should our controller run?"}, {"role": "assistant", "content": "With **Benford Risk = Medium** (leading digit **5** at **28.3%** vs. expected **7.9%**), execute this targeted forensic check in Softsasi ERP:\n\n1. **Split-Invoice Detection:** Query `invoices` and `bills` grouped by `customer_id` / `vender_id` and `issue_date` within 48-hour windows whose combined sum crosses an approval limit (e.g., multiple $5,900 bills instead of one approval).\n2. **Duplicate & Round-Number Audit:** Filter `invoice_products` and `bill_products` where line totals start with `5` and end in `.00` or duplicate identical amounts within 14 days.\n3. **Manual Override Review:** Cross-check `activity_logs` / `log_activities` for post-issue edits to `price`, `discount`, or `status`."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Business Analyst, an elite financial strategist, operational controller, and BI advisor. Analyze structured ERP telemetry accurately, reference exact figures without inventing data, and deliver direct, high-impact executive guidance."}, {"role": "user", "content": "You are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Sylhet Tea & Estates (Agro Exports)\nANALYSIS DATE: 2026-11-22 19:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $577,148.71\n• Total Expenses: $887,300.32\n• Net Profit: $-310,151.61\n• Outstanding Receivables: $163,709.25 (Overdue: $93,451.49)\n• Outstanding Payables: $334,100.83\n• Bank Balance: $68,821.87\n• Cash Runway: 2.7 months (Status: Critical)\n• Monthly Burn Rate: $25,845.97\n• Cash Flow Volatility (Jitter): 44.3% (Level: High (Unstable))\n• Financial Forensics (Benford's Law): Risk Level Medium. Detected unnatural patterns in invoice amounts: leading digit 4 appears 30.4% vs expected 9.7%.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 140 (New: 21)\n• Pipeline Value: $269,533.29\n• Conversion Rate: 12.1%\n• Customer Segments (RFM):\n - Champion: 18 customers\n - Loyal Customer: 37 customers\n - New Potential: 5 customers\n - At Risk: 14 customers\n - Cant Lose Them: 4 customers\n - Hibernating: 19 customers\n• RFM Insight: 14 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $134,764.22\n• Predicted Growth: -6.6%\n• Overall Risk Score: 75/100 (High)\n• Inventory Risks: 2 items arriving at stockout levels soon.\n• Employee Retention: 3 employees flagged as flight risks.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: -53.7%\n• Current Ratio: 0.21\n• On-Time Delivery: 67.9%\n• Revenue Per Employee: $10,687.94\n\n---\n\nBased on this expanded data, provide a comprehensive strategic analysis.\nIMPORTANT: Specifically address the Cash Runway, Fraud Risks (Benford), and Customer Segmentation (RFM) in your insights if they show concerning values.\nProvide:\n1. **Executive Summary** (Holistic health check)\n2. **Critical Alerts** (Immediate attention items)\n3. **Strategic Opportunities** (Growth & Optimization)\n4. **Risk Mitigation** (Financial, Operational, & Talent)\n5. **30-60-90 Day Plan**\nUse markdown. Be sharp, direct, and professional."}, {"role": "assistant", "content": "## 1. Executive Summary\nSylhet Tea & Estates is under acute financial pressure, posting a net loss of $310,151.61 (-53.7% margin), -6.6% growth trajectory, and a High overall risk score (75/100). Over the trailing window, revenue stands at **$577,148.71** against expenses of **$887,300.32** ($10,687.94/employee across ~54 staff), while 3-month revenue is projected at **$134,764.22** (-6.6% growth trend).\n\n## 2. Critical Alerts\n- **Cash Runway (Critical — 2.7 months):** At a net monthly burn of $25,845.97, $68,821.87 in bank balances provides narrow margin for error. Immediate spend freeze on non-revenue items and accelerated collections are mandatory.\n- **Payables Coverage Gap ($265,278.96):** Outstanding payables ($334,100.83) exceed cash on hand ($68,821.87), pushing Current Ratio to 0.21x.\n- **Receivables Delinquency (57.1% Overdue):** $93,451.49 of $163,709.25 total AR is past due. Collecting just 50% unlocks **$46,725.75** in immediate liquidity.\n- **Benford's Law Forensic Alert (Medium Risk):** Invoices beginning with digit **4** occur at **30.4%** vs. Benford baseline **9.7%**. Audit invoices starting with 4 for threshold-splitting, round-number estimates, or duplicate entries.\n- **Cash Flow Volatility (44.3% Jitter — High (Unstable)):** High revenue dispersion strains payroll and vendor commitments; maintain a minimum 3-month liquidity buffer.\n- **Imminent Inventory Stockouts (2 SKUs):** Replenishment orders must be triggered immediately to avoid lost invoiced revenue.\n- **Delivery & Talent Strain:** On-Time Delivery sits at 67.9% with 3 employees flagged for retention risk across the 54-person team.\n\n## 3. Strategic Opportunities\n- **Pipeline Conversion Capture:** Closing active pipeline ($269,533.29) at your current 12.1% rate yields ~**$32,613.53**; lifting conversion by 5 percentage points adds **$13,476.66** without extra marketing spend.\n- **RFM Revenue Expansion & Retention:** Mobilize 18 Champions and 37 Loyal accounts for annual/bundled upsells while deploying executive outreach to 4 'Cant Lose Them' and 14 'At Risk' customers.\n- **Hibernating Reactivation:** Target 19 hibernating accounts with a time-boxed win-back offer tied to your highest-margin SKUs.\n\n## 4. Risk Mitigation\n- **Financial & Working Capital:** Enforce automated dunning at +7/+15/+30 days overdue, offer 1.5–2% early-settlement discounts on invoices >30 days old, and align vendor payment schedules with receivables inflows.\n- **Controls & Forensics:** Require dual sign-off on all invoices/bills starting with digit 4 and freeze manual round-sum overrides pending audit.\n- **Operations & Talent:** Pre-position safety stock on the 2 stockout-risk SKUs and qualify backup suppliers for the 0 bottleneck vendors. Conduct stay-interviews and workload rebalancing for the 3 flight-risk staff.\n\n## 5. 30-60-90 Day Plan\n- **Days 1–30 (Stabilize & Recover):** Collect ≥40% of $93,451.49 overdue AR ($37,380.60), audit digit-4 invoices for Benford anomalies, issue POs for 2 stockout-risk items, and contact all 18 At-Risk / Can't-Lose customers.\n- **Days 31–60 (Optimize & Convert):** Lift lead-to-deal and closing velocity on $269,533.29 active pipeline, renegotiate payment terms with top vendors to improve Current Ratio above 1.5x, and stabilize cash jitter below 20%.\n- **Days 61–90 (Scale & Institutionalize):** Hit 3-month revenue forecast ($134,764.22) or better, raise On-Time Delivery from 67.9% to ≥88%, and formalize quarterly rolling cash-flow & RFM retention scorecards across Finance, Sales, Operations, and HR."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Business Analyst, an elite financial strategist, operational controller, and BI advisor. Analyze structured ERP telemetry accurately, reference exact figures without inventing data, and deliver direct, high-impact executive guidance."}, {"role": "user", "content": "You are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Urban Dine Hospitality (Multi-Unit F&B)\nANALYSIS DATE: 2026-07-24 09:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $319,882.15\n• Total Expenses: $289,889.62\n• Net Profit: $29,992.53\n• Outstanding Receivables: $68,455.51 (Overdue: $30,475.47)\n• Outstanding Payables: $41,799.75\n• Bank Balance: $52,388.68\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-2,499.38\n• Cash Flow Volatility (Jitter): 52.5% (Level: High (Unstable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 213 (New: 20)\n• Pipeline Value: $152,178.25\n• Conversion Rate: 24.4%\n• Customer Segments (RFM):\n - Champion: 6 customers\n - Loyal Customer: 36 customers\n - New Potential: 14 customers\n - At Risk: 6 customers\n - Cant Lose Them: 6 customers\n - Hibernating: 24 customers\n• RFM Insight: 6 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $77,651.39\n• Predicted Growth: -2.9%\n• Overall Risk Score: 0/100 (Low)\n• Inventory Risks: 3 items arriving at stockout levels soon.\n• Employee Retention: 1 employees flagged as flight risks.\n• Supply Chain: 1 bottleneck issues detected.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 9.4%\n• Current Ratio: 1.25\n• On-Time Delivery: 77.7%\n• Revenue Per Employee: $4,208.98\n\n---\n\nBased on this expanded data, provide a comprehensive strategic analysis.\nIMPORTANT: Specifically address the Cash Runway, Fraud Risks (Benford), and Customer Segmentation (RFM) in your insights if they show concerning values.\nProvide:\n1. **Executive Summary** (Holistic health check)\n2. **Critical Alerts** (Immediate attention items)\n3. **Strategic Opportunities** (Growth & Optimization)\n4. **Risk Mitigation** (Financial, Operational, & Talent)\n5. **30-60-90 Day Plan**\nUse markdown. Be sharp, direct, and professional."}, {"role": "assistant", "content": "## 1. Executive Summary\nUrban Dine Hospitality is operating from a position of healthy profitability ($29,992.53 net profit; 9.4% margin) and strong short-term liquidity (Current Ratio 1.25x, $52,388.68 cash vs. $41,799.75 payables). Over the trailing window, revenue stands at **$319,882.15** against expenses of **$289,889.62** ($4,208.98/employee across ~76 staff), while 3-month revenue is projected at **$77,651.39** (-2.9% growth trend).\n\n## 2. Critical Alerts\n- **Receivables Delinquency (44.5% Overdue):** $30,475.47 of $68,455.51 total AR is past due. Collecting just 50% unlocks **$15,237.74** in immediate liquidity.\n- **Cash Flow Volatility (52.5% Jitter — High (Unstable)):** High revenue dispersion strains payroll and vendor commitments; maintain a minimum 3-month liquidity buffer.\n- **Imminent Inventory Stockouts (3 SKUs):** Replenishment orders must be triggered immediately to avoid lost invoiced revenue.\n\n## 3. Strategic Opportunities\n- **Pipeline Conversion Capture:** Closing active pipeline ($152,178.25) at your current 24.4% rate yields ~**$37,131.49**; lifting conversion by 5 percentage points adds **$7,608.91** without extra marketing spend.\n- **RFM Revenue Expansion & Retention:** Mobilize 6 Champions and 36 Loyal accounts for annual/bundled upsells while deploying executive outreach to 6 'Cant Lose Them' and 6 'At Risk' customers.\n- **Hibernating Reactivation:** Target 24 hibernating accounts with a time-boxed win-back offer tied to your highest-margin SKUs.\n\n## 4. Risk Mitigation\n- **Financial & Working Capital:** Enforce automated dunning at +7/+15/+30 days overdue, offer 1.5–2% early-settlement discounts on invoices >30 days old, and align vendor payment schedules with receivables inflows.\n- **Controls & Forensics:** Maintain monthly Benford leading-digit checks and quarterly chart-of-accounts expense reviews.\n- **Operations & Talent:** Pre-position safety stock on the 3 stockout-risk SKUs and qualify backup suppliers for the 1 bottleneck vendors. Conduct stay-interviews and workload rebalancing for the 1 flight-risk staff.\n\n## 5. 30-60-90 Day Plan\n- **Days 1–30 (Stabilize & Recover):** Collect ≥40% of $30,475.47 overdue AR ($12,190.19), issue POs for 3 stockout-risk items, and contact all 12 At-Risk / Can't-Lose customers.\n- **Days 31–60 (Optimize & Convert):** Lift lead-to-deal and closing velocity on $152,178.25 active pipeline, renegotiate payment terms with top vendors to improve Current Ratio above 1.5x, and stabilize cash jitter below 20%.\n- **Days 61–90 (Scale & Institutionalize):** Hit 3-month revenue forecast ($77,651.39) or better, raise On-Time Delivery from 77.7% to ≥88%, and formalize quarterly rolling cash-flow & RFM retention scorecards across Finance, Sales, Operations, and HR."}]} | |
| {"messages": [{"role": "system", "content": "You are a quantitative financial & operations analyst. Compute business metrics, unit economics, forecasts, and inventory/working-capital formulas accurately step by step, then state a clear management takeaway."}, {"role": "user", "content": "Evaluate unit economics: ARPA=$886.79/mo, Gross Margin=83.6%, Monthly Logo Churn=4.0%, CAC=$2,202.62. Compute LTV, LTV:CAC ratio, and CAC Payback Period."}, {"role": "assistant", "content": "**SaaS / Recurring Unit Economics:**\n1. **Monthly Gross Profit / Account:** `$886.79 × 83.6%` = **$741.36/mo**\n2. **Customer LTV:** `$741.36 / 0.0400` = **$18,533.91**\n3. **LTV:CAC Ratio:** `18,533.91 / 2,202.62` = **8.41:1**\n4. **CAC Payback Period:** `2,202.62 / 741.36` = **3.0 months**\n\n**Management Takeaway:** Healthy unit economics (**8.41:1** ≥ 3:1 benchmark, **3.0-month** payback)."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Assistant, an expert business intelligence analyst grounded in the company's live ERP financials, CRM pipeline, projects, inventory, and HR metrics. Give concise, quantitative, actionable answers.\n\n--- COMPANY CONTEXT ---\nYou are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Horizon EdTech Ltd. (Subscription EdTech)\nANALYSIS DATE: 2026-04-23 15:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $514,279.00\n• Total Expenses: $640,069.47\n• Net Profit: $-125,790.47\n• Outstanding Receivables: $147,443.73 (Overdue: $110,559.22)\n• Outstanding Payables: $212,583.98\n• Bank Balance: $134,613.95\n• Cash Runway: 12.8 months (Status: Moderate)\n• Monthly Burn Rate: $10,482.54\n• Cash Flow Volatility (Jitter): 45.6% (Level: High (Unstable))\n• Financial Forensics (Benford's Law): Risk Level Medium. Detected unnatural patterns in invoice amounts: leading digit 8 appears 25.3% vs expected 5.1%.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 296 (New: 57)\n• Pipeline Value: $218,346.16\n• Conversion Rate: 11.0%\n• Customer Segments (RFM):\n - Champion: 12 customers\n - Loyal Customer: 31 customers\n - New Potential: 15 customers\n - At Risk: 16 customers\n - Cant Lose Them: 6 customers\n - Hibernating: 21 customers\n• RFM Insight: 16 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $102,984.37\n• Predicted Growth: -19.9%\n• Overall Risk Score: 100/100 (High)\n• Inventory Risks: 2 items arriving at stockout levels soon.\n• Employee Retention: 2 employees flagged as flight risks.\n• Supply Chain: 2 bottleneck issues detected.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: -24.5%\n• Current Ratio: 0.63\n• On-Time Delivery: 55.8%\n• Revenue Per Employee: $14,285.53\n"}, {"role": "user", "content": "আমাদের কোম্পানির বর্তমান আর্থিক স্বাস্থ্য, নগদ ঝুঁকি এবং আগামী ২ সপ্তাহের প্রধান করণীয় সংক্ষেপে বলুন।"}, {"role": "assistant", "content": "**Horizon EdTech Ltd. — সংক্ষিপ্ত আর্থিক পর্যালোচনা:**\n\n- **আয় বনাম ব্যয়:** মোট আয় **$514,279.00**, ব্যয় **$640,069.47**, নিট ফলাফল **$-125,790.47** (-24.5% মার্জিন)।\n- **নগদ ও তারল্য:** ব্যাংকে আছে **$134,613.95**, কিন্তু মেয়াদোত্তীর্ণ পাওনা **$110,559.22** এবং পরিশোধযোগ্য বিল **$212,583.98** (রানওয়ে: Moderate)।\n\n**আগামী ২ সপ্তাহের ৩টি প্রধান করণীয়:**\n১. **বকেয়া আদায় অভিযান:** মেয়াদোত্তীর্ণ **$110,559.22** থেকে অন্তত ৪০–৫০% দ্রুত সংগ্রহ করুন।\n২. **ঝুঁকিপূর্ণ গ্রাহক রক্ষা:** RFM অনুযায়ী **22** জন গুরুত্বপূর্ণ গ্রাহকের সাথে সরাসরি যোগাযোগ করুন।\n৩. **পাইপলাইন ও নিয়ন্ত্রণ:** **$218,346.16** সেলস পাইপলাইনে ফলো-আপ জোরদার করুন এবং বেনফোর্ড অডিট (Medium ঝুঁকি) সম্পন্ন করুন।"}]} | |
| {"messages": [{"role": "system", "content": "You are an expert ERP Analytics SQL & Data Engineer for Softsasi ERP (MySQL Laravel ERP schema and PostgreSQL/Prisma next-erp schema). Write accurate, multi-tenant-safe, production-ready analytical queries using exact schema tables and columns."}, {"role": "user", "content": "Generate a MySQL query to calculate invoice aging buckets (Current, 1-30, 31-60, 61-90, >90 days overdue) for open invoices in Softsasi ERP for `created_by = ?`."}, {"role": "assistant", "content": "```sql\nSELECT\n CASE\n WHEN i.due_date >= CURDATE() THEN 'Current'\n WHEN DATEDIFF(CURDATE(), i.due_date) BETWEEN 1 AND 30 THEN '1-30 Days'\n WHEN DATEDIFF(CURDATE(), i.due_date) BETWEEN 31 AND 60 THEN '31-60 Days'\n WHEN DATEDIFF(CURDATE(), i.due_date) BETWEEN 61 AND 90 THEN '61-90 Days'\n ELSE 'Over 90 Days'\n END AS aging_bucket,\n COUNT(*) AS invoice_count,\n ROUND(SUM(GREATEST(ip_tot.gross_total - COALESCE(pay_tot.paid, 0), 0)), 2) AS outstanding_amount\nFROM invoices i\nJOIN (\n SELECT invoice_id, SUM((price * quantity) - COALESCE(discount, 0)) AS gross_total\n FROM invoice_products\n GROUP BY invoice_id\n) ip_tot ON ip_tot.invoice_id = i.id\nLEFT JOIN (\n SELECT invoice_id, SUM(amount) AS paid\n FROM invoice_payments\n GROUP BY invoice_id\n) pay_tot ON pay_tot.invoice_id = i.id\nWHERE i.created_by = ?\n AND i.status NOT IN (0, 4)\nGROUP BY aging_bucket\nORDER BY FIELD(aging_bucket, 'Current', '1-30 Days', '31-60 Days', '61-90 Days', 'Over 90 Days');\n```"}]} | |
| {"messages": [{"role": "system", "content": "You are a quantitative financial & operations analyst. Compute business metrics, unit economics, forecasts, and inventory/working-capital formulas accurately step by step, then state a clear management takeaway."}, {"role": "user", "content": "Evaluate unit economics: ARPA=$633.55/mo, Gross Margin=81.4%, Monthly Logo Churn=4.9%, CAC=$696.94. Compute LTV, LTV:CAC ratio, and CAC Payback Period."}, {"role": "assistant", "content": "**SaaS / Recurring Unit Economics:**\n1. **Monthly Gross Profit / Account:** `$633.55 × 81.4%` = **$515.71/mo**\n2. **Customer LTV:** `$515.71 / 0.0490` = **$10,524.69**\n3. **LTV:CAC Ratio:** `10,524.69 / 696.94` = **15.1:1**\n4. **CAC Payback Period:** `696.94 / 515.71` = **1.4 months**\n\n**Management Takeaway:** Healthy unit economics (**15.1:1** ≥ 3:1 benchmark, **1.4-month** payback)."}]} | |
| {"messages": [{"role": "system", "content": "You are a structured Business Intelligence API engine for Softsasi ERP. Respond strictly with valid JSON matching the requested analytics schema, with accurate calculations and no surrounding markdown."}, {"role": "user", "content": "Categorize this uncategorized ERP bill into JSON (`vendor`, `description`, `amount`, `predicted_category`, `tax_deductible`, `audit_status`, `audit_note`): Vendor='Meta Platforms', Description='Meta Ads Campaign Q4', Amount=4814.63."}, {"role": "assistant", "content": "{\"vendor\": \"Meta Platforms\", \"description\": \"Meta Ads Campaign Q4\", \"amount\": 4814.63, \"predicted_category\": \"Marketing & Advertising\", \"tax_deductible\": true, \"audit_status\": \"clean\", \"audit_note\": \"Normal\"}"}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Assistant, an expert business intelligence analyst grounded in the company's live ERP financials, CRM pipeline, projects, inventory, and HR metrics. Give concise, quantitative, actionable answers.\n\n--- COMPANY CONTEXT ---\nYou are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: TechBazaar Electronics (Electronics Retail & B2B)\nANALYSIS DATE: 2026-10-26 09:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $344,361.60\n• Total Expenses: $304,375.17\n• Net Profit: $39,986.43\n• Outstanding Receivables: $88,111.58 (Overdue: $45,309.89)\n• Outstanding Payables: $70,832.39\n• Bank Balance: $78,711.55\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-3,332.20\n• Cash Flow Volatility (Jitter): 23.7% (Level: Medium (Variable))\n• Financial Forensics (Benford's Law): Risk Level High. Detected unnatural patterns in invoice amounts: leading digit 8 appears 24.0% vs expected 5.1%.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 152 (New: 13)\n• Pipeline Value: $193,155.31\n• Conversion Rate: 22.7%\n• Customer Segments (RFM):\n - Champion: 3 customers\n - Loyal Customer: 28 customers\n - New Potential: 13 customers\n - At Risk: 0 customers\n - Cant Lose Them: 2 customers\n - Hibernating: 18 customers\n• RFM Insight: Customer base looks healthy. Focus on upselling 'Loyal Customers'.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $93,408.08\n• Predicted Growth: 8.5%\n• Overall Risk Score: 0/100 (Low)\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 11.6%\n• Current Ratio: 1.11\n• On-Time Delivery: 87.0%\n• Revenue Per Employee: $9,307.07\n"}, {"role": "user", "content": "We have 152 total leads (13 new this month), $193,155.31 in pipeline, and a 22.7% conversion rate. Where is the highest-leverage revenue gain?"}, {"role": "assistant", "content": "At **22.7%** conversion, your **$193,155.31** active pipeline represents ~**$43,846.26** in expected bookings.\n\n- **Highest-Leverage Lever:** Your closing conversion (**22.7%**) is solid; focus on converting the backlog among **152** leads into active `deals` and accelerating average days-to-close.\n- **Next Step:** Audit deals idle >14 days in mid-funnel stages and enforce next-action dates in CRM."}]} | |
| {"messages": [{"role": "system", "content": "You are a quantitative financial & operations analyst. Compute business metrics, unit economics, forecasts, and inventory/working-capital formulas accurately step by step, then state a clear management takeaway."}, {"role": "user", "content": "A warehouse SKU sells 81.0 units/day with a 8-day supplier lead time and 5-day safety stock policy. Ordering cost is $110.43/PO and annual holding cost is $5.16/unit/year. Calculate Reorder Point (ROP) and EOQ."}, {"role": "assistant", "content": "**Inventory Optimization:**\n1. **Safety Stock:** `81.0 × 5` = **405 units**\n2. **Reorder Point (ROP):** `ceil(81.0 × (8 + 5))` = **1,053 units**\n3. **Annual Demand:** `81.0 × 365` ≈ **29,565 units**\n4. **Economic Order Quantity (EOQ):** `sqrt((2 × 29565 × 110.43) / 5.16)` ≈ **1,125 units/order**\n\n**Management Takeaway:** Trigger a purchase order of **1,125 units** as soon as warehouse stock reaches **1,053 units**."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Assistant, an expert business intelligence analyst grounded in the company's live ERP financials, CRM pipeline, projects, inventory, and HR metrics. Give concise, quantitative, actionable answers.\n\n--- COMPANY CONTEXT ---\nYou are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Softsasi Cloud Solutions (B2B SaaS)\nANALYSIS DATE: 2026-04-14 09:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $891,703.41\n• Total Expenses: $672,921.51\n• Net Profit: $218,781.90\n• Outstanding Receivables: $119,978.17 (Overdue: $9,348.75)\n• Outstanding Payables: $53,160.97\n• Bank Balance: $409,940.37\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-18,231.83\n• Cash Flow Volatility (Jitter): 7.4% (Level: Low (Stable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n• Expense Optimization: Found 11 uncategorized items totaling $9,178.57.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 326 (New: 40)\n• Pipeline Value: $246,715.22\n• Conversion Rate: 29.6%\n• Customer Segments (RFM):\n - Champion: 14 customers\n - Loyal Customer: 26 customers\n - New Potential: 2 customers\n - At Risk: 2 customers\n - Cant Lose Them: 1 customers\n - Hibernating: 5 customers\n• RFM Insight: 2 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $247,001.84\n• Predicted Growth: 10.8%\n• Overall Risk Score: 0/100 (Low)\n• Inventory Risks: 1 items arriving at stockout levels soon.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 24.5%\n• Current Ratio: 7.71\n• On-Time Delivery: 86.7%\n• Revenue Per Employee: $8,492.41\n"}, {"role": "user", "content": "Our profit margin is 24.5%, yet Current Ratio is 7.71x and overdue receivables are $9,348.75. What is trapping our cash and how much liquidity can we unlock in 30 days?"}, {"role": "assistant", "content": "Your liquidity squeeze is driven by **$119,978.17 in Accounts Receivable** (~**49 DSO**), with **$9,348.75** already past due against **$409,940.37** in bank cash and **$53,160.97** in payables.\n\n**30-Day Liquidity Recovery Impact:**\n- Collecting **50%** of overdue AR unlocks **$4,674.38**, lifting bank cash to **$414,614.74** and improving Current Ratio from **7.71x → 7.8x**.\n- Collecting **75%** unlocks **$7,011.56**.\n\n**Priority Actions:**\n1. Segment overdue invoices >60 days for immediate phone/executive escalation.\n2. Offer a 1.5% early-settlement credit on 15–45 day receivables.\n3. Match vendor bill payments to confirmed collection milestones."}, {"role": "user", "content": "Draft a concise 3-bullet action directive I can send to our Finance & AR Collector today."}, {"role": "assistant", "content": "**Subject: 30-Day AR Collection Sprint — Target $4,674.38 Cash Unlock**\n\n- **Top Overdue Accounts (>30 days):** Call every customer contributing to our $9,348.75 overdue balance by EOD tomorrow and lock written payment dates.\n- **Settlement Incentive:** Offer a 1.5% prompt-pay discount valid for 10 business days on invoices >$2,500.\n- **Weekly Cash Sync:** Report collected cash vs. our $53,160.97 payables queue every Monday at 9:00 AM until Current Ratio exceeds 1.25x."}]} | |
| {"messages": [{"role": "system", "content": "You are a structured Business Intelligence API engine for Softsasi ERP. Respond strictly with valid JSON matching the requested analytics schema, with accurate calculations and no surrounding markdown."}, {"role": "user", "content": "Return strict JSON (`company`, `health_grade`, `cash_risk`, `kpis`, `top_bottlenecks`, `recommended_actions`) summarizing this ERP snapshot for Bengal Digital Craft:\nRevenue=$821,023.55, Expenses=$615,358.77, NetProfit=$205,664.78, AR=$74,612.47 (Overdue=$11,785.71), AP=$57,271.15, Bank=$205,957.55, Runway=Healthy, Benford=Low, Pipeline=$373,643.91, Conv=43.5%, OnTime=93.5%, Stockouts=0, AtRiskRFM=5, CantLoseRFM=3, RiskScore=0."}, {"role": "assistant", "content": "{\"company\": \"Bengal Digital Craft\", \"health_grade\": \"A\", \"cash_risk\": \"low\", \"kpis\": {\"profit_margin_pct\": 25.0, \"current_ratio\": 3.6, \"dso_days\": 33, \"conversion_rate_pct\": 43.5, \"on_time_delivery_pct\": 93.5, \"risk_score\": 0}, \"top_bottlenecks\": [\"Overdue receivables ($11,785.71)\"], \"recommended_actions\": [{\"priority\": \"P0\", \"owner\": \"Finance\", \"action\": \"Collect 50% of overdue AR ($11,785.71)\", \"expected_cash_impact\": 5892.85}, {\"priority\": \"P1\", \"owner\": \"Sales\", \"action\": \"Engage 8 At-Risk/Cant-Lose RFM accounts & close $373,643.91 pipeline\", \"expected_revenue_impact\": 162535.1}]}"}]} | |
| {"messages": [{"role": "system", "content": "You are an expert ERP Analytics SQL & Data Engineer for Softsasi ERP (MySQL Laravel ERP schema and PostgreSQL/Prisma next-erp schema). Write accurate, multi-tenant-safe, production-ready analytical queries using exact schema tables and columns."}, {"role": "user", "content": "Write a MySQL query to calculate CRM deal funnel conversion rate, win value, loss rate, and average days to close per pipeline and stage for `created_by = ?`."}, {"role": "assistant", "content": "```sql\nSELECT\n p.name AS pipeline_name,\n s.name AS stage_name,\n COUNT(d.id) AS total_deals,\n SUM(CASE WHEN d.status = 'Won' THEN 1 ELSE 0 END) AS won_deals,\n SUM(CASE WHEN d.status = 'Loss' THEN 1 ELSE 0 END) AS lost_deals,\n SUM(CASE WHEN d.status = 'Active' THEN 1 ELSE 0 END) AS active_deals,\n ROUND(SUM(CASE WHEN d.status = 'Active' THEN d.price ELSE 0 END), 2) AS active_pipeline_value,\n ROUND(SUM(CASE WHEN d.status = 'Won' THEN d.price ELSE 0 END), 2) AS won_value,\n ROUND(\n AVG(CASE WHEN d.status = 'Won' THEN DATEDIFF(d.updated_at, d.created_at) END),\n 1\n ) AS avg_days_to_win\nFROM deals d\nLEFT JOIN pipelines p ON p.id = d.pipeline_id\nLEFT JOIN stages s ON s.id = d.stage_id\nWHERE d.created_by = ?\nGROUP BY p.id, p.name, s.id, s.name, s.`order`\nORDER BY p.name, s.`order`;\n```"}]} | |
| {"messages": [{"role": "system", "content": "You are a structured Business Intelligence API engine for Softsasi ERP. Respond strictly with valid JSON matching the requested analytics schema, with accurate calculations and no surrounding markdown."}, {"role": "user", "content": "Categorize this uncategorized ERP bill into JSON (`vendor`, `description`, `amount`, `predicted_category`, `tax_deductible`, `audit_status`, `audit_note`): Vendor='Dhaka Catering Co.', Description='Staff Lunch & Team Offsite', Amount=2646.13."}, {"role": "assistant", "content": "{\"vendor\": \"Dhaka Catering Co.\", \"description\": \"Staff Lunch & Team Offsite\", \"amount\": 2646.13, \"predicted_category\": \"Employee Welfare & Meals\", \"tax_deductible\": true, \"audit_status\": \"clean\", \"audit_note\": \"Normal\"}"}]} | |
| {"messages": [{"role": "system", "content": "You are a structured Business Intelligence API engine for Softsasi ERP. Respond strictly with valid JSON matching the requested analytics schema, with accurate calculations and no surrounding markdown."}, {"role": "user", "content": "Return strict JSON (`company`, `health_grade`, `cash_risk`, `kpis`, `top_bottlenecks`, `recommended_actions`) summarizing this ERP snapshot for Metro Hardware & Tools:\nRevenue=$1,021,840.73, Expenses=$951,700.70, NetProfit=$70,140.03, AR=$285,367.04 (Overdue=$102,683.98), AP=$141,676.18, Bank=$181,330.18, Runway=Healthy, Benford=Low, Pipeline=$580,008.80, Conv=27.6%, OnTime=78.0%, Stockouts=3, AtRiskRFM=6, CantLoseRFM=5, RiskScore=0."}, {"role": "assistant", "content": "{\"company\": \"Metro Hardware & Tools\", \"health_grade\": \"A\", \"cash_risk\": \"low\", \"kpis\": {\"profit_margin_pct\": 6.9, \"current_ratio\": 1.28, \"dso_days\": 102, \"conversion_rate_pct\": 27.6, \"on_time_delivery_pct\": 78.0, \"risk_score\": 0}, \"top_bottlenecks\": [\"Overdue receivables ($102,683.98)\", \"3 stockout-risk SKUs\"], \"recommended_actions\": [{\"priority\": \"P0\", \"owner\": \"Finance\", \"action\": \"Collect 50% of overdue AR ($102,683.98)\", \"expected_cash_impact\": 51341.99}, {\"priority\": \"P1\", \"owner\": \"Sales\", \"action\": \"Engage 11 At-Risk/Cant-Lose RFM accounts & close $580,008.80 pipeline\", \"expected_revenue_impact\": 160082.43}]}"}]} | |
| {"messages": [{"role": "system", "content": "You are an expert ERP Analytics SQL & Data Engineer for Softsasi ERP (MySQL Laravel ERP schema and PostgreSQL/Prisma next-erp schema). Write accurate, multi-tenant-safe, production-ready analytical queries using exact schema tables and columns."}, {"role": "user", "content": "Write a MySQL query to identify inventory items at risk of stockout within 30 days based on trailing 90-day paid invoice and POS sales velocity for `created_by = ?`."}, {"role": "assistant", "content": "```sql\nWITH inv_sales AS (\n SELECT ip.product_id, SUM(ip.quantity) AS qty_90d\n FROM invoice_products ip\n JOIN invoices i ON i.id = ip.invoice_id\n WHERE i.created_by = ? AND i.status = 4\n AND i.issue_date >= DATE_SUB(CURDATE(), INTERVAL 90 DAY)\n GROUP BY ip.product_id\n),\npos_sales AS (\n SELECT pp.product_id, SUM(pp.quantity) AS qty_90d\n FROM pos_products pp\n JOIN pos p ON p.id = pp.pos_id\n WHERE p.created_by = ?\n AND p.pos_date >= DATE_SUB(CURDATE(), INTERVAL 90 DAY)\n GROUP BY pp.product_id\n),\nwarehouse_stock AS (\n SELECT product_id, SUM(quantity) AS wh_qty\n FROM warehouse_products\n WHERE created_by = ?\n GROUP BY product_id\n)\nSELECT\n ps.id,\n ps.sku,\n ps.name,\n COALESCE(ws.wh_qty, ps.quantity, 0) AS current_stock,\n ROUND((COALESCE(iv.qty_90d, 0) + COALESCE(pv.qty_90d, 0)) / 90.0, 2) AS daily_velocity,\n ROUND(\n COALESCE(ws.wh_qty, ps.quantity, 0) / NULLIF((COALESCE(iv.qty_90d, 0) + COALESCE(pv.qty_90d, 0)) / 90.0, 0),\n 1\n ) AS estimated_days_left,\n CEIL(((COALESCE(iv.qty_90d, 0) + COALESCE(pv.qty_90d, 0)) / 90.0 * 30) - COALESCE(ws.wh_qty, ps.quantity, 0)) AS recommended_30d_reorder\nFROM product_services ps\nLEFT JOIN inv_sales iv ON iv.product_id = ps.id\nLEFT JOIN pos_sales pv ON pv.product_id = ps.id\nLEFT JOIN warehouse_stock ws ON ws.product_id = ps.id\nWHERE ps.created_by = ?\n AND ps.type = 'product'\n AND (COALESCE(iv.qty_90d, 0) + COALESCE(pv.qty_90d, 0)) > 0\nHAVING estimated_days_left < 30\nORDER BY estimated_days_left ASC;\n```"}]} | |
| {"messages": [{"role": "system", "content": "You are a quantitative financial & operations analyst. Compute business metrics, unit economics, forecasts, and inventory/working-capital formulas accurately step by step, then state a clear management takeaway."}, {"role": "user", "content": "Compute Unit Contribution Margin, Contribution Margin Ratio, and Monthly Break-Even Units & Revenue: Monthly Fixed Costs=$50,434.71, Selling Price=$259.87/unit, Variable Cost=$169.40/unit."}, {"role": "assistant", "content": "**Break-Even Analysis:**\n1. **Unit Contribution Margin:** `$259.87 - $169.40` = **$90.47/unit**\n2. **Contribution Margin Ratio:** `(90.47 / 259.87) × 100` = **34.8%**\n3. **Break-Even Volume:** `ceil(50,434.71 / 90.47)` = **558 units/month**\n4. **Break-Even Revenue:** `558 × $259.87` = **$145,007.46/month**\n\n**Management Takeaway:** Every unit sold above **558** contributes **$90.47** directly to operating profit."}]} | |
| {"messages": [{"role": "system", "content": "You are a structured Business Intelligence API engine for Softsasi ERP. Respond strictly with valid JSON matching the requested analytics schema, with accurate calculations and no surrounding markdown."}, {"role": "user", "content": "Categorize this uncategorized ERP bill into JSON (`vendor`, `description`, `amount`, `predicted_category`, `tax_deductible`, `audit_status`, `audit_note`): Vendor='Steadfast Logistics', Description='Courier & Last-Mile Delivery', Amount=8535.42."}, {"role": "assistant", "content": "{\"vendor\": \"Steadfast Logistics\", \"description\": \"Courier & Last-Mile Delivery\", \"amount\": 8535.42, \"predicted_category\": \"Shipping & Logistics\", \"tax_deductible\": true, \"audit_status\": \"clean\", \"audit_note\": \"Normal\"}"}]} | |
| {"messages": [{"role": "system", "content": "You are a quantitative financial & operations analyst. Compute business metrics, unit economics, forecasts, and inventory/working-capital formulas accurately step by step, then state a clear management takeaway."}, {"role": "user", "content": "Decompose revenue variance into Price Variance and Volume Variance: Budget = 1,531 units @ $200.48; Actual = 1,723 units @ $197.78."}, {"role": "assistant", "content": "**Revenue Variance Decomposition:**\n- **Budget Revenue:** `$306,934.88` | **Actual Revenue:** `$340,774.94` | **Total Variance:** `$+33,840.06`\n1. **Price Variance:** `($197.78 - $200.48) × 1,723` = **$-4,652.10** (Unfavorable)\n2. **Volume Variance:** `(1,723 - 1,531) × $200.48` = **$+38,492.16** (Favorable)\n3. **Check:** `$-4,652.10 + $+38,492.16 = $+33,840.06`\n\n**Management Takeaway:** Discounting eroded margin—tighten deal price floors."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Assistant, an expert business intelligence analyst grounded in the company's live ERP financials, CRM pipeline, projects, inventory, and HR metrics. Give concise, quantitative, actionable answers.\n\n--- COMPANY CONTEXT ---\nYou are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Padma FMCG Distributors (Wholesale Distribution)\nANALYSIS DATE: 2026-10-15 19:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $798,672.93\n• Total Expenses: $656,736.14\n• Net Profit: $141,936.79\n• Outstanding Receivables: $135,605.34 (Overdue: $43,123.42)\n• Outstanding Payables: $112,127.73\n• Bank Balance: $225,124.25\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-11,828.07\n• Cash Flow Volatility (Jitter): 14.6% (Level: Low (Stable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 403 (New: 53)\n• Pipeline Value: $476,144.47\n• Conversion Rate: 20.4%\n• Customer Segments (RFM):\n - Champion: 5 customers\n - Loyal Customer: 34 customers\n - New Potential: 8 customers\n - At Risk: 6 customers\n - Cant Lose Them: 7 customers\n - Hibernating: 12 customers\n• RFM Insight: 6 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $209,851.31\n• Predicted Growth: 5.1%\n• Overall Risk Score: 0/100 (Low)\n• Employee Retention: 6 employees flagged as flight risks.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 17.8%\n• Current Ratio: 2.01\n• On-Time Delivery: 47.6%\n• Revenue Per Employee: $14,262.02\n"}, {"role": "user", "content": "Analyze our HR & Delivery efficiency: Revenue/Employee is $14,262.02, On-Time Delivery is 47.6%, and 6 employees are flagged for retention risk."}, {"role": "assistant", "content": "**HR & Delivery Diagnostic:**\n- **Revenue/Employee:** **$14,262.02** (below $50k target; prioritize utilization and automation before adding headcount).\n- **Delivery Health:** **47.6%** On-Time Delivery needs urgent milestone triage on overdue tasks.\n- **Retention Risk (6 flagged):** Conduct 1-on-1 stay interviews within 2 weeks, review compensation bands for key contributors, and redistribute overloaded project tasks before attrition disrupts client delivery."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Business Analyst, an elite financial strategist, operational controller, and BI advisor. Analyze structured ERP telemetry accurately, reference exact figures without inventing data, and deliver direct, high-impact executive guidance."}, {"role": "user", "content": "You are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Sylhet Tea & Estates (Agro Exports)\nANALYSIS DATE: 2026-07-23 13:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $888,985.80\n• Total Expenses: $667,089.72\n• Net Profit: $221,896.08\n• Outstanding Receivables: $84,664.41 (Overdue: $15,020.39)\n• Outstanding Payables: $73,107.36\n• Bank Balance: $255,112.86\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-18,491.34\n• Cash Flow Volatility (Jitter): 12.3% (Level: Low (Stable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 365 (New: 51)\n• Pipeline Value: $303,904.33\n• Conversion Rate: 40.7%\n• Customer Segments (RFM):\n - Champion: 17 customers\n - Loyal Customer: 28 customers\n - New Potential: 2 customers\n - At Risk: 0 customers\n - Cant Lose Them: 2 customers\n - Hibernating: 14 customers\n• RFM Insight: Customer base looks healthy. Focus on upselling 'Loyal Customers'.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $281,808.50\n• Predicted Growth: 26.8%\n• Overall Risk Score: 0/100 (Low)\n• Inventory Risks: 1 items arriving at stockout levels soon.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 25.0%\n• Current Ratio: 3.49\n• On-Time Delivery: 85.6%\n• Revenue Per Employee: $9,260.27\n\n---\n\nBased on this expanded data, provide a comprehensive strategic analysis.\nIMPORTANT: Specifically address the Cash Runway, Fraud Risks (Benford), and Customer Segmentation (RFM) in your insights if they show concerning values.\nProvide:\n1. **Executive Summary** (Holistic health check)\n2. **Critical Alerts** (Immediate attention items)\n3. **Strategic Opportunities** (Growth & Optimization)\n4. **Risk Mitigation** (Financial, Operational, & Talent)\n5. **30-60-90 Day Plan**\nUse markdown. Be sharp, direct, and professional.\n\nIMPORTANT: Write your ENTIRE response in Bangla. All headings, analysis, recommendations, and text must be in Bangla."}, {"role": "assistant", "content": "## ১. নির্বাহী সারসংক্ষেপ (Executive Summary)\n**Sylhet Tea & Estates**-এর সামগ্রিক বিশ্লেষণে দেখা যাচ্ছে, মোট আয় **$888,985.80** এবং ব্যয় **$667,089.72**; কোম্পানিটি বর্তমানে **লাভজনক** অবস্থায় রয়েছে (নিট মুনাফা **$221,896.08**, প্রফিট মার্জিন **25.0%**)। ব্যাংক ব্যালেন্স **$255,112.86**, যেখানে কারেন্ট রেশিও **3.49x** এবং ঝুঁকি স্কোর **0/100 (Low)**। আগামী ৩ মাসের প্রক্ষেপিত আয় **$281,808.50** (প্রবৃদ্ধি **26.8%**)।\n\n## ২. জরুরি সতর্কবার্তা (Critical Alerts)\n- **ক্যাশ রানওয়ে ও তারল্য:** বর্তমান অবস্থা **Healthy** (Unlimited (Profitable) months, মাসিক বার্ন $-18,491.34)। বকেয়া প্রাপ্য (Receivables) **$84,664.41**, যার মধ্যে **$15,020.39** মেয়াদোত্তীর্ণ। ৫০% বকেয়া আদায় করলে তাৎক্ষণিক **$7,510.19** নগদ প্রবাহ বাড়বে।\n- **আর্থিক ফরেনসিক (Benford's Law):** বেনফোর্ডের সূত্র অনুযায়ী আর্থিক লেনদেনের প্যাটার্ন **স্বাভাবিক (Low Risk)** রয়েছে।\n- **ক্যাশ ফ্লো অস্থিরতা (Jitter):** অস্থিরতা সূচক **12.3% (Low (Stable))**।\n- **ইনভেন্টরি ও সাপ্লাই চেইন:** 1টি পণ্যে স্টক শেষ হওয়ার ঝুঁকি এবং 0টি সরবরাহ চেইন জটিলতা রয়েছে।\n\n## ৩. কৌশলগত সুযোগ (Strategic Opportunities)\n- **সেলস পাইপলাইন রূপান্তর:** সক্রিয় পাইপলাইন **$303,904.33** (কনভার্সন রেট **40.7%**, প্রত্যাশিত আয় ~**$123,689.06**) এবং **365**টি লিড ফলো-আপ করে বিক্রয় বাড়ানো সম্ভব।\n- **RFM গ্রাহক ধরে রাখা:** **17** জন চ্যাম্পিয়ন ও **28** জন বিশ্বস্ত গ্রাহককে আপসেল করুন এবং ঝুঁকিতে থাকা **2** জন গুরুত্বপূর্ণ গ্রাহকের সাথে সরাসরি যোগাযোগ করুন।\n\n## ৪. ঝুঁকি প্রশমন (Risk Mitigation)\n- **অর্থ ও বকেয়া ব্যবস্থাপনা:** মেয়াদোত্তীর্ণ ইনভয়েসে ৭/১৫/৩০ দিনের স্বয়ংক্রিয় রিমাইন্ডার চালু করুন এবং প্রদেয় বিলের (Payables: $73,107.36) সাথে নগদ আদায়ের সময়সূচি সমন্বয় করুন।\n- **অপারেশন ও কর্মী ব্যবস্থাপনা:** অন-টাইম ডেলিভারি (**85.6%**) বাড়াতে বিলম্বিত প্রজেক্টগুলো পুনর্মূল্যায়ন করুন।\n\n## ৫. ৩০-৬০-৯০ দিনের কর্মপরিকল্পনা\n- **প্রথম ৩০ দিন:** মেয়াদোত্তীর্ণ বকেয়ার অন্তত ৪০% আদায় ($6,008.16), ঝুঁকিপূর্ণ গ্রাহকদের সাথে যোগাযোগ ও প্রয়োজনীয় অডিট সম্পন্ন করা।\n- **৩১–৬০ দিন:** পাইপলাইন ডিল ক্লোজিং গতি বাড়ানো, অশ্রেণিবদ্ধ খরচ সমন্বয় এবং ভেন্ডর পেমেন্ট শর্ত পুনর্নির্ধারণ।\n- **৬১–৯০ দিন:** ৩ মাসের আয় লক্ষ্যমাত্রা (**$281,808.50**) অর্জন এবং মাসিক ক্যাশ-ফ্লো ও RFM ড্যাশবোর্ড পর্যালোচনা স্থায়ী করা।"}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Business Analyst, an elite financial strategist, operational controller, and BI advisor. Analyze structured ERP telemetry accurately, reference exact figures without inventing data, and deliver direct, high-impact executive guidance."}, {"role": "user", "content": "You are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: TechBazaar Electronics (Electronics Retail & B2B)\nANALYSIS DATE: 2026-11-05 09:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $530,414.15\n• Total Expenses: $480,983.63\n• Net Profit: $49,430.52\n• Outstanding Receivables: $85,745.65 (Overdue: $22,124.09)\n• Outstanding Payables: $89,413.29\n• Bank Balance: $107,127.30\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-4,119.21\n• Cash Flow Volatility (Jitter): 26.7% (Level: Medium (Variable))\n• Financial Forensics (Benford's Law): Risk Level Low. Your invoice distribution matches expected natural patterns.\n• Expense Optimization: Found 9 uncategorized items totaling $7,616.06.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 401 (New: 99)\n• Pipeline Value: $223,681.32\n• Conversion Rate: 18.6%\n• Customer Segments (RFM):\n - Champion: 14 customers\n - Loyal Customer: 16 customers\n - New Potential: 16 customers\n - At Risk: 2 customers\n - Cant Lose Them: 0 customers\n - Hibernating: 12 customers\n• RFM Insight: 2 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $136,449.04\n• Predicted Growth: 2.9%\n• Overall Risk Score: 15/100 (Low)\n• Inventory Risks: 1 items arriving at stockout levels soon.\n• Employee Retention: 5 employees flagged as flight risks.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 9.3%\n• Current Ratio: 1.2\n• On-Time Delivery: 64.7%\n• Revenue Per Employee: $9,145.07\n\n---\n\nBased on this expanded data, provide a comprehensive strategic analysis.\nIMPORTANT: Specifically address the Cash Runway, Fraud Risks (Benford), and Customer Segmentation (RFM) in your insights if they show concerning values.\nProvide:\n1. **Executive Summary** (Holistic health check)\n2. **Critical Alerts** (Immediate attention items)\n3. **Strategic Opportunities** (Growth & Optimization)\n4. **Risk Mitigation** (Financial, Operational, & Talent)\n5. **30-60-90 Day Plan**\nUse markdown. Be sharp, direct, and professional."}, {"role": "assistant", "content": "## 1. Executive Summary\nTechBazaar Electronics is operating from a position of healthy profitability ($49,430.52 net profit; 9.3% margin) and strong short-term liquidity (Current Ratio 1.2x, $107,127.30 cash vs. $89,413.29 payables). Over the trailing window, revenue stands at **$530,414.15** against expenses of **$480,983.63** ($9,145.07/employee across ~58 staff), while 3-month revenue is projected at **$136,449.04** (2.9% growth trend).\n\n## 2. Critical Alerts\n- **Delivery & Talent Strain:** On-Time Delivery sits at 64.7% with 5 employees flagged for retention risk across the 58-person team.\n\n## 3. Strategic Opportunities\n- **Pipeline Conversion Capture:** Closing active pipeline ($223,681.32) at your current 18.6% rate yields ~**$41,604.73**; lifting conversion by 5 percentage points adds **$11,184.07** without extra marketing spend.\n- **RFM Revenue Expansion & Retention:** Mobilize 14 Champions and 16 Loyal accounts for annual/bundled upsells while deploying executive outreach to 0 'Cant Lose Them' and 2 'At Risk' customers.\n- **Smart Expense & Tax Recovery:** Classifying the 9 uncategorized bills ($7,616.06) sharpens cost-center visibility and prevents missed tax deductions.\n- **Hibernating Reactivation:** Target 12 hibernating accounts with a time-boxed win-back offer tied to your highest-margin SKUs.\n\n## 4. Risk Mitigation\n- **Financial & Working Capital:** Enforce automated dunning at +7/+15/+30 days overdue, offer 1.5–2% early-settlement discounts on invoices >30 days old, and align vendor payment schedules with receivables inflows.\n- **Controls & Forensics:** Maintain monthly Benford leading-digit checks and quarterly chart-of-accounts expense reviews.\n- **Operations & Talent:** Pre-position safety stock on the 1 stockout-risk SKUs and qualify backup suppliers for the 0 bottleneck vendors. Conduct stay-interviews and workload rebalancing for the 5 flight-risk staff.\n\n## 5. 30-60-90 Day Plan\n- **Days 1–30 (Stabilize & Recover):** Collect ≥40% of $22,124.09 overdue AR ($8,849.64), issue POs for 1 stockout-risk items, and contact all 2 At-Risk / Can't-Lose customers.\n- **Days 31–60 (Optimize & Convert):** Lift lead-to-deal and closing velocity on $223,681.32 active pipeline, categorize all $7,616.06 uncategorized expenses, renegotiate payment terms with top vendors to improve Current Ratio above 1.5x, and stabilize cash jitter below 20%.\n- **Days 61–90 (Scale & Institutionalize):** Hit 3-month revenue forecast ($136,449.04) or better, raise On-Time Delivery from 64.7% to ≥88%, and formalize quarterly rolling cash-flow & RFM retention scorecards across Finance, Sales, Operations, and HR."}]} | |
| {"messages": [{"role": "system", "content": "You are Softsasi ERP AI Business Analyst, an elite financial strategist, operational controller, and BI advisor. Analyze structured ERP telemetry accurately, reference exact figures without inventing data, and deliver direct, high-impact executive guidance."}, {"role": "user", "content": "You are an expert Business Analyst and Strategic Consultant. Analyze the following comprehensive company data and provide strategic insights.\n\nCOMPANY: Horizon EdTech Ltd. (Subscription EdTech)\nANALYSIS DATE: 2026-07-06 12:15:00\n\n=== FINANCIAL OVERVIEW ===\n• Total Revenue: $592,969.24\n• Total Expenses: $500,436.55\n• Net Profit: $92,532.69\n• Outstanding Receivables: $143,417.57 (Overdue: $77,873.63)\n• Outstanding Payables: $81,159.48\n• Bank Balance: $166,564.08\n• Cash Runway: Unlimited (Profitable) months (Status: Healthy)\n• Monthly Burn Rate: $-7,711.06\n• Cash Flow Volatility (Jitter): 19.8% (Level: Medium (Variable))\n• Financial Forensics (Benford's Law): Risk Level Medium. Detected unnatural patterns in invoice amounts: leading digit 9 appears 30.3% vs expected 4.6%.\n\n=== SALES & CUSTOMER INTELLIGENCE ===\n• Total Leads: 361 (New: 21)\n• Pipeline Value: $321,079.57\n• Conversion Rate: 20.6%\n• Customer Segments (RFM):\n - Champion: 8 customers\n - Loyal Customer: 36 customers\n - New Potential: 2 customers\n - At Risk: 2 customers\n - Cant Lose Them: 1 customers\n - Hibernating: 4 customers\n• RFM Insight: 2 high-value customers are at risk (haven't bought recently). Contact them ASAP.\n\n=== OPERATIONAL RISKS & FORECASTS ===\n• Revenue Forecast (3mo): $160,694.66\n• Predicted Growth: 8.4%\n• Overall Risk Score: 0/100 (Low)\n• Inventory Risks: 2 items arriving at stockout levels soon.\n• Employee Retention: 1 employees flagged as flight risks.\n• Supply Chain: 1 bottleneck issues detected.\n\n=== KEY PERFORMANCE INDICATORS ===\n• Profit Margin: 15.6%\n• Current Ratio: 2.05\n• On-Time Delivery: 88.7%\n• Revenue Per Employee: $5,813.42\n\n---\n\nBased on this expanded data, provide a comprehensive strategic analysis.\nIMPORTANT: Specifically address the Cash Runway, Fraud Risks (Benford), and Customer Segmentation (RFM) in your insights if they show concerning values.\nProvide:\n1. **Executive Summary** (Holistic health check)\n2. **Critical Alerts** (Immediate attention items)\n3. **Strategic Opportunities** (Growth & Optimization)\n4. **Risk Mitigation** (Financial, Operational, & Talent)\n5. **30-60-90 Day Plan**\nUse markdown. Be sharp, direct, and professional."}, {"role": "assistant", "content": "## 1. Executive Summary\nHorizon EdTech Ltd. is operating from a position of healthy profitability ($92,532.69 net profit; 15.6% margin) and strong short-term liquidity (Current Ratio 2.05x, $166,564.08 cash vs. $81,159.48 payables). Over the trailing window, revenue stands at **$592,969.24** against expenses of **$500,436.55** ($5,813.42/employee across ~102 staff), while 3-month revenue is projected at **$160,694.66** (8.4% growth trend).\n\n## 2. Critical Alerts\n- **Receivables Delinquency (54.3% Overdue):** $77,873.63 of $143,417.57 total AR is past due. Collecting just 50% unlocks **$38,936.82** in immediate liquidity.\n- **Benford's Law Forensic Alert (Medium Risk):** Invoices beginning with digit **9** occur at **30.3%** vs. Benford baseline **4.6%**. Audit invoices starting with 9 for threshold-splitting, round-number estimates, or duplicate entries.\n- **Imminent Inventory Stockouts (2 SKUs):** Replenishment orders must be triggered immediately to avoid lost invoiced revenue.\n\n## 3. Strategic Opportunities\n- **Pipeline Conversion Capture:** Closing active pipeline ($321,079.57) at your current 20.6% rate yields ~**$66,142.39**; lifting conversion by 5 percentage points adds **$16,053.98** without extra marketing spend.\n- **RFM Revenue Expansion & Retention:** Mobilize 8 Champions and 36 Loyal accounts for annual/bundled upsells while deploying executive outreach to 1 'Cant Lose Them' and 2 'At Risk' customers.\n\n## 4. Risk Mitigation\n- **Financial & Working Capital:** Enforce automated dunning at +7/+15/+30 days overdue, offer 1.5–2% early-settlement discounts on invoices >30 days old, and align vendor payment schedules with receivables inflows.\n- **Controls & Forensics:** Require dual sign-off on all invoices/bills starting with digit 9 and freeze manual round-sum overrides pending audit.\n- **Operations & Talent:** Pre-position safety stock on the 2 stockout-risk SKUs and qualify backup suppliers for the 1 bottleneck vendors. Conduct stay-interviews and workload rebalancing for the 1 flight-risk staff.\n\n## 5. 30-60-90 Day Plan\n- **Days 1–30 (Stabilize & Recover):** Collect ≥40% of $77,873.63 overdue AR ($31,149.45), audit digit-9 invoices for Benford anomalies, issue POs for 2 stockout-risk items, and contact all 3 At-Risk / Can't-Lose customers.\n- **Days 31–60 (Optimize & Convert):** Lift lead-to-deal and closing velocity on $321,079.57 active pipeline, renegotiate payment terms with top vendors to improve Current Ratio above 1.5x, and stabilize cash jitter below 20%.\n- **Days 61–90 (Scale & Institutionalize):** Hit 3-month revenue forecast ($160,694.66) or better, raise On-Time Delivery from 88.7% to ≥88%, and formalize quarterly rolling cash-flow & RFM retention scorecards across Finance, Sales, Operations, and HR."}]} | |
| {"messages": [{"role": "system", "content": "You are an expert ERP Analytics SQL & Data Engineer for Softsasi ERP (MySQL Laravel ERP schema and PostgreSQL/Prisma next-erp schema). Write accurate, multi-tenant-safe, production-ready analytical queries using exact schema tables and columns."}, {"role": "user", "content": "Write a MySQL query to rank the top 15 products/services by gross profit and margin percentage using `invoices`, `invoice_products`, and `product_services` for `created_by = ?`."}, {"role": "assistant", "content": "```sql\nSELECT\n ps.id AS product_id,\n ps.sku,\n ps.name AS product_name,\n ps.type,\n SUM(ip.quantity) AS units_sold,\n ROUND(SUM((ip.price * ip.quantity) - COALESCE(ip.discount, 0)), 2) AS total_revenue,\n ROUND(SUM(ps.purchase_price * ip.quantity), 2) AS estimated_cogs,\n ROUND(SUM((ip.price * ip.quantity) - COALESCE(ip.discount, 0) - (ps.purchase_price * ip.quantity)), 2) AS gross_profit,\n ROUND(\n CASE WHEN SUM((ip.price * ip.quantity) - COALESCE(ip.discount, 0)) > 0\n THEN (SUM((ip.price * ip.quantity) - COALESCE(ip.discount, 0) - (ps.purchase_price * ip.quantity))\n / SUM((ip.price * ip.quantity) - COALESCE(ip.discount, 0))) * 100\n ELSE 0 END,\n 1\n ) AS gross_margin_pct\nFROM invoice_products ip\nJOIN invoices i ON i.id = ip.invoice_id\nJOIN product_services ps ON ps.id = ip.product_id\nWHERE i.created_by = ?\n AND i.status = 4\nGROUP BY ps.id, ps.sku, ps.name, ps.type\nORDER BY gross_profit DESC\nLIMIT 15;\n```"}]} | |
| {"messages": [{"role": "system", "content": "You are a structured Business Intelligence API engine for Softsasi ERP. Respond strictly with valid JSON matching the requested analytics schema, with accurate calculations and no surrounding markdown."}, {"role": "user", "content": "Score RFM and output JSON (`customer`, `rfm_scores`, `segment`, `churn_risk`, `recommended_action`) using Softsasi ERP thresholds: Customer='Client-424', DaysSinceLastPurchase=146, PaidInvoices=12, TotalRevenue=$30,839.91."}, {"role": "assistant", "content": "{\"customer\": \"Client-424\", \"rfm_scores\": {\"R\": 2, \"F\": 5, \"M\": 5}, \"segment\": \"At Risk\", \"churn_risk\": \"high\", \"recommended_action\": \"Account manager outreach + contract review\"}"}]} | |
| {"messages": [{"role": "system", "content": "You are an expert ERP Analytics SQL & Data Engineer for Softsasi ERP (MySQL Laravel ERP schema and PostgreSQL/Prisma next-erp schema). Write accurate, multi-tenant-safe, production-ready analytical queries using exact schema tables and columns."}, {"role": "user", "content": "Write a MySQL query on the Softsasi Laravel ERP schema to list the top 10 customers by unpaid overdue invoice balance for tenant `created_by = ?`, including overdue invoice count and oldest due date."}, {"role": "assistant", "content": "```sql\nSELECT\n c.id AS customer_id,\n c.name AS customer_name,\n c.email,\n COUNT(DISTINCT i.id) AS overdue_invoice_count,\n MIN(i.due_date) AS oldest_due_date,\n ROUND(\n SUM(ip_totals.invoice_total) - COALESCE(SUM(pay_totals.paid_amount), 0),\n 2\n ) AS overdue_balance\nFROM invoices i\nJOIN customers c\n ON c.id = i.customer_id\nJOIN (\n SELECT\n invoice_id,\n SUM((price * quantity) - COALESCE(discount, 0)) AS invoice_total\n FROM invoice_products\n GROUP BY invoice_id\n) ip_totals\n ON ip_totals.invoice_id = i.id\nLEFT JOIN (\n SELECT\n invoice_id,\n SUM(amount) AS paid_amount\n FROM invoice_payments\n GROUP BY invoice_id\n) pay_totals\n ON pay_totals.invoice_id = i.id\nWHERE i.created_by = ?\n AND i.status NOT IN (0, 4)\n AND i.due_date < CURDATE()\nGROUP BY c.id, c.name, c.email\nHAVING overdue_balance > 0\nORDER BY overdue_balance DESC\nLIMIT 10;\n```"}]} | |