Evaluate

Evals and golden sets

This page covers the golden set format, how answers are scored against it, the eval runner and its output files, and the sweeps that are planned on top.

Golden sets

A golden set is a JSON file of questions, each with the evidence a good answer needs and the facts it should state. The San Francisco set is evals/sf/golden.json, with 22 rows. A second set for video and PDF sources is evals/sf/golden-media.json.

json
{
  "name": "San Francisco mixed sources",
  "version": "2026-11-06",
  "asOf": "DataSF and Internet Archive pulls of 2026-11-06",
  "rows": [
    {
      "id": "150-hayes-plan",
      "question": "What is planned at 150 Hayes Street, and did it come up at the Board of Supervisors?",
      "sources": ["meetings", "permits"],
      "gold": [
        { "label": "permits", "table": "permits", "match": "all",
          "sql": "SELECT record_id AS id FROM t_permits WHERE permit_number = '202610149441'" },
        { "label": "meeting", "meeting": "SFGTV_20261020_210000_Full_Board_of_Supervisors", "at": [5760], "match": "any" }
      ],
      "facts": [
        { "claim": "Converts the office building to 106 homes", "terms": ["106"] },
        { "claim": "Uses the adaptive reuse program", "terms": ["adaptive reuse"] },
        { "claim": "Permit is filed, not issued", "terms": ["filed"] }
      ]
    }
  ]
}

Row shape

Field Meaning
id Stable row id
question The question as a person would ask it
sources The sources a full answer draws on
gold One group per source the question needs
facts Claims a good answer states, each with terms that show it is present

A gold group takes one of four forms:

  • Table rows: table and sql. The SQL runs against the index before the eval, so the reference records always match the data the run sees. A query that returns nothing fails the run.
  • Meeting moments: meeting and at, in seconds from the start.
  • Document moments or pages: doc (such as pdfs/bag041426_agenda) with at or pages.
  • A query over a table: query, naming the table, such as permits. It is met by any query the answer runs over that table, for questions about a count, a total or a ranking that no single record holds.

match is all when every item in the group should be retrieved, or any when one is enough. An any group can list alternatives in or, such as the same discussion as captions or as a page of the minutes.

Scoring

Scoring in src/eval/score.ts is mechanical, with no judge model. Each row gets:

Score How it is computed
recall For each gold group, the share of its items found in the evidence (or 1 or 0 for any), then the mean over groups. Each source counts equally
allSources True when every group has at least one item found
evidenceFacts The share of facts with any of their terms in the retrieved evidence and entity fields
answerFacts The share of facts with any of their terms in the written answer, when there is one

A transcript chunk covers a gold moment when it overlaps the minute starting at that moment. Terms are compared after case and accent folding. Each row also lists the facts it missed and the hits per group.

Running an eval

sh
deno task sf eval
deno task sf eval --path auto --answer
deno task sf eval --keyword-only
Option Effect
--path <path> Score one path. Default is search, agent and entities in turn
--answer, --model <id> Also write answers and score answerFacts
--golden <file> Another golden set, such as evals/sf/golden-media.json. Default evals/sf/golden.json
--about "<text>" What the data is, given to the answer model in place of the San Francisco description
--keyword-only, --embed, --store, --router, --rerank, --prefetch, --k The same settings as ask

The runner (src/eval/run.ts) prints a line per row and path, then a summary table:

Path Recall All sources found Facts in evidence Facts in answer Model calls Mean time
agent 83% 73% 83% 91% 72 10279 ms

Run files

Each run is saved to tmp/sf/evals/<time>-<settings>.json. The name records the main settings, such as 2026-11-07T0330-hybrid-builtin-answers-prefetch-none.json. A golden set other than the default adds its name after the time, so runs on different sets never mix. The file has three parts:

ts
type EvalRun = {
  config: ConfigData;   // every setting the run used
  rows: { id: string; path: string; score: RowScore; answer: AnswerData }[];
  summary: {
    path: string;
    recall: number;
    allSources: number;
    evidenceFacts: number;
    answerFacts?: number;
    modelCalls: number;
    ms: number;
  }[];
};

Each row keeps the full answer, including evidence and trace, so a low score can be traced back to what was retrieved. The Scorecard reads the summaries of the newest runs.

Planned: criteria, judges and sweeps

The spec goes further than the prototype. These are planned:

  • Splits. Rows in dev, test, holdout and canary splits. Tuning never sees the test split.
  • Criteria with a scope. Row criteria judge one answer (faithful, correct, cites its source, refuses when it should, or the customer's own rubric). Project criteria aggregate over a run (coverage, accuracy by slice, cost, latency) and can gate a release.
  • Calibrated judges. Each model judge reports its agreement with a small human-labelled set before its scores count.
  • Sweeps. A grid over a few expensive index settings and many cheap query settings, on a corpus sample, retrieval-only first, with a dollar cap. The stage cache makes this cheap: changing query.topK reuses every index-time stage.
  • Labels as rows. Accepted labels from the review queue become golden rows. See Labeling.

The planned SDK call:

ts
const sweep = await gw.sweep({
  axes: { "index.chunkSize": [256, 512, 1024], "query.topK": [5, 10, 20] },
  budget: { usd: 50 },
});

See Evals in the API reference. The hosted API is in design.