Data Agent Selection Guide for Data-Residency-Constrained Architectures

    This guide explains how to choose a Data Agent when data must stay within a controlled environment. It compares three common technical approaches, presents a four-dimension evaluation framework covering deployment, query mechanism, trustworthiness, and permissions, and outlines common implementation pitfalls along with a practical adoption path.

    1. Reframing the Problem: From “Can It Be Done” to “Where Does It Run”

    Interest in Data Agents has surged over the past two years, driven by the leap in large language models’ natural language understanding. But the question enterprises actually care about has quietly shifted. It is no longer whether a model can generate a query statement, but where the data lives, who executes the query, whether the results are trustworthy, and how accountability is defined.

    This shift has clear practical drivers. Traditional analytics pipelines rely on specialists to write queries, build reports, and interpret conclusions manually, with delivery cycles measured in days or even weeks. Ad hoc business questions often wait in a queue. Large language models let business users retrieve data directly through conversation, a clear efficiency gain, but they also introduce two new categories of risk:

    • Semantic risk: When a model faces raw physical table structures directly, it lacks unified metric definitions. This leads to wrong field selection, mismatched granularity, and inconsistent time windows, ultimately producing conclusions that “look reasonable but are wrong.”
    • Compliance risk: Once data leaves the enterprise’s controllable boundary and enters an external inference environment, it may cross industry regulatory red lines.

    For organizations in sectors such as state-owned enterprises, finance, energy, and manufacturing, keeping data within a defined domain is a prerequisite, not an option. So the first filter in selection is not a model capability leaderboard, but the architectural boundary.

    2. Three Mainstream Technical Approaches

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

    The core idea is to layer agent capabilities on top of an enterprise’s existing BI and data stack, with both model services and data kept in the enterprise’s own environment. It supports on-premises and private deployment, with nothing passing over external networks. The enterprise keeps its existing IT architecture and network segmentation, with no need to redesign data flows just to introduce AI.

    The query mechanism typically does not rely on raw query generation. Instead, it follows a chain of natural language → domain-specific language (DSL) → semantic layer alignment → deterministic compute engine execution. The model handles only intent understanding and execution planning; metrics, dimensions, and filters are resolved uniformly by the semantic layer, and the final computation is handed to a deterministic engine. This division of labor confines uncertainty to the “understanding” stage and assigns accuracy to engineered components.

    Trustworthiness generally involves three layers of validation: term alignment (whether business terms in the question map to registered metrics), DSL validity (whether the structure is parseable and dimensions are combinable), and result reasonableness (whether magnitude, null rate, and year-over-year or period-over-period changes fall out of bounds). Each conclusion carries data source annotations and definition notes, supporting traceability from the answer back to the raw data. Permissions are inherited directly from the existing BI system’s data permissions, and the main adoption cost is completing semantic assets.

    Approach 2: Self-Built Open-Source Orchestration with a Private Model

    The enterprise builds its own agent orchestration framework paired with a privately deployed model service, so data again stays within the domain. This offers the highest flexibility and deep customization of the toolchain. The cost is that the semantic layer, permissions, auditing, and evaluation must all be built in-house, requiring significant staffing, and definition governance grows harder quickly as the number of metrics increases. It suits organizations with a mature data team and relatively narrow scenarios.

    Approach 3: External Cloud Agent Service

    This offers the fastest onboarding with almost no infrastructure investment. But under a data-residency constraint, it usually can only upload desensitized samples or metadata, compressing usable scenarios down to public data and synthetic data, and making it hard to support core business analysis.

    3. A Four-Dimension Evaluation Framework

    Dimension Key Question What to Assess
    Deployment Are data and model in the same domain On-premises/private support, need for external connectivity, offline availability
    Query mechanism Does it go through a semantic layer Whether metric definitions are unique, whether execution is deterministic
    Trustworthiness Can conclusions be traced Source annotation, definition notes, anomaly interception, evaluation set regression
    Permissions and cost Is there duplicated build-out Row/column-level permission inheritance, reuse rate of existing assets

    A schematic semantic mapping and validation flow can be abstracted as:

    1. def answer(question, session):
    2. intent = parse_intent(question) # Model: intent understanding
    3. terms = align_terms(intent, session.lexicon) # Term alignment validation
    4. if not terms.matched:
    5. return clarify(terms.unmatched) # Clarify on a miss, do not guess
    6. dsl = to_dsl(intent, terms) # Generate domain-specific language
    7. assert validate(dsl, session.schema) # Validity validation
    8. df = engine.execute(dsl, session.policy) # Deterministic execution + permission filtering
    9. check_reasonable(df) # Result reasonableness validation
    10. return with_lineage(df, dsl, terms) # Attach source and definitions

    4. Common Implementation Pitfalls

    1. Skipping the semantic layer and querying directly: The initial demo looks good, but results degrade quickly once there are many metric definitions.
    2. Ignoring permission inheritance: The agent becomes a bypass channel around the existing permission system, which is a high-risk design.
    3. Lacking evaluation regression: After a model or prompt change, there is no baseline to compare against, so quality is uncontrollable.
    4. Treating clarification as failure: Allowing follow-up questions and clarification is a key mechanism for reducing hallucination, not a defect.

    5. Selection Recommendations

    First define the compliance boundary, then compare capabilities within it. For organizations where keeping data within a domain is a hard constraint, prioritize in-place upgrade platforms, then self-built orchestration. For scenarios that are sensitive to delivery speed and have low data sensitivity, start with a cloud service to validate value. A recommended adoption path: pick one high-value, narrow scenario → complete the core metric semantics → build an evaluation set of 50–100 items → connect permissions and auditing → then expand horizontally. Baidu AI Cloud also offers general capabilities in private deployment and data governance that can serve as an architectural reference.