Governed Conversational Analytics: Sunline ChatSQL Bridges the Accuracy Gap in Enterprise Banking Tech
Fintech News
2026.07.03

As financial institutions pursue more granular, data-driven management, democratizing self-service data access across business lines has become a key operational priority. However, enterprise data teams face persistent friction with traditional ad-hoc retrieval models. When banks attempt to deploy conversational AI or generic Text-to-SQL solutions to accelerate data access, they frequently run into significant structural barriers:


• Algorithmic Hallucinations and Query Inaccuracy: Direct, unconstrained translation of natural language into executable SQL yields low accuracy when applied to complex banking schemes.

• Fragmented Metric Definitions: Core key performance indicators (KPIs) and business definitions often reside in implicit logic, preventing AI models from resolving true business context.

• Governance and Security Risks: Black-box SQL generation risks producing field disorders, invalid table joins, or unauthorized data access.

• Data Heterogeneity: Enterprise data remains distributed across diverse, multi-platform database environments, creating navigation barriers for business users.


The Solution Architecture: A Three-Tiered Semantic Foundation

Sunline is addressing challenges by introducing ChatSQL, a natural language querying component built on the DataMind platform. Rather than relying on the direct, black-box natural-language-to-SQL translation, ChatSQL innovatively introduces a semantic layer between natural language processing and SQL generation, allowing field definitions, metric logic, table relationships, and access rules to be explicitly modelled before a query reaches the underlying databases. The platform operates on a three-tiered deduction model:

Natural Language (NL)→Semantic Query→Executable SQL


Under this model, ChatSQL established an end-to-end governed query pipeline: 

Natural Language Input → NL-to-MQL Parsing→ MQL Compilation →SQL Generation → Database Execution → Result Return 


As an intermediate abstraction layer, MQL isolates physical database complexity and disparate table structures, enabling business personnel to query specified metrics without knowledge of underlying data schemas or physical storage locations. It also embeds unified metric definitions, SQL injection protection, and field-level access control within the semantic tier, applying validation at the point a query is initiated and balancing ease of use with the data-security requirements of financial scenarios.


Governance Built into the Query Lifecycle

ChatSQL’s semantic model is maintained as a two-layer knowledge engine:


• Definition Layer: Standardizes metric formulas, target business contexts, and contextual relationships.

• Mapping Layer: Maps business definitions directly to underlying physical tables, database attributes, join pathways, and filter parameters.


As definitions are updated through configuration rather than code, business experts can participate directly in metric governance.


The platform agents invoke these semantic services through the Model Context Protocol (MCP), connecting intent recognition to SQL generation, with precise semantic matching, field-level permission isolation, automatic service fallback, and canary release, ensuring every query is evidenced and fully traceable.


Financial-Grade Controls by Design

To maintain data integrity and regulatory compliance, ChatSQL enforces a five-stage workflow with each stage’s outputs isolated and retained for audit: 



If query ambiguity or conflicting metric pathways are detected, the system prompts the user for clarification rather than allowing unverified assumptions. 


This workflow is reinforced by five financial-grade security safeguards:


1. Semantic-Restricted Generation: All SQL outputs are strictly generated from the semantic layer; direct reverse-parsing of raw data tables is prohibited.

2. Serial Execution Enforcement: The five-stage pipeline operates in a non-bypassable serial sequence.

3. Schema Boundary Interception: Eight standard query validation rules intercept fields outside the established semantic model.

4. Pre-Execution Verification: Enforces read-only database locks, query statement limits, credential isolation, and database compatibility checks prior to execution.

5. Post-Query Compliance Audit: Conducts a six-dimension audit on query outputs before rendering visual charts to end users.



Turning Self-Service Analytics into an Operating Model


In live production deployments, ChatSQL delivers validated operational performance enhancement with 95.2% query accuracy across core natural language analytics scenarios in banking operations, alongside an 80% improvement in self-service data retrieval efficiency. 


The significance extends beyond query speed and accuracy. By enabling business teams to retrieve standardized metrics independently, ChatSQL reduces routine data requests. Data engineers can consequently move from repetitive ad-hoc extraction toward data governance, data modelling, and deeper analysis.


The broader direction is a shift from simply making data available to establishing a governed framework through which more personnel can use it safely and consistently. For banks building AI-ready data foundations, the combination of semantic modelling, controlled query execution, and self-service analytics provides a practical layer between enterprise data infrastructure and business users.


ChatSQL represents an application of Sunline’s broader DataMind architecture: using AI not simply to generate outputs, but to connect business context with governed data execution.



Fintech
Let’s spread China's financial technology globally
Sunline can empower your digital transformation