Skip to content

A workflow built for Executives in Retail and E-Commerce that sends a 90-word executive summary email to a manager including KPIs and anomalies detected the previous day compared to a 14-30 day baseline with a visual representation in a sparkline chart.

License

Notifications You must be signed in to change notification settings

ahsan-141117/Revenue-and-Anomaly-Briefing-Workflow-for-Executives---LangChain

Repository files navigation

Please credit Mohammad Ahsan Hummayoun and Atsushi Hashimoto when using, sharing, or adapting this code

This project automates the generation of a Daily Revenue & Anomaly Brief for e-commerce data.
It computes KPIs (Revenue, Orders, AOV), compares results against a rolling baseline, and detects anomalies.
A concise executive-style HTML email is then produced with a professional chart and summary.

This workflow can be scheduled to operate on different intervals and applied to retail and e-commerce stores worldwide.

⚙️ How it Works

Data Ingestion
Reads transactional data (CSV or other sources) containing order IDs, order dates, and totals.

KPI Calculation
Computes key performance indicators:

  • Total Revenue
  • Number of Orders
  • Average Order Value (AOV)

Baseline Comparison & Anomaly Detection
Compares daily metrics against a rolling historical baseline to flag anomalies (spikes or drops).

LLM Summary Generation
Integrates Groq Cloud via LangChain to generate a concise daily executive brief.
(Other LLM providers can also be swapped in with LangChain’s unified interface.)

Chart Creation
Leverages QuickChart to produce professional bar/line charts embedded into the email.

Email Delivery
Sends the daily report as a styled HTML email via Gmail SMTP.

About

A workflow built for Executives in Retail and E-Commerce that sends a 90-word executive summary email to a manager including KPIs and anomalies detected the previous day compared to a 14-30 day baseline with a visual representation in a sparkline chart.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages