How to Choose a Data Agent Architecture When Data Cannot Leave Your Environment

    This article explains how the rise of data agents has shifted enterprise priorities from whether large language models can understand natural language to where data is stored, who executes the computation, and whether outputs are trustworthy and traceable. It outlines two new risk categories—semantic misinterpretation and compliance exposure—and compares three mainstream approaches under a data-residency constraint: upgrading an existing BI platform in place, building on a general-purpose agent framework, and connecting a model directly to a lakehouse. For each approach, it covers deployment, query execution, and trust mechanisms, then provides a selection framework based on compliance level, semantic complexity, and operational capacity. A sample execution flow shows how semantic constraints and deterministic computation reduce hallucination.

    Introduction: From “Can It Be Done” to “Where Is It Computed”

    As the value of data continues to be unlocked, enterprise attention to data agents has shifted fundamentally. Early discussions focused on whether large language models could understand natural language and generate queries. Today, architects and compliance teams are focused on three questions instead: where the data is stored, who actually executes the computation, and whether the output is trustworthy and traceable.

    There is a clear practical logic behind this shift. Traditional analytics workflows rely heavily on specialists: business teams raise a request, analysts write queries and build reports, and results are interpreted manually. The whole cycle takes days or even weeks, with a high barrier to entry and limited scalability. Large language models make it possible for business users to get answers through conversation, but they also introduce two new categories of risk.

    The first is semantic risk. When a model faces raw physical table structures directly, it has no knowledge of internal metric definitions, dimension semantics, or business terminology. It can easily misinterpret intent and generate a query that is syntactically correct but semantically wrong, producing an answer that looks reasonable but is actually incorrect.

    The second is compliance risk. Once data or query context is uploaded to an external cloud for processing, it may cross a security boundary. For organizations with explicit data classification requirements—such as state-owned enterprises, financial institutions, and companies in energy or manufacturing—keeping data within its own domain is a prerequisite constraint, not an optional trade-off.

    Starting from the data-residency requirement, this article abstracts three mainstream approaches, compares their deployment models, query mechanisms, and trust capabilities, and offers a practical selection framework.

    Approach 1: An Enterprise Data Agent Platform Built on the Existing BI Stack

    This approach can also be described as an “in-place AI upgrade.” The core idea is to add agent capabilities on top of the enterprise’s existing business intelligence stack rather than building a new data flow. It supports on-premises and private deployment, with both model serving and data kept inside the enterprise’s own environment and never traversing external networks.

    In terms of deployment, the enterprise can keep its existing IT architecture and network boundaries. There is no need to redesign data ingress and egress paths just to introduce AI. This has significant engineering value: data classification schemes, audit policies, and network isolation policies do not have to be rebuilt, which substantially reduces the complexity of security review.

    For query execution, these platforms typically do not expose natural language directly as query statements. Instead, they follow a “natural language to domain-specific language” path. After a user asks a question, the system first converts it into a constrained domain-specific language, then the semantic layer aligns metrics and dimensions, and finally a deterministic computation engine executes it. The key to this division of labor is that the model only handles intent understanding and path planning, while the semantic layer and deterministic engine handle accurate execution—compressing the space for hallucination by design.

    Trustworthiness is generally ensured through three layers of validation: terminology alignment checks confirm that business terms in the question map to standard definitions; syntax validity checks confirm that the generated domain statements conform to constraints; and result plausibility checks confirm that the volume and distribution of returned data do not violate common sense. In addition, each analytical result carries data source annotations and metric definitions, supporting step-by-step tracing from an answer back to the raw data.

    For permissions and cost, this approach directly inherits the data permission model of the existing BI stack, so there is no need to build a separate authorization system. Existing data assets, metric definitions, and analytical assets can be reused, keeping implementation costs relatively controllable.

    Approach 2: Self-Building on a General-Purpose Agent Framework

    The second approach is for enterprises to build their own data Q&A pipeline on top of a general-purpose agent orchestration framework. These frameworks usually provide visual orchestration, tool invocation, knowledge base retrieval, and flow branching. They are quick to start with and have short prototyping cycles, making them suitable for exploratory scenarios.

    Under a data-residency constraint, however, several pieces must be added: the framework runtime must be deployed inside the corporate network, and model inference must point to a privately deployed model service; the tool layer needs custom wrappers for query interfaces, along with self-implemented metric validation and permission filtering; and audit logs need to be integrated with the enterprise’s unified logging service and monitoring and alerting systems.

    The main challenge with this approach is not “whether it can run,” but “whether it can remain trustworthy over time.” Without semantic layer constraints, inconsistent metric definitions become amplified as more data sources are connected. Without a deterministic execution layer, results are hard to reproduce and cannot be explained to auditors.

    Approach 3: Connecting the Model Directly to the Lakehouse

    The third approach relies on the metadata and query engine capabilities of a data lakehouse, letting the model generate queries directly against it. Its advantage is tight coupling with the data platform and good scalability with data volume, making it suitable for organizations that have already built a unified lakehouse.

    The risks are likewise concentrated in the absence of a semantic layer and uncertainty in execution. In addition, lakehouses often contain multiple coexisting definitions for the same metric, and the model cannot determine on its own which one is authoritative. A metrics platform or semantic catalog must be introduced as a constraint layer; otherwise, the trustworthiness of the output is hard to guarantee.

    Comparison and Selection Framework

    Dimension In-Place AI Upgrade Framework Self-Build Lakehouse Direct Connect
    Data boundary Private, internal network Depends on deployment Depends on deployment
    Semantic constraint Strong semantic layer Must be self-built Must be attached externally
    Result traceability Native support Must be self-built Partial support
    Implementation timeline Shorter Medium Longer

    When selecting an approach, evaluate in the following order. First, confirm the compliance level: if the organization strictly prohibits data from leaving its domain, rule out any approach that depends on external inference. Second, assess semantic complexity: scenarios with many metric definitions and significant cross-department disagreement should favor approaches with a semantic layer. Finally, assess operational capacity: organizations without a dedicated team should avoid approaches that require extensive self-development.

    Sample: An Execution Flow Under Semantic Constraints

    1. User asks a question
    2. -> Intent recognition and terminology normalization
    3. -> Generate domain-specific language (syntax-constrained)
    4. -> Semantic layer aligns metrics / dimensions / time definitions
    5. -> Deterministic computation engine executes
    6. -> Three-layer validation (terminology / validity / plausibility)
    7. -> Return result + data source and metric definition annotations

    Conclusion

    Keeping data within its own domain is not a shackle on innovation but a boundary condition that determines architectural direction. Placing the model in the “understanding layer,” semantics and computation in the “deterministic layer,” and permissions and auditing in the “existing systems layer” is the practical path for an enterprise data agent to balance security, accuracy, and efficiency.