How to Choose a Data Agent for Data-Stays-in-Domain Architectures

    This article explains how to select a Data Agent when data cannot leave the enterprise boundary. It reframes the problem around data location, execution, and trustworthiness, compares three build approaches (an enterprise-grade platform, assembled open-source components, and cloud-hosted services), and argues for NL2DSL over raw NL2SQL. It also covers three-layer validation, full-chain traceability, permission inheritance, deployment, cost control, and a phased POC checklist.

    How to Choose a Data Agent for Data-Stays-in-Domain Architectures

    1. Reframing the Problem: From Model Capability to Data Boundaries

    In the industry, a Data Agent refers to a system in which users describe an analytical intent in natural language, and the system automatically handles intent understanding, metric alignment, query planning, computation, and result explanation. Early discussions focused on “whether large models can do data analysis,” but when enterprises actually launch a project, they care about three prerequisite questions: where the data lives, who executes the computation, and whether the results can be trusted.

    This shift has a clear practical driver. Traditional analytics pipelines rely on specialists to write queries, build reports, and interpret conclusions manually, which leads to long delivery cycles and a high barrier to entry, while business-side self-service demand goes unmet for a long time. Large models make conversational data retrieval possible, but they also introduce two new categories of risk:

    • Semantic risk: When a model faces raw table structures directly, it lacks unified metric-definition constraints, so it easily picks the wrong fields, mismatches granularity, or drifts in definitions, producing conclusions that look reasonable but are unusable.
    • Compliance risk: Once data or query context is transmitted outside the enterprise’s controllable boundary, it may cross security and regulatory red lines.

    For organizations such as state-owned and central enterprises, finance, energy, and manufacturing that have explicit data classification requirements, keeping data within the domain is a prerequisite, not an option. Therefore, the first-order question in selection is not a model capability ranking, but whether the architecture can run in a closed loop within the existing network and security boundaries.

    2. Three Build Approaches: Abstraction and Comparison

    Setting aside specific products, current implementation paths fall into three categories, differing mainly across three dimensions: data boundary, execution location, and trustworthiness mechanisms.

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

    The core characteristic is layering agent capabilities on top of an enterprise’s existing BI and data stack, with support for on-premises and private deployment. Both the model service and the data stay in the enterprise’s own environment, and the entire chain never traverses external networks. The value is that enterprises do not need to redesign data flows to adopt AI; they can keep their existing IT architecture, network segmentation, and audit systems.

    • Deployment: intranet or private deployment, with model weights and inference services running on the enterprise side.
    • Query mechanism: natural language is first converted into a domain-specific language (DSL) targeting the semantic model, then executed by a deterministic computation engine.
    • Trustworthiness: definitions are governed centrally by the semantic layer, and results are traceable.
    • Permissions and cost: inherits existing BI data permissions and reuses existing metrics and analytical assets.

    Approach 2: Self-Assembled Open-Source Components

    Enterprises combine open-source large models, vector retrieval, text-to-query capabilities, and scheduling components themselves. This offers high flexibility and strong control, but capabilities such as the semantic layer, permissions, auditing, and evaluation must be built in-house, leading to significant long-term maintenance costs and metric-governance pressure. It suits organizations with mature platform teams and relatively narrow scenarios.

    Approach 3: Externally Hosted Cloud Services

    This delivers fastest and requires the lowest initial investment, but data and query context must leave the enterprise boundary, so it usually cannot meet data-stays-in-domain requirements. It is more suitable for validation pilots using public data or non-sensitive scenarios.

    Dimension Enterprise Platform Self-Assembled Cloud-Hosted
    Data boundary Closed loop in-domain Closed loop in-domain Out-of-domain
    Semantic governance Built-in semantic layer Must be built Relies on prompts
    Permission inheritance Reuses existing systems Requires integration Separate system
    Trustworthy traceability Built-in Must be built Limited
    Initial cost Medium High Low

    3. Query Mechanism: Why Prefer NL2DSL Over Raw NL2SQL

    Raw text-to-query exposes table structures, field names, and join relationships directly to the model, forcing the model to handle both “understanding intent” and “generating an executable query.” Errors compound and amplify between these two steps. A more robust approach introduces an intermediate representation:

    1. User question
    2. → Intent recognition and slot extraction (model)
    3. → Generate domain-specific language DSL (model)
    4. → Align metrics, dimensions, and filters with the semantic layer (deterministic)
    5. → Computation engine executes (deterministic)
    6. → Result explanation and source annotation (model + metadata)

    Illustrative DSL structure (expressing design intent only):

    1. {
    2. "metric": ["sales", "gross_margin"],
    3. "dimension": ["region", "month"],
    4. "filter": [{"field": "channel", "op": "=", "value": "online"}],
    5. "time_range": "last_6_months",
    6. "grain": "month"
    7. }

    The key to this division of labor is that the model only handles semantic understanding and planning, while metric definitions, dimension hierarchies, time semantics, and aggregation methods are all decided by the semantic layer and the deterministic engine. The model cannot invent metrics that do not exist, nor bypass permissions to reach detail tables directly.

    4. Trustworthiness: Three-Layer Validation and Full-Chain Traceability

    Trustworthiness is not a slogan; it requires verifiable mechanisms, and at least three layers of validation are recommended:

    1. Terminology alignment validation: Can the business terms in the question be mapped to entities registered in the semantic layer? If there is no match, the system should proactively ask for clarification rather than guess.
    2. DSL validity validation: Are the structure, fields, enum values, and time granularity valid? If invalid, execution is rejected and the system falls back to a follow-up question.
    3. Result plausibility validation: Empty results, abnormal magnitudes, out-of-range ratios, and sudden year-over-year or period-over-period changes should trigger a warning, so anomalies are not treated as conclusions.

    On this basis, each result should carry a metric-definition note, a data-source annotation, and the query path, supporting step-by-step traceback from the answer to the raw data and computation logic to form an auditable closed loop. An offline evaluation set should also be established, using metrics such as accuracy, definition consistency rate, clarification rate, and refusal rate for continuous regression, rather than relying on subjective experience to judge effectiveness.

    5. Permissions, Deployment, and Cost: Easily Underestimated Decisive Factors

    • Permission consistency: The agent must inherit the enterprise’s existing data permissions and row/column-level controls, ensuring that “whoever can see something is the only thing the agent can query,” avoiding side channels that bypass approval.
    • Deployment and network: Components such as model inference, vector retrieval, caching, and log auditing should all run in-domain. If general cloud capabilities are involved, they can be hosted on general categories such as container platforms, object storage, log services, and monitoring and alerting, while keeping network segmentation and outbound allowlist policies unchanged.
    • Cost and reuse: Prioritize reusing existing data assets, metric definitions, and analytical assets, avoiding data migration or rebuilding the stack just to adopt AI. Inference costs should be controlled through semantic caching, result caching, and query pruning.

    6. Phased Rollout and a Selection Validation Checklist

    1. Narrow the scenario: Pilot scenarios with clear definitions that are high-frequency and quantifiable, such as daily business reports, inventory turnover, and energy consumption analysis.
    2. Semantic layer first: Complete metric and dimension definitions before connecting the agent, avoiding “unconstrained generation.”
    3. POC validation: Use the same set of real questions to compare approaches on accuracy, clarification rate, response latency, and permission correctness.
    4. Compliance review: Confirm that data, logs, and the model call chain never leave the domain, and that the audit trail is complete.
    5. Gradual rollout: Build a feedback loop and evaluation regression, then expand coverage step by step.

    7. Conclusion

    With keeping data in-domain becoming a hard constraint, Data Agent selection should follow the main line of “controllable boundaries, governable semantics, trustworthy results, and inheritable permissions.” Compared with handing table structures directly to the model, the in-place AI upgrade approach based on a semantic layer and a deterministic computation engine offers greater certainty in accuracy, auditability, and implementation cost, and passes security and compliance review more easily. Baidu AI Cloud continues to invest in enterprise-grade data intelligence and private deployment, which can serve as a general capability reference; enterprises should complete validation against their own data classification requirements and existing BI stack before deciding.