Feature Requests

Kai Evals

M
Marcos AlcozerinFeature Requests
5 months ago

Problem

Today the only way to tell Kai it got something wrong is to catch it in the act. When new data lands in the semantic layer or the agent's context changes, the Kai dev team and the district data team have to go use Kai, notice a bad response, and press thumbs down. That opens a GitHub ticket, someone evaluates the behavior, and the fix gets made.

That loop is reactive. By the time a thumbs down happens, a wrong answer has already shown up in front of someone, possibly a real user. It's also a strange first impression: a district's introduction to Kai is basically an encouragement to go hunting for failures and flag them. There's no way to write down "here's what a good answer looks like" once and re-check it, so nothing protects against a change quietly breaking something that used to work.

The failures the data team cares about come in two kinds. Sometimes the number is wrong. Just as often the number is right but it's communicated badly: it misses a caveat, frames a metric against the wrong goal, hands out advice it shouldn't, or uses terminology the district doesn't use. Both erode trust, and the people who can judge either one are the district's data team. They don't have an objective, repeatable way to do it. Spot-checking by hand doesn't scale, isn't reproducible, and tells you nothing about the questions you didn't check.

Proposed Solution

Give the data team a place to write, store, and run accuracy checks ("evals") against their org's Kai agent, so verifying both the number and how it's communicated is a deliberate action instead of a reaction to a bad answer.

An eval is a natural-language question with up to two checks attached.

The data check confirms the number is right. The data team pairs the question with a SQL query they write against the tables they already report on (their wide_* marts, like wide_student_school_attendance), not against Kai's semantic layer. That query runs straight against the warehouse and is independent of how the agent gets to its answer. The two don't need to touch the same tables. The check just asks: however Kai gets there, does it land on the same number my trusted query produces? Because it's a live query and not a frozen number, it stays valid as the data changes.

The communication check confirms the answer is interpreted properly. The data team writes a short list of plain-language expectations for how the answer should read. For example: "must note the rate is below our 90% goal," "must not recommend interventions," "must flag when is_chronically_absent is based on fewer than 10 students," or "must say 'chronic absenteeism,' not 'truancy.'" Those encode the district's own communication norms and domain context. An automated reviewer reads the agent's answer, decides whether each expectation was met, and shows its reasoning.

Both checks are optional, so an eval can verify the number, the wording, or both. The two work differently. The data check is a straight comparison: the agent's number either matches the trusted query or it doesn't, and you get the same result every time you run it. An automated reviewer reads the agent's answer, decides whether each expectation the data team wrote was met, and explains its call. That's consistent but not guaranteed identical the way a number match is, so it always comes with the reviewer's written explanation instead of just a bare pass.

What you see when you run the suite is a list of your evals, each with a status at a glance: a green check when everything passed, a red X when something failed. Open one and you get the detail. For the data check, the agent's number sits next to your query's result, so the match or the gap is obvious. For the communication check, you see each expectation you wrote with its own check or X, plus a sentence or two from the reviewer on why it ruled that way. So it's green checks and red Xs up front, with the actual numbers and the reviewer's reasoning one click down.


The rest of it:

  • Evals are stored per org and managed from an admin area, building into a suite over time.

  • On demand, the data team runs the suite. Kai asks each question exactly as a user would, runs the data check's query, and checks the answer against the expectations the data team wrote.

User Stories

  • As a member of the district data team, I want to check the number with a SQL query against the wide_* tables I already know, so I can verify Kai's data without learning the semantic layer.

  • As a member of the district data team, I want to write expectations for how an answer should read, so I can catch when Kai frames a correct number badly or hands out advice it shouldn't.

  • As a member of the district data team, I want to run all my checks on demand after we change the semantic layer or the agent's context, so I catch a regression before a user does instead of waiting for a thumbs down.

  • As a member of the district data team, I want a failure to show both the number mismatch and the missed expectations, so I can diagnose it fast.

  • As a district leader, I want evidence the agent is both accurate and responsible in how it talks, so I can stand behind what Kai puts in front of my staff.

Success Criteria

  • A data team member can create an eval with a data check, a communication check, or both, stored per org.

  • The data check's query can target the district's own reporting tables and doesn't need to match the tables or semantic layer the agent uses.

  • The data check returns the same pass/fail verdict on repeated runs against unchanged data.

  • The communication check scores the agent's answer against the data team's written expectations and shows the reviewer's reasoning.

  • A data team member can run the full suite on demand and see, per eval, a pass/fail status up front and, on open, the number comparison and each expectation's result.

  • A failing eval shows the expected result next to the agent's result, and which expectations were missed with the reviewer's explanation.

  • Communication results are visibly marked as judgments, not the deterministic verdict of the data check.

Priority Context

Accuracy and responsible communication are the whole value of Kai. A conversational analytics agent that confidently shows the wrong number, or frames the right number badly, is worse than no agent at all. Right now the only safeguard is people noticing failures in production and filing tickets, which means regressions get caught late, by users, and the data team's first experience of Kai is being asked to hunt for mistakes. As districts put Kai in front of more staff, the cost of a silent regression goes up and that reactive loop scales badly.

Open Questions

  • Scoping and row-level security: the agent likely answers within a user's permitted scope, while a raw query against the reporting tables can see every row. The data check and the agent have to be compared at the same scope, or passing evals fail for the wrong reason. How do we line them up?

  • How should "right data" actually be compared? Exact match, row and column match, or numeric tolerance for rounding?

  • Should a data check assert on a single value or a fuller result table? Does the agent's answer reliably reduce to something comparable to a query result?

Out of Scope

  • Scheduled or automatic eval runs and regression alerting. Good follow-up, but v1 is on-demand only.

  • Auto-running evals when the semantic layer or the agent's context changes.

  • Grading presentation choices like chart type, table layout, or formatting. The communication check covers what the answer says, not how it's rendered.

  • Auto-suggesting or generating evals or expectations for the data team.


  1. In Review
  2. Planned
  3. In Progress
  4. Completed
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...