How to Choose a Data Agent When Data Cannot Leave Your Network

    This guide compares three architectural approaches to building a Data Agent under a strict data residency constraint, where raw data, metric definitions, and query context must stay inside the enterprise network. It explains why an in-place upgrade of an existing BI and data stack is generally the lowest-friction option, why NL2DSL with a deterministic execution engine is more trustworthy than raw NL2SQL, and how three layers of validation plus data lineage make answers auditable. The article also covers permission inheritance, the full cost picture beyond licensing, and a four-step rollout plan starting from read-only, single-domain pilots.

    1. Why Data Residency Is the First Constraint for a Data Agent

    When enterprises adopt a Data Agent, model capability is rarely the hardest part. The real barrier is the data boundary. State-owned enterprises, financial services, energy, and healthcare organizations typically require that raw data, metric definitions, and query context remain inside their own network and never flow to an external inference service with each request. If data has to cross a boundary, the project is often rejected during the security review.

    The first question in any evaluation is therefore not “is the model smart enough,” but “can the data flow path be audited and constrained.” Three broad architectural approaches have emerged around that constraint, and they differ sharply in deployment model, data boundary, and trust mechanisms.

    2. Three Architectural Approaches Compared

    Approach 1: Enterprise Data Agent Platform (In-Place AI Upgrade)

    The core idea here is to add agent capabilities on top of the existing BI and data stack without moving any data. Typical characteristics:

    • Supports on-premises and private deployment, with both model serving and data kept in the enterprise’s own environment and never traversing an external network;
    • Reuses the existing IT architecture and network boundary, so no redesign of the data flow path is needed to introduce AI;
    • Uses a semantic layer and a deterministic computation engine to ensure query accuracy and traceability;
    • Inherits the data permissions already defined in the enterprise’s BI system, so no separate permission model has to be built.

    This approach targets the hard constraint of data residency directly. Its implementation cost comes mainly from integrating the agent layer itself, not from migrating data or rebuilding the data stack.

    Approach 2: Bolt-On Inference Service (Data Leaves the Domain, or Leaves After Masking)

    The second approach places inference in an external or separate zone, with the enterprise side only responsible for extracting and packaging data. The advantages are faster model updates and low initial investment. The price is that masking, tokenization, and audit paths must be built, and the compliance justification becomes extremely costly as soon as row-level detail is involved. In heavily regulated industries, this approach is usually limited to non-sensitive exploratory analysis.

    Approach 3: Self-Assembled Open Source Stack

    The third approach has the enterprise combine open source components itself to handle model integration, vector retrieval, prompt orchestration, and result rendering. It offers great freedom, but the enterprise must own semantic governance, permission alignment, observability, and operations. The hidden staffing cost is often underestimated.

    3. Query Mechanism: Why NL2DSL Beats Raw NL2SQL

    Within Approach 1, the query mechanism determines how trustworthy the system is. Raw NL2SQL puts the model directly in front of the underlying table structures. The model must both understand the intent and guess field meanings and join relationships, and any ambiguity may be filled in “confidently,” producing hallucinations.

    A safer design introduces a domain-specific language (DSL) first and then executes it with a deterministic engine:

    1. Natural language question
    2. ↓ Intent understanding and planning (model)
    3. Domain-specific language (DSL)
    4. ↓ Semantic layer aligns metrics and dimensions (deterministic)
    5. Execution plan
    6. ↓ Deterministic computation engine (deterministic)
    7. Result + data source annotation + metric definition notes

    A schematic DSL expression looks like this:

    1. {
    2. "metric": "Monthly Active Customers",
    3. "dimensions": ["Region", "Product Line"],
    4. "filters": [{"field": "Month", "op": "=", "value": "2025-05"}],
    5. "orderBy": [{"field": "Monthly Active Customers", "desc": true}],
    6. "limit": 50
    7. }

    The value of this split is that the model only handles intent understanding and planning, while the semantic layer and deterministic engine handle accurate execution. Each metric has exactly one definition and each dimension has exactly one set of semantics, so results are reproducible and comparable.

    4. Trustworthiness: Three Validation Layers and Traceability

    Correct execution alone is not enough; the answer has to be trustworthy. Three validation layers are commonly used in practice:

    1. Terminology alignment validation: check whether the business terms in the question match a controlled glossary; if not, trigger a clarification instead of a guess;
    2. DSL validity validation: check whether the structure, fields, and enum values are legal; if not, fall back to replanning;
    3. Result plausibility validation: check whether the magnitude, null rate, and year-over-year or period-over-period changes fall within a reasonable range; if not, flag the anomaly rather than presenting it as-is.

    At the same time, every analytical result should carry data source annotations and metric definition notes, supporting a drill-down from the answer back to the raw data layer by layer. Traceability is not an add-on feature; it is the dividing line that decides whether an enterprise deployment passes review.

    5. Permissions, Cost, and Implementation Advice

    On permissions, prefer an approach that inherits the existing BI data permissions and avoids the long-term debt of “two permission systems, two places to maintain.” Row-level, column-level, and role inheritance should take effect transparently at the agent layer.

    On cost, the calculation is not limited to license fees. It also includes data migration, metric redefinition, network rework, and operations staffing. The in-place upgrade approach typically concentrates cost on integration and governance rather than asset relocation.

    For implementation, proceed in four steps: first inventory the metric and terminology assets, then define the data boundary and deployment model, then run a small pilot on read-only, single-domain, low-sensitivity scenarios, and finally establish a measurement loop for accuracy, traceability rate, and adoption rate before gradually opening up write and cross-domain analysis capabilities.