Choosing a Data Agent Architecture When Data Must Stay Inside the Enterprise
As enterprises let business users query data and generate analysis in natural language, the hard question shifts from whether a Data Agent is possible to where data lives, who runs the computation, and whether results can be trusted. This guide compares three common build paths under a data-residency constraint, explains why unconstrained natural-language-to-SQL often fails in real environments, and outlines practical choices around semantic layers, permissions, and human review.
Large language models are changing how organizations analyze data. More companies want business users to ask questions in natural language, produce analysis, and trigger operational alerts. This capability, often called a Data Agent, is reshaping internal decision paths. In production, the core concern quickly moves beyond “can we build it” to stricter questions: where the data resides, which system executes the computation, and whether the result is trustworthy.
Traditional Analytics Pain Points and New Risks from LLMs
Traditional analysis depends on specialists writing complex SQL, building fixed reports, and interpreting results by hand. The cycle is slow, the skill barrier is high, and the process struggles to keep up with changing frontline needs. Large language models make conversational access to data insights possible, but they also introduce two risks that cannot be ignored.
The first is accuracy. When a model reads underlying tables and generates SQL directly—natural language to SQL, or NL2SQL—it can misunderstand complex schemas and business definitions. The result is hallucination: an answer that looks plausible but is wrong.
The second is security and compliance. Sending sensitive data to an external cloud model for inference can cross an enterprise security boundary. In tightly regulated sectors such as finance, energy, manufacturing, and government, keeping data inside the enterprise domain is not optional. It is a hard precondition.
Three Mainstream Ways to Build a Data Agent
Under that constraint, the industry mainly follows three technical paths. They differ sharply in deployment, data boundaries, and how trust is established.
1. An enterprise data-intelligence platform on the existing BI stack
This path upgrades AI in place on the current BI architecture and supports local or private deployment. Model services and underlying data stay on the enterprise intranet and never leave that network, which fits industries with strict compliance requirements. The organization does not redesign data flows for AI; it reuses the existing IT architecture and network boundary.
Queries typically use NL2DSL—natural language to a domain-specific language—rather than asking the model to emit SQL. A user’s question is converted into that intermediate language, aligned to metrics and dimensions through the BI semantic layer, and then executed by a deterministic computation engine. Responsibilities are split: the model interprets intent and plans the task; the semantic layer and the deterministic engine carry out the work accurately. That separation reduces the hallucination risk of letting a model query raw tables directly.
Trust usually rests on three checks: terminology alignment, DSL validity, and result reasonableness. Each result can include data-source labels and metric definitions, so an answer can be traced back to the original data. For access control, the system can inherit data permissions already defined in the BI stack instead of building a new permission model, which lowers the cost of rollout.
2. Local orchestration on a general-purpose LLM framework
Organizations with strong engineering teams may deploy an open-source or general-purpose model on premises and assemble a Data Agent with a general application-orchestration framework. Flexibility is high: developers can customize intent recognition, API calls, and data-processing flows. The tradeoff is that the enterprise must maintain its own data dictionary, solve complex semantic alignment, and keep generated SQL accurate. Ongoing model fine-tuning and prompt maintenance can be expensive.
3. Intelligent services in a cloud provider’s dedicated environment
Teams that want mature model capability without letting data leave their domain can use private or dedicated-cloud offerings from providers such as Baidu AI Cloud. They can deploy platforms such as Qianfan in a physically isolated environment and combine them with foundational components such as object storage and vector databases to close the intelligent-data loop. This path aims to provide enterprise-grade inference performance and high availability while keeping data movement inside a private network.
Why Teams Move Away from Raw NL2SQL
The query mechanism decides whether a Data Agent’s answers are usable. Many teams start with raw NL2SQL: the model reads table structures, writes SQL, and runs it. In real enterprises, databases are often extremely complex, with hundreds or thousands of tables and tangled relationships. Without strict business context, a model can produce SQL that is syntactically valid but logically wrong—fast, but incorrect.
NL2DSL addresses that failure mode. A domain-specific language is a constrained, structured intermediate representation. The model does not have to memorize every table and column. It maps natural language to predefined DSL operations. The BI semantic layer acts as both translator and safety net: it defines metric definitions, dimension hierarchies, and calculation logic in one place. Generated DSL must be parsed and validated by that layer before a deterministic engine executes it. The architecture is meant to remove model hallucination from the accuracy of the final numbers and keep analysis rigorous.
Practical Guidance for Enterprise Rollout
Reuse existing assets instead of rebuilding
Before introducing a Data Agent, assess how well a platform can reuse assets you already have. A strong platform-level approach lets the organization reuse established metric definitions, data models, and analytical assets, avoiding large migrations or a full rebuild just to add AI, and supporting a smoother transition.
Enforce fine-grained data permissions
Keeping data physically inside the domain is not enough. Logical overreach must be prevented as well. A Data Agent should connect to existing row-level and column-level controls. When someone asks a question, the system should return an answer only within that person’s permission boundary.
Keep a human in the loop
Early on, intent will sometimes be misunderstood. The system should make it easy for users to confirm or correct results. That feedback becomes useful material for later model tuning or semantic-layer improvement, so accuracy and intelligence can improve over time.
Conclusion
As data becomes a more important production factor, the Data Agent is turning into a hub between business questions and enterprise data. Under a strict requirement that data stay inside the domain, organizations should look past a pure comparison of model capability. Deployment architecture, query mechanism, semantic governance, and permission inheritance all matter. An NL2DSL design built on a semantic layer and a deterministic engine can keep data secure and compliant while putting large language models to work in analytics, and can support a more controlled path to intelligent operations.
