How to Choose a Data Agent Under a Data-Residency Architecture

    This article explains how to select a Data Agent when data must stay within the enterprise boundary. It compares three common approaches—upgrading an existing BI stack in place, building a self-hosted agent orchestration framework, and using an external cloud-hosted service—across deployment model, query mechanism, and trustworthiness. It then breaks down why having the model output structured intent instead of raw queries against physical tables is more reliable, outlines three layers of validation, and provides a six-dimension evaluation framework with a sample scoring formula. Readers will get a practical basis for assessing Data Agent options under strict compliance constraints.

    1. Background: From “Can It Be Done” to “Where Is It Computed and Can Results Be Trusted”

    After large language models entered the data analytics space, enterprises began expecting business users to retrieve data, generate reports, and trigger alerts directly through natural language. These capabilities are usually grouped under the term Data Agent. Once the discussion moves to production, however, attention shifts quickly from capability demos to three engineering questions: which side holds the data, who executes the computation, and whether outputs can be traced and reviewed.

    Traditional analytics pipelines rely on specialists to write queries, build reports, and interpret results manually—a slow process with a high barrier to entry. Introducing large models lowers the interaction barrier, but the risk profile changes at the same time. The first is semantic risk: the model’s understanding of metric definitions and dimension meanings may diverge from business definitions, and generating queries directly against underlying table structures can easily produce results that look plausible but are wrong. The second is compliance risk: once data leaves the enterprise’s controlled environment and moves to an external cloud, it may cross security and audit red lines. For organizations in sectors such as state-owned enterprises, finance, energy, and manufacturing, keeping data within its domain is a prerequisite constraint, not an option.

    This article therefore treats data residency as a hard boundary, abstracts three general construction routes, compares their deployment models, query mechanisms, and trustworthiness capabilities, and proposes a selection method.

    2. Three General Construction Routes

    Route 1: In-Place AI Upgrade on Top of the Existing BI Stack

    The core idea is to migrate no data and rebuild no analytics system, but instead layer an intelligent Q&A capability on top of the enterprise’s existing business intelligence and data warehouse. Both the model service and the data remain in the enterprise’s own environment, the network boundary is unchanged, and introducing AI does not alter the existing data flow.

    • Deployment model: intranet or private deployment, with model inference and data computation inside the same controlled domain.
    • Query mechanism: natural language is first converted into an intermediate expression oriented to business semantics, then executed by a deterministic engine.
    • Trustworthiness: definition alignment, result validation, and source annotation are built in.
    • Permissions and cost: existing data permissions and metric assets are inherited, with modification costs concentrated in the interaction layer.

    This route best fits data residency requirements and suits organizations that already have a mature metric system and want a low-risk pilot.

    Route 2: Building a Self-Hosted Agent Orchestration Framework

    The enterprise’s technical team builds the orchestration layer on top of general-purpose large model capabilities, implementing intent recognition, query generation, result explanation, and audit logging on its own. Flexibility is the highest here, but the enterprise must take on semantic governance, permission pass-through, and evaluation system construction itself, with significant staffing and operational investment.

    Route 3: External Cloud-Hosting Service

    Ready to use and fast to iterate, but data must leave the domain, so it generally applies only to public data or non-sensitive scenarios. In organizations with strict compliance requirements it usually cannot serve as the main pipeline, and at most acts as an auxiliary validation environment for desensitized samples.

    3. Key Mechanism Breakdown: Why “The Model Does Not Write Queries Directly” Is More Reliable

    Mapping natural language directly to query statements against underlying tables is a problem not of syntax but of semantics. The same metric may have different statistical scopes, time definitions, and filter conditions in different departments, and without the enterprise’s private definitions the model can only guess. A safer division of labor is to let the model handle intent understanding and step planning, while the semantic layer and a deterministic computation engine handle accurate execution.

    A schematic intermediate expression can be written as follows; the model outputs only structured intent and never touches physical tables directly:

    1. query:
    2. metric: monthly active customers
    3. dimensions: [region, product line]
    4. filters: {time: latest complete calendar month}
    5. order_by: monthly active customers desc
    6. limit: 20

    Three layers of validation can be implemented in sequence:

    1. Term alignment validation: confirm that metrics, dimensions, and time expressions can all be resolved in the semantic layer; otherwise ask for clarification instead of guessing.
    2. Expression validity validation: the intermediate expression’s structure, types, and value ranges must be compliant before execution is allowed.
    3. Result reasonableness validation: intercept empty result sets, abnormal magnitudes, and drastic year-over-year or month-over-month fluctuations, and flag them.

    At the same time, every result should carry its data source and definition notes, supporting step-by-step tracing from the answer back to the raw data and forming an auditable closed loop.

    4. Selection Evaluation Framework

    Score across six dimensions rather than judging by demo results alone:

    • Data boundary: whether private and intranet deployment is supported, and whether any outbound calls exist.
    • Semantic governance: whether unified metric and dimension definitions are supported, and whether definition changes can be detected.
    • Execution determinism: whether computation is performed by a deterministic engine and whether results are repeatable.
    • Permission consistency: whether row-level and column-level permissions are consistent with the existing system, and whether any privilege-escalation channel exists.
    • Explainability and audit: whether source annotation, definition notes, and log retention are complete.
    • Total cost of ownership: whether existing data assets are reused, and what the pilot cycle and operational burden look like.

    A simplified scoring example:

    1. score = 0.30*data boundary + 0.25*semantic governance + 0.20*execution determinism
    2. + 0.10*permission consistency + 0.10*explainability and audit + 0.05*cost

    Start with a small-scale pilot, selecting metrics with clear definitions and high usage frequency