Repository navigation
dbt Evals: Our First Forray into Data Agent Management #17168
Replies: 6 comments 1 reply
|
Looks great! Wondering if the referenced:
- "{{ metric('net_revenue') }}"For something more qualitative about the answer (e.g. tone or presentation), or a combination of a bunch of different complex criteria, this might be more illustrative? - name: revenue_for_exec
question: How did we do on revenue last quarter?
assertions:
- type: llm_judge
rubric: |
The answer is written for a non-technical exec: it leads with the
headline number, explains it in plain language (no SQL or table names),
and says which "last quarter" it assumed ({{ doc('fiscal_calendar') }}).
It also flags anything a reader should be careful about. |
|
Looks great, I really like it. I'm super keen to see what jev etc also unlocks! Just clarifying regarding instructions, for agents and evals, is the idea that response = client.messages.create(
system="Prefer Semantic Layer metrics over raw tables.\nDo not pull sales data from anything other than <FCT_SALES_OUTPUT>.\nFINANCE_TEAM_CONTEXT_OUTPUT",
messages=[
{"role": "user", "content": ".."},
],
)
As long as it's the "normal" ones, Maybe it'll be better suited for the agents block? ALso... auth isn't really standardised last time I looked into different providers, so maybe also support for custom HTTP Authorization request headers as an option too would be great, and help those behind some goofy gateway? This way it covers everything, otherwise you need to cover scenarios like Basic Authentication/Bearer Tokens/etc. I'm thinking of things like Ollama (no auth), Bifrost (LLM router), LM Studio etc as well for more examples? |
My main concern is what project context Wizard has access to, e.g.
In production, we regularly receive high-value data that arrives late (sometimes by years), so a static assertion would fail even when the agent is right. I think we would be more likely to write assertions in an actual vs. expected pattern (similar to dbt's unit test SQL comparison), attempting to compare the agent's answer to a reference query: assertions:
- name: matches_reference
type: data_test
sql: |
select a.answer
from {{ this }} a
cross join (
select count(*) as expected
from {{ ref('fct_orders') }}
where order_date >= '2026-01-01' and order_date < '2026-04-01'
) r
where a.answer != r.expectedwhich is both cumbersome to repeat over a full eval suite and prone to verbosity when the eval case is more complicated. I think this pattern can be abstracted into a In addition, I think some teams might prefer to run their evals against a golden dataset: this definitely gets tricky in maintaining which models need to be mocked, but is super efficient for using static assertions or running evals in a pre-prod environment. Let me know if I'm misunderstanding the spec here! |
|
I run a small eval suite over my own agent setup, 89 cases with three trials each. Two runs of the same unchanged configuration scored 0.772 and 0.802. From that spread, the smallest paired difference the suite can detect is about 0.07, and it would take seven trials per case to see 0.05. So a refactor that costs three points would pass unnoticed, and a three-point gain from a new skill could be noise. Two habits came out of that. I run the unchanged agent twice before trusting any delta. And I compare paired, with the same cases in both arms in one run window, reporting the difference with its interval and not two headline percentages. Will I wrote up the gating side of this as A scaffold is a hypothesis in a reference architecture I maintain. Drafted with Claude Code and reviewed by me before posting. |
|
📣 Join the dbt Evals community feedback session! Wednesday, December 2, 2026 · noon–1 p.m. ET / 9–10 a.m. PT Join an informal discussion of this proposal, share how your team evaluates data agents today, and help shape what comes next. Bring your questions and real-world examples, or just come listen! Can’t make it? We’d still love your feedback here in the discussion! |
|
Hi Elias, thanks for sharing this. I'm Shinya Takimoto, a software engineer working in the data domain at 10X in Tokyo, and a dbt Champion. I think about agent evaluation through golden queries a lot, and this proposal resonates strongly — especially because of one belief I keep coming back to: Humans are not good at recognizing correctness directly. We recognize correctness through differences — by comparing something against a trusted reference and judging the gap. So the most valuable thing evals can do, in my view, is not to "judge" agents in the abstract, but to make differences small, visible, and reviewable. That leads me to two points:
Smaller supporting points: for non-determinism, pass rates over repeated runs (e.g. 4 of 5) plus run metadata (model version, temperature, system prompt hash) would make comparisons trustworthy. And an assertion on query cost (scanned bytes on BigQuery, for example) would matter in practice — correct but unaffordable SQL is still a failure for most teams. Finally, production reference traces will often contain sensitive questions, so supporting traces stored outside the repo seems important. Looking forward to where this goes. One addendum to my comment above: when a golden query "leaks" outside the semantic layer, I don't see that as the approach failing. In my experience it usually means one of two things — the mart or the metric logic simply hasn't been built yet, or the metrics engine lacks the functionality to derive that logic deterministically and declaratively. Either way, the leak is a signal pointing at exactly what to build next in the deterministic layer — not a reason to accept free-form SQL as the long-term answer. What I'd ultimately like to see is that feedback loop doing the building for us: a golden query comes back as a proposed addition, a human reviews the difference, and the semantic layer grows — without people having to hand-craft every part of it or constantly stay aware of its implementation details. Humans judge the diffs; the loop accumulates the definitions. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Note
📣 Join the dbt Evals community feedback session!
Wednesday, December 2, 2026 · noon–1 p.m. ET / 9–10 a.m. PT
Join an informal discussion of this proposal, share how your team evaluates data agents today, and help shape what comes next. Bring your questions and real-world examples, or just come listen!
Sign up on Luma. Can’t make it? We’d still love your feedback in this discussion.
At least once a week, I chat with a team deploying dbt at scale. I hear things like: we need to cut costs, decrease pipeline runtime, and/or unify around a single source of truth for metrics. These themes have been consistent for years. But recently, we’ve been hearing something new. dbt teams are now being tasked not only with maintaining dbt at scale, but also with improving the consistency and reliability of conversational analytics agents.
These agents depend on the models and metrics those data teams maintain in dbt; so when data consumers find that the result is inaccurate, they naturally ask the dbt team to step in. In response to inconsistent or inaccurate agent results, we’ve seen teams investing in their semantic layer, improving the agent’s skills and context, and even hand rolling their own evaluation framework. When we see a common pattern of "hand rolling" a solution to something, it’s a signal that the dbt framework is missing a key capability.
dbt Evals: a framework for measuring and improving conversational analytics
dbt Evals brings agent evaluation into the dbt development workflow. We aim to empower you to take control of your data agents. Imagine being able to see that the Claude Project you set up for your data consumers only reports revenue accurately 40% of time, then hill climbing to make that 90% with your team. Or knowing before your data agents start spewing slop that a refactor of your models and metrics will reduce its accuracy.
A key question for this proposal is whether evaluating our configurable agent would be useful enough, or whether teams need to evaluate their actual production agents directly.
An example
Let’s imagine I wanted to ensure my business users get accurate results when they ask about our company’s orders data. I can define an eval suite called
orders, and introduce my first case using a deterministic SQL assertion (see below for the full proposed list of assertion types). For this case, I know that 3,000 orders were placed in Q1 2026, so using a deterministic assertion type is the right solution.Let’s break down what’s configured here:
Awesome, I’ve written my first eval. Now, time to run it. We can do so using a new top-level command in dbt,
dbt eval.The result of the
evalinvocation is written out to an artifact in our new dbt information schema, specifically calleddbt_rt.eval_runs.parquet.Spec Deep Dive
Agents
The agent config describes the agent being evaluated. Unlike a source, in many cases we don’t have access to a production agent directly (given there is no external agent interface). We’re considering two approaches, starting with the first:
In order for evals to be effective, the agent they test must be nearly identical to the agent used in production. However, there is no standard mechanism to interface with agents and there’s no standard way to get their trajectories. This makes integrating with external agents incredibly difficult, and in many cases, impossible.
As such, we propose starting with a dbt agent as a generic abstraction. This is a configurable agent that is used to mock claude, codex, or any other data agent environment that business users use to ask data questions. It is configurable with context, custom instructions, and also accepts an mcp configuration file to facilitate mcp connections.
Evals
Evals are the construct used to validate agents. Each eval can contain a number of cases, grouped by a category of question asked. In the example below, the finance group (labeled below) owns the "revenue" eval dedicated to checking how data agents perform when asked questions about the company’s revenue.
Evals are defined in YML files by default in the
evals/directory. Only this path is read by default but it can be overridden witheval-pathswhich accepts a list of paths to search for eval definitions.By default, evals run against all agents defined. This can be overwritten by passing the
—-agentsflag to thedbt evalinvocation.One thing to call out - unlike data tests which test deterministic systems, agents are probabilistic. That’s why you can pass in the number of
trialsand themin_pass_countfor a given eval suite or individual case. Anthropic’s piece about evals is a great resource to understand the difference betweenpass@kvs.pass^k.Assertions
Assertion Types
data_testA query over the rows the agent's data request returned. Each row it returns is a failure.
{{ this }}is a table of the rows returned by the query the agent ran to answer the question. You can even write SQL that joins on other tables using theref()andsource()macros.classifierA classifier AI model sorts the trial into one of your classes. It passes when the probability of the
expectclasses reaches a threshold specified withsucceed_if(default 0.8).Inspo for
succeed_if: #4723llm_judgeThe LLM judge receives the following context: the question, the agent's trajectory (every tool it called, with the arguments and output), the answer, the SQL, and its rows. It then uses the
rubricto determine if the response is correct. The rubric renders with dbt's Jinja when the eval runs, soref(),source(),metric(),doc(),var(), and macros give the judge context from your project.In this example, dbt platform is used as the AI gateway by specifying the
dbt/model prefix. This runs on your dbt platform account with no key (see Use dbt as the gateway).Feedback Requested
This is a major expansion of what dbt can do, and we want your feedback! Here are a list of questions we’re interested to hear your take on, but feel free to provide general thoughts as well.
.env)eval-paths:? Or more like sources, snapshots, etc. they can be defined in the models directory?dbt_rt.eval_runs.parquet, is this sufficient?"{{ skill('my_skill') }}"min_pass_countspecifies how many trials must succeed in order for the eval to be considered a pass. This enables you to configure pass@k and pass^k, but prevents us from optimizing the run and short circuiting if pass@k were hit. Should we introduce more configs for this optimization or keep it simple?All reactions