AI Agent (ADK) for E-Commerce Business Analytics
Challenge: SME owners sit on mountains of transaction data but have no dedicated analyst to make sense of it. Sales trends, profit margins, discount effectiveness, return patterns, and delivery performance all go unexamined — decisions are made on gut feel instead of evidence.
Solution: An AI agent built with Google ADK that analyses 34,500 e-commerce orders across 6 pre-built analytical tools. The agent receives a plain-English question, selects the right tool, runs the analysis, and returns a clear recommendation — no coding or dashboard setup required.
Analyses revenue trends over time, identifies top-performing products and categories, and highlights periods of sales growth or decline across 5 regions.
Calculates profit margins by product, category, and region. Identifies which items generate the most profit versus the most revenue — they are not always the same.
Evaluates the effectiveness of discount campaigns. Compares discounted vs non-discounted orders on revenue, margin, and volume to determine which promotions actually work.
Identifies products, categories, and regions with the highest return rates. Surfaces patterns that help reduce returns and improve customer satisfaction.
Groups customers by purchasing behaviour — frequency, recency, and spend. Identifies high-value segments and those at risk of churning.
Analyses delivery times by region and shipping method. Identifies delays and their impact on customer satisfaction and return rates.
The agent framework that orchestrates tool selection and execution. ADK manages the conversation flow, decides which analytical tool to invoke, and handles the full request-response cycle.
The reasoning engine behind the agent. Gemini interprets user questions, maps them to the right analytical tool, and synthesises raw data outputs into clear, actionable business recommendations.
The agent generates Python code (pandas operations) to answer each question. The server executes this code in a controlled environment and returns structured results — no hardcoded reports.
The full 34,500-order dataset is loaded into memory at startup. Every query runs against live data with no database overhead — fast responses for interactive use.