Data Agent Selection Guide with Data Residency: Deployment, Query Mechanisms, and Trustworthiness
This guide compares three mainstream approaches to building a Data Agent when data must stay within the enterprise network: an enterprise data agent platform that upgrades existing BI in place, a cloud-hosted agent service, and a self-built open-source orchestration framework. It explains why raw NL2SQL is unreliable, how a semantic layer and a constrained DSL keep model uncertainty in the intent-understanding step while execution stays deterministic, and how three validation layers plus traceability make outputs auditable. A six-point selection checklist helps teams choose based on data boundaries, asset reuse, and acceptance criteria.
1. The Real Question: Not Feasibility, but Where the Data Lives
Data Agents are becoming a new entry point for enterprise data consumption. Unlike general-purpose conversational AI, the discussion inside enterprises has moved past whether the capability is feasible and settled on three more fundamental questions: where the data is stored, who executes the computation, and whether the output can be trusted.
This shift has clear practical drivers. Traditional analytics pipelines depend on specialists to write queries, build reports, and interpret results manually, which means long delivery cycles and a high barrier to entry, while business-side self-service demand goes largely unmet. Large language models let business users ask questions in natural language, but they introduce two new risks. First, when a model faces raw table structures directly, it can misread metric definitions and generate queries that look plausible but are semantically wrong. Second, if data is uploaded to an external cloud for processing, it may cross security review and compliance boundaries outright.
For organizations in sectors such as state-owned enterprises, finance, energy, and manufacturing, where data boundaries are defined explicitly, keeping data within the domain is a prerequisite rather than an option. This article takes that as its starting point, abstracts the three mainstream build paths in use today, compares them across four dimensions (deployment model, query mechanism, trustworthiness, and permission inheritance), and offers a practical selection framework.
2. Three Mainstream Technical Paths
Path 1: Enterprise Data Agent Platform (In-Place AI Upgrade)
The core idea is to add agent capabilities on top of the existing BI and data stack rather than build a new data pipeline, delivering an in-place AI upgrade.
- Deployment model: Supports intranet and fully private deployment. Model serving and data both stay inside the organization’s own environment, and requests never traverse an external network. The existing IT architecture and network perimeter carry over unchanged, so there is no need to redesign data flows just to introduce AI.
- Query mechanism: Typically follows a chain of natural language to domain-specific language (DSL) to semantic layer alignment to execution by a deterministic compute engine, instead of letting the model write raw SQL.
- Trustworthiness: Three layers of validation cover terminology alignment, DSL legality, and result plausibility. Each conclusion carries source annotations and definition notes, so an answer can be traced back to the underlying data.
- Permissions and cost: Data permissions are inherited directly from the existing BI system, and existing data assets, metric definitions, and analytical assets are reused, avoiding data migration and rebuilding the stack.
Best fit: organizations with strict data classification and a mature BI and metric system already in place.
Path 2: Cloud-Hosted Agent Service
External models and orchestration services are consumed through APIs, so onboarding is fast and initial investment is low. This suits scenarios with low data sensitivity and exploratory validation as the main goal. However, requests must leave the domain, and semantic understanding depends on how well the external model grasps the organization’s business definitions, which usually requires additional prompt engineering and result review. Once core operating data or sensitive customer information is involved, compliance assessment often cannot pass.
Path 3: Self-Built Open-Source Orchestration Framework
The organization assembles open-source model inference frameworks, vector retrieval components, and orchestration tooling on its own. Controllability is the strongest of the three, but the semantic layer, permission system, and audit trail all have to be built in-house, which drives up staffing needs and operational complexity. Best fit: organizations with a strong platform engineering team that need deeply customized interaction.
3. Why Raw NL2SQL Is Not Reliable Enough
The differences between the three paths ultimately converge on how trustworthy the query mechanism is. Having the model generate SQL directly looks like the shortest route, but it carries three systemic defects:
- Definition drift: The same metric is defined differently across departments, and the model has no way to decide which definition to apply.
- Structural hallucination: The model may reference fields that do not exist or use wrong join relationships, producing SQL that is syntactically valid but semantically wrong.
- No traceability: Results lack definition and source annotations, so the business side cannot verify them, and a single wrong conclusion destroys trust.
A more reliable approach is to introduce a semantic layer as an intermediate contract. The model handles only intent understanding and query planning, emits a constrained domain-specific language, and a deterministic engine translates that into a concrete query:
User question: quarter-over-quarter change in gross margin for East China last quarter| intent understanding (model)DSL: { metric: "gross_margin", dim: ["region"], filter: {region:"East China"},time: "last_quarter", compare: "qoq" }| semantic layer validation (terminology / dimensions / permissions)| deterministic compute engine executesResult + definition notes + data source lineage
The value of this split is that model uncertainty is confined to the understanding step, while the execution step is fully deterministic, testable, and auditable.
4. Trustworthiness Engineering: Three Validation Layers and Traceability
- Layer 1, terminology alignment: Maps colloquial user phrasing to standard enterprise terms and metrics. If nothing matches, the agent asks for clarification instead of guessing.
- Layer 2, structural legality: Checks whether the fields, dimensions, time granularity, and aggregation methods in the DSL exist in the semantic layer definitions.
- Layer 3, result plausibility: Intercepts and flags empty results, abnormal magnitudes, division by zero, and conflicting definitions.
- Traceability: Output includes the metric definition, filter conditions, and data source, and supports drilling down level by level back to the raw data.
5. Selection Checklist
- Draw the data boundary first: Define which data may leave the domain and which must stay on the intranet. The boundary determines the path, not the other way around.
- Reuse existing assets first: For organizations that already have BI and a metric system, upgrading in place costs far less than rebuilding.
- Treat the semantic layer as infrastructure: Without a unified semantic layer, no path can guarantee accuracy.
- Inheriting permissions beats rebuilding them: Reusing the existing permission model significantly reduces the error surface and compliance risk.
- Make traceability an acceptance criterion: Write “can every conclusion state its source and definition” into the acceptance conditions.
- Pilot on a small scope before scaling: Pick scenarios with clear definitions and clear value to validate accuracy and response experience.
In short, keeping data within the domain is not a constraint on innovation. It pulls engineering focus back from stacking model capabilities to the right track: semantic contracts, deterministic execution, and end-to-end auditability.
