SME&C Agentic Analytics Platform
A custom agentic analytics system that turns natural-language business questions into grounded KPI retrieval, query enrichment, SQL generation, Fabric execution, validation, charts, and business insights.
What was broken
SME&C stakeholders depended on dashboards and ad hoc reports built by BI teams. Every new business question turned into a new report request or manual analysis across multiple sources, growing a sprawling report repository and pushing real insight generation behind data modelling and integration work. Users wanted natural-language access to KPI, program, and offer information without writing SQL or waiting on a BI cycle.
How I built it
I built a custom agentic analytics service that lets users ask natural-language questions over Programs and Offers. A FastAPI endpoint accepts the query, sample row count, and username, starts a Redis-backed history check, warms connections asynchronously, and runs an orchestrator pipeline: intent classification, query exploder, KPI planning, KPI / program metadata retrieval through Azure AI Search, query enrichment, table extraction, SQL code generation, execution against the Fabric SQL Endpoint, a validation / refinement loop, then chart generation and business insight narration. The response is a structured multi-tab payload containing output, insights, follow-ups, HTML table, base64 graph, SQL, metrics used, filters, and confidence — designed for multi-KPI answers with parallel processing.
The reasoning
One giant text-to-SQL prompt collapses on a real enterprise KPI catalog. Splitting reasoning into intent → KPI planning → enrichment → SQL → validation → insight gives each step a focused contract, evals, and retry boundary. Grounding through Azure AI Search over KPI and program metadata keeps SQL honest; the Fabric SQL Endpoint keeps execution on governed data; Redis keeps user history and warm connections fast; parallel execution keeps multi-KPI answers responsive.
How the pieces fit
Key components
- 01FastAPI analytics API with Pydantic request and response models
- 02Redis-backed user history, conversation metadata, and connection warmup
- 03Azure OpenAI agents across intent, KPI planning, enrichment, SQL, validation, and insight
- 04Azure AI Search retrieval over KPI, program, and table & column metadata
- 05Microsoft Fabric SQL Endpoint for governed query execution
- 06SQL validation and retry / refinement loop for resilient generation
- 07Parallel execution for KPI / program retrieval and insight / chart generation
- 08HTML table + base64 graph + structured tabs for output, insights, follow-up, SQL, metrics, filters, confidence, and status
- 09Configuration-driven model deployment, token settings, index names, retrieval parameters, and SQL execution limits
- 10Observability via logging and per-stage timing breakdowns through Azure Monitor
Tech stack
Supabase-hosted walkthrough
SME&C agentic solution demo
In-browser demo
A scripted walkthrough of the demo flow, traced step by step.