
RecceLabs LLM-powered Marketing Dashboard
A containerized microservices platform enabling non-technical stakeholders to perform complex marketing analytics via natural language and high-accuracy time-series forecasting.
Problem
Marketing managers relied on static CSVs and aggregated monthly data that made granular ROAS calculation impossible. Traditional forecasting models like ARIMA and XGBoost yielded high error rates (MAPE > 40%), failing to provide the predictive depth needed for proactive budget allocation.
Solution
Developed a containerized architecture utilizing Meta's Prophet for time-series forecasting and a multi-LLM pipeline (Llama 3, Llama 4 Maverick, and DeepSeek-R1) to automate report generation. The system features automated hyperparameter tuning via Optuna and an Nginx-routed microservices backend to handle concurrent analytical workloads.
Achievements
- Achieved ≤ 15% MAPE for revenue forecasting, significantly outperforming ARIMA (42.3%) and XGBoost (49.8%)
- 91.7% success rate in query classification across description, report, and chart tasks
- Sub-second classification latency (0.71s) for real-time user query processing
- Optimized 25 engineered features down to 7 key predictors using VIF to eliminate multicollinearity and improve model stability

Executive Context: The Evolution of Marketing Intelligence
The contemporary marketing ecosystem generates an unprecedented volume of data across fragmented channels, creating a significant analytical burden. We are shifting from manual, CSV-reliant reporting—often plagued by high analytical latency and static BI tools—to automated, AI-driven prescriptive analytics.
RecceLabs transforms fragmented data into a high-concurrency "Decision-Support Agent." However, AI-driven prescriptive analytics are mathematically fragile. The sophisticated models used to generate strategic narratives are highly susceptible to "Garbage-In, Garbage-Out" (GIGO) dynamics. Consequently, an algorithmic audit layer is an absolute prerequisite for ensuring the LLM pipeline operates on a foundation of statistical truth.
Algorithmic Foundations of the Automated Data Auditor
Without rigorous preprocessing, anomalies can cause catastrophic hallucinations in predictive models, particularly Bayesian models like Meta Prophet. For instance, an auditor failing to catch a 20x lead surge distorts the additive total, forcing extreme changepoints and ruining uncertainty intervals.
- Statistical Signatures of Anomalies: We address 20x lead surges (bot activity/tracking failures), CPV uniformity (ingestion failure), negative ad spend, and temporal gaps to prevent trend misfitting.
- Multicollinearity Strategy: When channels move in tandem, isolating the marginal impact of spend becomes impossible. We utilize the Variance Inflation Factor (VIF) to prune redundant features (VIF > 5), ensuring the DeepSeek-R1 reasoning engine receives distinct, non-redundant channel signals.
Architectural Justification: Microservices & NoSQL Superiority
The engineering stack (Next.js, Flask, MongoDB, Alibaba Cloud) balances high-concurrency demands with sub-second analytical latency.
- The NoSQL Case (MongoDB): Marketing data is inherently heterogeneous. Schema-on-Read allows storage of diverse campaign documents without SQL migration latency. Data Locality enables sub-second retrieval of campaign hierarchies by eliminating expensive relational JOINs.
- Workload Decoupling on Alibaba Cloud: Docker Compose separates computational profiles. Memory-Optimized Instances handle the Flask/Pandas backend for CPU-intensive data aggregation, while GPU-Enhanced Instances are dedicated to the LLM Gateway for local inference. This decoupling ensures no "noisy neighbor" degradation when managing 20-50 concurrent users.


The 4-Stage Modular LLM Orchestration Pipeline
To prevent "Prompt Bloat"—which increases costs and latency—RecceLabs utilizes a modular four-stage pipeline:
- Query Validator: Employs zero-shot safety filtering to ensure queries are grounded and secure.
- Query Classifier: Achieving 91.7% accuracy at 0.71s latency, this "Intent Router" prevents over-provisioning expensive models by identifying if a query is a simple filter or complex forecast.
- Collection Selector: Targets specific MongoDB documents, minimizing the data payload passed to the reasoning engine.
- Code Execution (Latency vs. Fidelity): Llama 4 Maverick generates Pandas code via its 1M token context window, while DeepSeek-R1 provides strategic reasoning. DeepSeek-R1 introduces a 2-second "Time to First Token" (TTFT) delay for generating thinking tokens. This multi-step logic significantly reduces hallucinations, prioritizing a factually grounded explanation over a sub-second hallucinated response.

Marketing Science: Non-Linear Modeling & Predictive Excellence
Modern marketing requires moving beyond linear assumptions to capture the physical realities of consumer behavior. Primary forecasting is handled by Meta Prophet, optimized via Optuna to maintain a target MAPE ≤ 15%.
y(t) = g(t) + s(t) + h(t) + ε_t
- Adstock & Hill Functions: Adstock captures the long-tail impact of brand building (carryover). The Hill Function models saturation, identifying the breakthrough threshold and the point of diminishing returns.
- Physics-Inspired Frameworks: We synthesize research from the Michaelis-Menten equation to quantify consumer-brand affinity (lower K_M indicates tighter binding) and Boltzmann Kinetic Theory to model channel interactions as elastic collisions, properly attributing influence between "donor" and "receiver" channels.
- Model Benchmarking: Prophet outperforms ARIMA and XGBoost by natively handling seasonality with Fourier Series and robustly accommodating missing data via curve-fitting, achieving a highly interpretable 2.2% - 24.2% MAPE range.


Business Value & Strategic Roadmap
The technical efficiency of the dashboard transforms the platform into a true conversational decision-support agent, enabling Morning "Pulse" Checks, Proactive Alerting, and Self-Service Exploration.
- Automated Root Cause Analysis (RCA): Utilizing Shapley values and variance decomposition, the RCA agent automatically traverses dimensional hierarchies to distinguish between localized technical failures and broader competitive activity.
- Prescriptive Budget Allocation: Combining Sequential Least Squares Programming (SLSQP) with our Hill saturation curves, the system generates optimized spend plans, maximizing objective functions like leads under budget constraints while respecting channel saturation limits.