Enterprise data teams are discovering that the two dominant models for AI-assisted analytics are failing them in opposite directions. Agent-generated analytics produce flexible, powerful outputs that quickly become ungovernable piles of mixed-language files with no audit trail and no consistent schema. Proprietary BI copilots offer safety and structure, but the UI surface constrains what agents can actually do, and the vendor controls the ceiling. The architectural question that matters for heads of data and engineering is not which of these models to choose. It is how to build a third path using open source declarative layers that give agents governed rails without collapsing the analytical freedom that justifies the investment.
The Governance Gap Is Structural, Not Operational
The problem with agent-generated analytics is not that the agents write bad code. Most modern code-generation agents produce syntactically correct SQL or Python for a given prompt. The problem is that there is no shared contract between what the agent produces and what the downstream system expects.
When an agent generates a metric definition in one session and a slightly different version in another, both may be technically valid. Neither is authoritative. Over time, the data team inherits a collection of ad-hoc definitions that cannot be reconciled without manual archaeology.
This is a structural failure, not an operational one. No amount of prompt engineering or agent fine-tuning resolves it because the gap exists at the layer below the agent, in the absence of a declared, version-controlled semantic model that the agent must write against.
Why BI Copilots Do Not Close the Gap
Proprietary BI copilots appear to solve this by constraining agents to a governed surface. The agent can only produce outputs that the BI tool's API permits, which limits the blast radius of any single bad generation. That constraint is real and valuable in certain contexts.
The cost is equally real. Copilots embedded in BI platforms are optimised for the vendor's data model, not the organisation's. Metric definitions, join logic, and aggregation rules are encoded in the tool's proprietary layer, which means they are not portable, not independently testable, and not accessible to the rest of the data stack.
When a finance team asks why a dashboard number differs from a warehouse query, the answer is often trapped inside the BI tool's internal state. That is not a governance posture. It is a black box with a better interface.
The Declarative Layer as the Architectural Pivot
The pattern that resolves both failure modes is a declarative semantic layer sitting between the data warehouse and the agent's output surface. Tools like dbt's semantic layer, Cube, and LookML-style YAML definitions represent metrics, dimensions, and join paths as version-controlled code rather than as embedded BI logic.
What Declarative Means in Practice
A declarative metric definition specifies what a metric is, not how to compute it in any particular context. The agent writes against this specification. Any dashboard, notebook, or downstream API that consumes the metric reads from the same authoritative definition.
This matters commercially because it decouples analytical flexibility from governance risk. An agent can generate a new dashboard configuration, a custom cohort analysis, or a one-off executive report without redefining what "monthly active users" means. The definition is fixed upstream. The agent operates within it.
Audit Trail Design
A declarative layer also makes audit trail design tractable. Because every metric query passes through a defined interface, the system can log which definition version was used, which agent session triggered the query, and which downstream surface consumed the result.
Without this layer, audit trails require instrumenting the agent itself, which is fragile and session-dependent. With it, the audit trail is a property of the semantic layer, not of any individual agent run. That distinction matters significantly for regulated industries where lineage is a compliance requirement, not a nice-to-have.
Open Source Tooling and the Vendor Lock-In Calculus
The case for open source implementations of this pattern is not ideological. It is about where the control boundary sits. When the semantic layer is open source and version-controlled in the organisation's own repository, the definitions are owned by the engineering team. They can be tested in CI, reviewed in pull requests, and migrated independently of any BI vendor's release cycle.
Proprietary semantic layers exist inside vendor platforms and move on vendor timelines. If the vendor deprecates a metric type or changes how joins are resolved, the organisation's governance posture changes with it, without a code review and without a rollback path.
The open source alternative introduces its own operational costs, particularly around tooling maintenance and schema migration management. Those costs are real and should be scoped honestly before committing to the architecture. For most teams above a certain data maturity threshold, however, the long-term control is worth the short-term overhead.
Deploying Agents Against a Governed Surface
Once the declarative layer is in place, the agent's role changes from metric author to query composer. The agent reads the available metric definitions, constructs queries that conform to the declared schema, and passes outputs to a rendering layer that does not need to understand the agent's internal reasoning.
This separation has a practical consequence for agent reliability. Agents that generate free-form SQL against a raw warehouse schema are sensitive to schema drift, naming inconsistencies, and undocumented join paths. Agents that query a stable semantic API are insulated from most of those failure modes because the semantic layer absorbs the complexity.
The governance benefit compounds over time. As the semantic layer grows, the agent's effective analytical surface grows with it, without introducing new governance risk. Each new metric definition is reviewed, tested, and merged through the same process as any other infrastructure change. The agent inherits the governance without requiring additional agent-level controls for each new capability.
Companion piece to our broader work on agent-driven analytics governance. See Governed Self-Serve Analytics: Agent Abstraction Layer for how to architect the abstraction layer between AI agents and BI dashboards, covering auditability and scalable agent-driven reporting.
Where Vector Labs Fits
We design and build production data architectures that give AI agents governed analytical surfaces without constraining the flexibility that makes them operationally useful. In our agent abstraction layer analysis, we set out the specific architectural decisions that separate governed self-serve analytics from ungovernable agent sprawl, including audit trail design and semantic layer integration. If you are evaluating how to structure this for your organisation, contact us at vector-labs.ai/contacts.
FAQs
A declarative semantic layer defines metrics, dimensions, and join logic as version-controlled configuration rather than as embedded SQL or BI tool logic. Unlike a standard data model, which describes how data is stored, a semantic layer describes what business concepts mean and how they should be computed, independent of the query engine or visualisation tool consuming them. This makes definitions portable, testable, and auditable in ways that BI-embedded logic is not.
Yes, and this is typically how the transition happens in practice. Most mature semantic layer tools expose a SQL or REST API that existing BI tools can query against. The BI tool becomes a rendering surface rather than the definition authority. The semantic layer holds the metric definitions, and the BI tool visualises the results. This avoids a full rip-and-replace migration while progressively shifting governance control to the open source layer.
Schema drift is absorbed at the semantic layer rather than propagated to the agent. When an underlying warehouse column changes, the semantic layer definition is updated and reviewed through a normal pull request process. The agent's query interface remains stable because it queries named metrics and dimensions, not raw column references. This means the agent does not need to be retrained or re-prompted when warehouse schemas evolve.
In a well-structured governed stack, the audit trail captures which metric definition version was queried, which agent session or user triggered the query, the timestamp, and which downstream surface consumed the result. This is logged at the semantic layer interface rather than inside the agent, which makes the trail durable across agent versions and sessions. For regulated industries, this lineage record can be exported and attached to compliance documentation without manual reconstruction.
Teams with fewer than two or three data engineers, or those without an established data warehouse and transformation pipeline, will find the operational overhead of maintaining an open source semantic layer difficult to justify. The architecture is most appropriate for teams that already have a functioning dbt or equivalent transformation layer, a data warehouse with stable schemas, and a clear need for agent-generated analytics at scale. Below that threshold, a managed BI copilot may be the more pragmatic starting point, with a migration path planned for when maturity increases.

