/ /
Why metric definitions matter for reliable AI agents

Why metric definitions matter for reliable AI agents

Joey Gault

last updated on Apr 30, 2026

The challenge of semantic ambiguity

dbt agents operate fundamentally differently than human analysts. When a human encounters ambiguity in a metric definition, they can apply context, ask clarifying questions, or make informed assumptions based on institutional knowledge. AI agents lack this intuitive understanding. Without precise definitions, they generate inconsistent results that undermine trust and create operational risk.

Consider a seemingly straightforward metric like "monthly revenue." Across different departments, this could mean revenue recognized in a given month, revenue booked that month, revenue from contracts starting that month, or revenue adjusted for returns and refunds. A human analyst working with the finance team understands which definition applies in context. An AI agent querying data autonomously does not.

When multiple agents operate across different teams—a sales agent analyzing pipeline performance, a finance agent generating forecasts, and a customer success agent evaluating retention—semantic inconsistency creates a compounding problem. Each agent might calculate "monthly revenue" differently, producing conflicting outputs that require manual reconciliation. This defeats the purpose of autonomous analytics and erodes confidence in agent-generated insights.

The scale of this challenge becomes apparent in modern data environments. Organizations now work across an average of 400 data sources, with nearly one in five enterprises managing more than 1,000 sources. In these complex ecosystems, the same business concept might be represented dozens of different ways across systems. Without a shared semantic layer that provides consistent definitions, agents amplify rather than resolve this fragmentation.

Structured context as the foundation for agency

For AI agents to operate safely and effectively in enterprise environments, they require more than instructions and advanced language models. They need structured context: the schemas, semantics, relationships, permissions, and lineage that describe how data works within an organization.

Structured context equips agents with three essential capabilities. First, it provides memory through metadata, enabling agents to understand what data assets exist and how they relate to one another. Second, it establishes boundaries through clear definitions, permissions, and rules that prevent agents from operating outside established guardrails. Third, it enables useful actions by providing validated tools and interfaces for reading and writing data safely.

Metric definitions sit at the heart of this structured context. When an agent needs to answer a question about customer churn, it must know precisely how "churn" is defined, which data sources contain the authoritative calculation, what business rules apply, and who has permission to access the underlying data. Without this semantic foundation, agents resort to guessing or hallucinating definitions, producing unreliable results.

dbt excels at creating this structured foundation through data transformation workflows that convert raw data into analytics-ready models with built-in testing, lineage tracking, and semantic meaning. By defining metrics consistently within dbt models and exposing them through the dbt Semantic Layer, organizations create a single source of truth that both humans and agents can reliably query.

The cost of poor definitions

The consequences of weak metric definitions become severe when agents operate autonomously at scale. Poor data quality is cited as the primary reason AI projects fail to deliver expected value, and organizations lose an average of $12.8 million annually due to data quality issues, with some companies losing as much as 6% of annual revenue from flawed AI outputs.

High-profile failures illustrate the risk. Airlines have faced legal action when chatbots promised refunds based on hallucinated policies. Lawyers have submitted briefs citing fictional cases generated by AI systems. News organizations have published AI-generated travel content directing readers to unsafe destinations. Even the most advanced language models hallucinate at significant rates when operating without proper grounding in structured, validated data.

In the context of business analytics, these failures manifest as agents that confidently report incorrect metrics, make recommendations based on flawed calculations, or trigger automated actions using inconsistent business logic. When an agent autonomously adjusts pricing based on a miscalculated margin metric or sends customer communications based on an incorrect churn definition, the operational and reputational damage can be substantial.

Regulatory frameworks are making these risks explicit. Under the EU AI Act, particularly Articles 10 and 27, organizations deploying high-risk AI systems must demonstrate that their data is complete, accurate, representative, and error-free. This includes comprehensive documentation of data sources, quality checks, and bias mitigation measures. Metric definitions are a core component of this compliance obligation: organizations must be able to prove that their AI systems are calculating business-critical metrics correctly and consistently.

Governance through definition

Effective governance for AI agents cannot be bolted on after deployment. It must be embedded in the data transformation layer where metrics are defined and calculated. This approach ensures that governance policies flow automatically through dependent models and that agents inherit the correct definitions and access controls.

When metrics are defined centrally in dbt, changes propagate consistently across all downstream uses. If the definition of "active user" changes to reflect new product features, that update flows automatically to every dashboard, report, and agent that references the metric. This eliminates the drift that occurs when definitions are scattered across multiple systems or hardcoded into individual queries.

