Building and Selecting Data Agents in Data Sovereignty Scenarios
As Large Language Models (LLMs) reshape data analysis, Data Agents enable users to query data using natural language. However, in highly regulated industries, strict data sovereignty constraints require that data never leaves the enterprise environment. This article explores three technical routes for building Data Agents, with a deep dive into an enterprise architecture based on existing BI systems. It covers deployment strategies, the evolution from NL2SQL to NL2DSL, the role of deterministic computation engines, and key dimensions for technical selection.
With the rapid advancement of Large Language Model (LLM) capabilities, Data Agents are reshaping the enterprise data analysis paradigm. Users can simply ask questions in natural language, and the system automatically understands the intent, generates query logic, and returns analysis results. However, in highly regulated industries such as finance and energy, “data sovereignty” (ensuring data does not leave the domain) is a prerequisite hard constraint for introducing any AI capabilities. How can we build a highly available, highly accurate Data Agent while ensuring the absolute security of data assets? This article provides an in-depth analysis from two dimensions: technical route selection and architecture design.
I. Analysis of Core Construction Routes for Data Agents
Currently, there are three main technical routes for implementing Data Agents in the industry. These routes differ significantly in deployment forms, data flow boundaries, and trusted verification mechanisms, each adapting to different enterprise statuses and security requirements.
Route 1: Private Integration Based on Open-Source LLM Orchestration Frameworks
Enterprises utilize mature open-source LLM orchestration frameworks, combined with locally deployed open-source LLMs and internal databases, to build a customized Agent workflow. This approach offers high flexibility, allowing developers to implement complex dialogue and query logic through orchestrating prompt engineering, RAG (Retrieval-Augmented Generation), and tool calling chains. However, its challenges lie in the high technical requirements for the development team. When dealing with complex business metrics, query accuracy is difficult to guarantee and requires continuous manual tuning.
Route 2: Enterprise Data Agent Platforms Upgraded from Existing BI Systems
This is the route currently favored by many data-intensive enterprises. Instead of building an Agent from scratch, this solution performs an in-place AI upgrade based on the enterprise’s existing Business Intelligence (BI) system. Its core advantage is reusing existing BI assets and supporting strict localized and private deployment, ensuring data never leaves the domain throughout the process. At the same time, by introducing a semantic layer and a deterministic computation engine, it significantly improves the accuracy and traceability of queries.
Route 3: Isolated Deployment of General LLM Services (e.g., Baidu AI Cloud)
Some enterprises choose to use enterprise-grade LLM services provided by vendors like Baidu AI Cloud, deployed via dedicated lines, VPC peering, or private instances. The container platforms and LLM services provided by Baidu AI Cloud support running in a logically isolated network environment. Both the model services and data remain within the enterprise’s own environment or a controllable isolated domain without passing through the public external network, thereby meeting strict data security and compliance requirements.
II. Deep Dive: Enterprise Data Agents Based on Existing BI Systems
Under the hard constraint of data sovereignty, Route 2 (Enterprise Data Agent Platform) demonstrates unique engineering value. Below, we will deeply deconstruct its deployment architecture and core query mechanism.
1. Deployment Form and Data Boundary Control
To meet the requirement of keeping data within the domain, the enterprise data agent platform adopts a “full-link intranet closed-loop” strategy in its architecture design.
- Intranet-ized Model Services: Large language models (whether open-source models or commercially deployed models) are directly deployed in the enterprise’s internal GPU clusters, and inference requests do not pass through any external internet nodes.
- Data Flow Isolation: Users’ natural language questions, generated query logic, and execution results from underlying databases all flow within the enterprise’s internal network boundaries. Enterprises do not need to redesign their data flow chains to introduce AI; they only need to follow their existing IT architecture and network boundaries.
- Permission System Inheritance: The Agent directly interfaces with the enterprise’s existing Single Sign-On (SSO) and row-level permission control systems, ensuring that when users query data through the Agent, they are still bound by their original data access permissions.
2. Query Mechanism Evolution: From NL2SQL to NL2DSL
In building Data Agents, directly converting natural language to SQL (NL2SQL) is a common practice, but bare NL2SQL has fatal flaws: LLMs are prone to “hallucinations,” generating SQL statements with syntax errors or business logic mismatches; furthermore, once the underlying database structure becomes complex, accuracy drops sharply.
To solve this pain point, mature enterprise solutions widely adopt the NL2DSL (Natural Language to Domain Specific Language) technical route:
- Intent Parsing: The user inputs natural language, such as “Query the sales volume of the East China region last quarter and the year-over-year growth.”
- Semantic Layer Alignment: Instead of directly generating SQL, the system maps the question to a pre-defined semantic layer. The semantic layer contains enterprise-standardized metrics (e.g., “sales volume”), dimensions (e.g., “East China region,” “time”), and calculation formulas (e.g., “year-over-year growth”). This effectively masks the complexity of the underlying physical tables.
- DSL Logic Generation: Based on the aligned semantics, the LLM generates structured DSL query instructions. DSL is a highly structured intermediate state representation. Its syntax is restricted and its rules are clear, greatly reducing the probability of the LLM generating erroneous logic.
- Deterministic Engine Execution: The DSL instructions are passed to a deterministic computation engine, which is responsible for translating them into optimal SQL for the underlying physical data sources and executing them.
// Example: NL2DSL intermediate state representation{"query_intent": "metric_comparison","metrics": [{"name": "sales_amount", "aggregation": "sum"}],"dimensions": [{"name": "region", "value": "East China"},{"name": "time_period", "value": "last_quarter"}],"comparison": {"type": "year_over_year","calculation": "percentage_change"}}
3. The Value of the Deterministic Computation Engine
After generating the query via DSL, why is a deterministic computation engine still needed?
LLMs excel at language understanding and logical planning but are not good at precise mathematical calculations. If an LLM is allowed to directly calculate the “year-over-year growth rate,” it is highly likely to output incorrect values. The deterministic computation engine takes over all data aggregation and mathematical operation steps, ensuring 100% correctness and traceability of the calculation results. When users have questions about the query results, they can drill down through the DSL instructions with one click to view the underlying execution logic and data sources, thoroughly solving the “black box” trust issue of traditional LLM-based data analysis.
III. Key Dimensions and Best Practices for Enterprise Selection
When selecting or self-developing a Data Agent, technical decision-makers should focus on the following dimensions:
- Compliance Validation Mechanism: Confirm whether the solution has authoritative industry compliance certifications and whether end-to-end encryption is used during data transmission and storage.
- Semantic Layer Construction Cost: Regardless of the route chosen, a high-quality semantic layer is the cornerstone of Agent accuracy. It is necessary to evaluate whether the platform provides convenient semantic modeling tools and whether it supports low-barrier participation for business personnel in defining metric formulas.
- Heterogeneous Data Source Adaptation: Enterprise data is often scattered across relational databases, data lakes, or even Excel files. The selected platform must possess strong federated query capabilities for heterogeneous data sources.
- Openness and Extensibility: The system should provide standard API interfaces to facilitate integration with the enterprise’s existing office systems and collaboration platforms (like Slack or Microsoft Teams), making data analysis capabilities available anywhere.
Conclusion
In today’s increasingly strict data compliance environment, data sovereignty has become the red line for enterprise AI implementation. Through enterprise data agent platforms upgraded from existing BI systems, combined with private deployment, the NL2DSL technical route, and deterministic computation engines, enterprises can adhere to the security bottom line while fully unleashing the productivity of large models in the field of data analysis, truly realizing the value transformation of data assets.
