For the complete documentation index, see llms.txt. This page is also available as Markdown.

Evaluations YAML

evaluations.yml contains test cases for regression testing. Each case pairs a natural language question with the expected Lynk SQL output. Run evaluations before pushing context changes to production to catch breaks before they affect users.


Structure

test_cases:
  - type: SQL
    name: active_customers_by_country
    description: |-
      Count active customers grouped by country.
      Evaluation:
      - entity knowledge to correctly filter by status = 'active'
    input: How many active customers do we have per country?
    expected_output: |-
      SELECT
        country,
        METRIC('count_customers') AS customer_count
      FROM customer
      WHERE status = 'active'
      GROUP BY 1
      ORDER BY 2 DESC
    tags:
      difficulty: EASY
      domain: default
      eval: entity_knowledge

Fields

Field
Description

type

SQL — the only supported type

name

Unique identifier for this test case

description

What this test verifies — written for a human reviewer

input

The natural language question as a user would ask it

expected_output

The Lynk SQL that correctly answers the question

tags.difficulty

EASY, MEDIUM, or HARD

tags.domain

Which domain this test case runs in

tags.eval

What is being tested — see eval tags below


Eval Tags

Tag
Tests

entity_knowledge

Agent correctly uses entity-specific knowledge (field selection, naming)

domain_knowledge

Agent applies domain-wide rules (filters, conventions)

task_instructions

Agent follows SQL-specific guidance

behavior

Agent follows communication style rules

feature_chaining

Metric features and cross-entity aggregation work correctly


When to Use This File

Add or update evaluations when a situation meets one of these conditions:

  1. You're about to push a context change and need to verify it doesn't break existing behavior

  2. You've modeled a new entity and need regression coverage for its key question patterns

  3. There's a known failure area you want to lock in correct behavior for

Examples:

  • "I just updated the task instructions on the customer entity — run evaluations to make sure nothing broke before deploying" → run existing evaluations before pushing

  • "We added a new entity for session — write evaluations to verify the agent can answer basic engagement questions" → add new test cases for the entity

  • "The agent keeps getting churn queries wrong — write a set of test cases that cover the different churn scenarios" → add targeted test cases for a known failure area

  • "I want confidence that the is_test_account = false filter is always applied correctly" → add a test case that verifies the filter appears in expected output

  • "We're onboarding a new customer — create a set of evaluations from their 20 sample questions before the first demo" → add domain-scoped test cases from real user questions


Best Practices

Write input as a real user would ask it — business language, not field names.

Write expected_output in valid Lynk SQL. See Lynk SQL for the full syntax reference.

Apply the domain's default filters in the expected output — season type exclusions, soft-delete filters, etc. The evaluation tests whether the agent applies them correctly.

Use verified feature names from the entity YAML. Do not guess.


Common Pitfalls

Writing input as a technical query. The input should sound like a business user asking a question, not an engineer writing a spec. "Query customer entity grouped by country where status = active" is not how users ask questions.

Not applying domain default filters. If your task instructions say "always exclude test accounts", the expected_output must include that filter. Evaluations test whether the agent follows the rules — if the expected output doesn't reflect the rules, the evaluation is testing the wrong thing.

Too few test cases for important entities. Aim to cover the common question patterns for each entity — simple counts, time-filtered queries, groupings, and any known edge cases. A single test case per entity is not enough to catch regressions.

Letting test cases go stale. When you rename a feature, update a metric, or change a default filter, update the evaluations. Stale expected output causes false failures that erode confidence in the evaluation suite.


Difficulty Guidelines

Level
Characteristics

EASY

Single entity, few features, no joins, straightforward question

MEDIUM

Multiple features, time filtering, or implicit business logic required

HARD

Feature chaining, multi-entity reasoning, complex filters, or ambiguous input


Full Examples

Example 1 — Grove (B2B SaaS)

Three test cases for the Grove customer entity: simple active customer count, ARR broken down by customer tier, and enterprise customers at risk of churning. Progresses from EASY to MEDIUM — the at-risk query requires combining NPS, plan type, and the arr feature with correct default filters.


Example 2 — Bly (E-commerce)

Three test cases for the Bly order entity: net revenue this month, top channels by order volume, and refund rate by product category. Progresses from EASY to MEDIUM — the refund rate test requires joining through order_item to reach product category, which is feature chaining.


Example 3 — Arcadia (Mobile gaming)

Three test cases for the Arcadia player entity: DAU count for today, ARPDAU for the last 7 days, and whale players with no recent session. The ARPDAU test is MEDIUM (requires combining sum_net_revenue_usd from purchase with a DAU count and filtering to USD); the whale lapse test is HARD (feature chaining on player_segment, filtering on last_session_at, plus domain knowledge that player_segment must not be recalculated manually).

Last updated