Column-level security and row-level access controls become particularly important for agents. Unlike human users who might access a dashboard showing aggregated metrics, agents often query underlying data directly. A conversational analytics agent responding to a sales manager's question about team performance should only access data for that manager's region and team members. These access boundaries must be defined at the metric level and enforced consistently regardless of how the data is accessed.

The dbt MCP (Model Context Protocol) server provides a standardized interface for exposing dbt models, lineage, and semantic context to AI systems while maintaining fine-grained, policy-aware access controls. This enables agents to discover available metrics, understand their definitions and lineage, and query them safely within established governance boundaries.

Enabling multi-agent collaboration

As organizations move beyond single-purpose agents to multi-agent architectures, consistent metric definitions become even more critical. In these systems, specialized agents handle specific functions and collaborate through orchestration layers to complete complex tasks.

Consider a scenario where a discovery agent helps a business user identify relevant datasets, an analyst agent generates insights from those datasets, and a developer agent creates new data models based on the findings. For this workflow to function reliably, all three agents must share a common understanding of the metrics involved. If the discovery agent surfaces a "customer lifetime value" metric that the analyst agent calculates differently, the entire workflow breaks down.

Event-driven architectures for multi-agent systems depend on semantic consistency. When one agent publishes an event indicating that a key metric has crossed a threshold, downstream agents must interpret that metric identically to respond appropriately. This requires metric definitions to be versioned, documented, and accessible through shared interfaces that all agents can query.

Organizations implementing multi-agent systems should treat metric definitions as contracts between agents. Just as microservices rely on well-defined APIs, agents rely on well-defined metrics. Changes to metric definitions should follow the same rigorous change management processes as API changes, including versioning, deprecation notices, and backward compatibility considerations.

Practical implementation for data engineering leaders

Building a metric definition framework that supports reliable AI agents requires deliberate architectural choices. Data engineering leaders should focus on several key practices.

Start by mapping all business-critical metrics and documenting their definitions comprehensively. This includes not just the calculation logic, but also the business context, data sources, refresh frequency, known limitations, and ownership. These definitions should live in version control alongside the dbt models that implement them, creating a single source of truth that evolves with the business.

Implement comprehensive testing for metric calculations. dbt's testing framework enables data teams to validate that metrics are calculated correctly, that underlying data meets quality standards, and that changes don't introduce regressions. For AI agents, these tests serve as guardrails that prevent autonomous systems from operating on flawed data.

Establish clear ownership and approval processes for metric changes. When an agent relies on a metric definition to make autonomous decisions, changes to that definition have operational implications. Metric owners should be identified, change requests should be reviewed by stakeholders, and impacts should be assessed before deployment.

Expose metrics through a semantic layer that provides a consistent query interface for both humans and agents. The dbt Semantic Layer enables organizations to define metrics once and query them consistently across tools, eliminating the proliferation of slightly different metric implementations that creates semantic drift.

Monitor how agents use metrics in production. Observability for agentic systems should include tracking which metrics agents query, how they interpret results, and what actions they take based on those metrics. This visibility enables rapid intervention when agents misinterpret metrics and creates feedback loops for improving definitions.

The path forward

The shift toward agentic analytics is accelerating. According to the IBM Institute for Business Value, 70% of executives consider agentic AI critical to their future, and 61% of CEOs report actively deploying or scaling AI agents. The agentic AI market, valued at $5 billion today, is projected to reach $50 billion by 2030.

Organizations that establish rigorous metric definition practices now will be positioned to deploy autonomous analytics systems with confidence. Those that treat metric definitions as an afterthought will struggle with unreliable agents, inconsistent outputs, and erosion of trust in AI-generated insights.

For data engineering leaders, the imperative is clear: invest in the semantic foundation that makes autonomous analytics possible. dbt's semantic layer provides the transformation framework for defining metrics consistently, testing them rigorously, and exposing them through interfaces that agents can query reliably. Explore dbt's agent capabilities and the dbt documentation to learn how to implement these practices at your organization.

The organizations that will thrive in the era of agentic analytics are those that recognize metric definitions not as a documentation exercise but as critical infrastructure. By treating metrics as first-class data products with clear ownership, rigorous testing, and consistent governance, data engineering leaders create the foundation for AI agents that augment rather than undermine analytical capabilities.

AI agent FAQs

VS Code Extension

The free dbt VS Code extension is the best way to develop locally in dbt.

Share this article
The dbt Community

Join the largest community shaping data

The dbt Community is your gateway to best practices, innovation, and direct collaboration with thousands of data leaders and AI practitioners worldwide. Ask questions, share insights, and build better with the experts.

100,000+active members
50k+teams using dbt weekly
50+Community meetups