Can NL→MQL→SQL Bridge the Gap to End‑to‑End Intelligent BI?
Aloudata Agent introduces a novel NL→MQL→SQL framework that combines large language models with a custom metric query language, enabling business users to perform end‑to‑end intelligent data analysis, attribution, and reporting without technical expertise, while balancing accuracy, cost, and performance.
Business Value Loop of Intelligent BI
With the wave of large language models, digital transformation is accelerating. Intelligent BI lowers data preparation and analysis barriers, allowing non‑technical business users to explore data via natural language and obtain insights without waiting for IT or analysts.
Technical Innovation for Free and Accurate Data Dialogue
Aloudata Agent’s core goal is to build a business‑oriented intelligent analysis assistant that understands scenarios and provides a full‑chain support from insight to action.
Challenges of Mainstream Solutions
Two common approaches have limitations:
NL2SQL : Directly generating SQL works for simple schemas but suffers from hallucination and low accuracy in complex business contexts.
NL2DSL2SQL : Uses an intermediate domain‑specific language (DSL) built from agile‑BI datasets, but faces inconsistent metric definitions and limited flexibility across dimensions.
Our Answer: NL2MQL2SQL Framework
We propose a three‑stage pipeline: Natural Language → Metric Query Language (MQL) → SQL. The large model handles intent understanding and MQL generation, while a deterministic metric‑semantic engine translates MQL to exact SQL, eliminating hallucination.
Components
NL (Natural Language) : User query.
MQL (Metrics Query Language) : Structured expression of metric, dimensions, filters, calculations, and time range.
SQL : Executable query in the database.
Execution Flow
Intent understanding & MQL generation (large model).
API authentication (semantic engine) ensures row‑level and column‑level permissions.
MQL → SQL translation (deterministic engine) guarantees 100% accuracy.
Query acceleration and caching for performance.
Result returned to the model for natural‑language interpretation and visualization.
From Single Query to End‑to‑End Intelligent Analysis Loop
Aloudata Agent moves beyond simple Q&A to a continuous exploration process: "What is the data? → Why does it look like this? → What should we do next?" It chains multiple sub‑tasks using the ReAct (Reasoning and Acting) framework.
ReAct Mechanism
Thought : Decompose complex questions into atomic sub‑tasks.
Action : Invoke appropriate tools (metadata query, data retrieval, chart generation).
Observation : Evaluate results and iterate until the final answer is complete.
Intelligent Attribution and Deep Reports
Attribution : When a metric changes, the system automatically analyzes dimensions and factors, producing a report with data overview, impact analysis, and action suggestions.
Deep Report : For open‑ended analysis topics, the assistant creates an outline, queries required data step‑by‑step, and assembles a structured, visual, and actionable report.
Scenario‑Based Intelligent Assistant
Different roles (finance, HR, operations) get dedicated assistants with isolated knowledge bases, custom business terminology, and role‑specific metric sets, ensuring relevance and preventing knowledge contamination.
Key Product Features – Building a Trustworthy Analysis Experience
Transparent Process : Every reasoning step and tool call is displayed to the user, making the workflow auditable.
User Intervention : Users can confirm ambiguous intents, edit query conditions, and adjust results on the fly.
Knowledge Isolation : Separate knowledge bases per scenario and optional personal knowledge vaults.
Interactive Guidance : Quick‑click drill‑downs and citation features enable seamless follow‑up questions.
Balancing Accuracy, Cost, and Performance
We adopt a layered, heterogeneous system:
Low‑cost base models for intent detection and query rewriting.
Vector and ranking models for metric/dimension retrieval.
Powerful large models (e.g., 32B) for MQL generation.
Deterministic backend engine for MQL → SQL translation and execution.
Large model only for final data interpretation.
This strategy achieves high accuracy while controlling LLM costs and ensuring fast query response.
Conclusion – Making Data Analysis a Universal Capability
Aloudata Agent delivers accurate, comprehensive, intelligent, friendly, and secure analysis, turning data querying into a skill available to anyone, guiding users from raw data to actionable insights.
Q&A
Q1 : Un‑defined metrics cannot be queried directly, but derived calculations based on existing metrics are supported.
Q2 : Multi‑layered permission control includes row‑level and column‑level enforcement enforced during SQL execution.
Q3 : Attribution combines deterministic backend calculations with LLM‑generated narrative explanations.
Q4 : Cross‑data‑source queries are supported through semantic‑layer relationships.
Q5 : Report depth depends on injected business knowledge; the assistant learns from custom terminology and attribution experience.
Q6 : MQL offers flexible, consistent metric composition compared to rigid DSLs.
Q7 : Ambiguous queries trigger a clarification question before execution.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
DataFunSummit
Official account of the DataFun community, dedicated to sharing big data and AI industry summit news and speaker talks, with regular downloadable resource packs.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
