Legal retrieval benchmark

Diurna publishes a fixed set of legal questions, the official-source records that answer them, and the scores from one recorded search run. Figures on this page come from that file. They are not estimates.

No production-index run is published yet. The only recorded numbers below were measured on the bundled demo catalog with bundledSearch, not against the full production search index. Run date: .

Recorded bundled catalog run

Measured . Retriever bundledSearch. Corpus: bundled catalog. 15 questions. Search depth 10. Citation accuracy at 1 is 93.3%. Citation accuracy at 5 is 93.3%. Official-source rate is 100.0% (15 of 15 hits).

  • 90.0%Recall at 1
  • 93.3%Recall at 5
  • 93.3%Recall at 10
  • 93.3%Citation accuracy at 10

Dataset SHA-256 8588ba0963d682ee81e0a70cfbf28141ba7697e58cda1e6f6f482ae2b2a6c075.

Per-question scores from the recorded bundled catalog run.
QuestionGold citationRecall at 1Recall at 10Citation accuracy at 10Top hit
What does RCW 9A.36.011 provide?Search query: RCW 9A.36.0111/11/11/1RCW 9A.36.011
Which Washington statute covers assault with a firearm or deadly weapon that causes great bodily harm?Search query: assault firearm deadly weapon great bodily harm1/11/11/1RCW 9A.36.011
Which Washington statute treats strangulation or suffocation as assault in the second degree?Search query: assault strangulation suffocation1/11/11/1RCW 9A.36.021
Which Washington assault statutes address bodily harm?Search query: assault bodily harm1/22/22/2RCW 9A.36.011
Which King County ordinance adopts the 2025 annual budget?Search query: 2025 annual budget1/11/11/1Ordinance 19861
Which King County ordinance makes a supplemental appropriation to the biennial budget?Search query: supplemental appropriation biennial1/11/11/1Ordinance 19879
Which Washington bill addresses service of notice by mail in an unlawful detainer case?Search query: service of notice by mail unlawful detainer1/11/11/1HB 1003
Which Washington bill expands access to dual credit programs?Search query: dual credit programs1/11/11/1HB 1003
Which Washington bill defines a geofence around consumer health data?Search query: consumer health data geofence1/11/11/1HB 1155
Which Nevada bill defines selling consumer health data as an exchange for money?Search query: exchange consumer health data for money1/11/11/1SB 370
Where does the Code of Federal Regulations define the Administrative Committee of the Federal Register?Search query: Administrative Committee of the Federal Register1/11/11/11 CFR 1.1
Which federal order defers diesel fuel tax penalties for highway use of dyed diesel?Search query: dyed diesel fuel highway penalty1/11/11/191 FR 64747
Which federal proclamation sets Columbus Day for 2026?Search query: Columbus Day proclamation1/11/11/191 FR 65075
Which Hawaii order addresses renewable energy technology system credits?Search query: renewable energy technology system credits1/11/11/1Executive Order 26-02
Which statute makes strangling a person second degree assault?0/10/10/0No hit

Methodology

The recorded run calls bundledSearch, the search used when no database is configured. The corpus is the bundled catalog shipped with the application: official-source statutes, bills, ordinances, regulations, and executive orders. This is not a score for a private production database.

Gold rows are copied from that catalog. Each one names a document id, a citation, and the publisher URL stored on the record. A gold URL that is not on the Diurna official-source list is rejected before a run is recorded.

Recall at k is the share of gold records that appear in the first k hits, averaged across questions. A hit counts for recall when the document type and document id match a gold record.

Citation accuracy at k is the share of those hits that cite a gold record, averaged across questions. A hit is accurate only when the document identity matches, the citation text matches after the same normalization used for stored citations, and the source URL is exactly the gold publisher URL. That URL must also be on the official-source list. A question with no hits scores 0. Returning nothing is not treated as accurate.

Queries are sent unchanged. A question whose words are missing from the official text can score 0 on this lexical search. That score stays in the average.

Official-source rate is the share of returned hits whose URL is on the official-source list. It is counted across hits, not averaged by question.

Diurna is not legal advice. Verify a citation against its official source.

Reproduce

Download the eval set and the recorded results. From the web directory:

npm run benchmark:legal-retrieval -- --check

The check reruns bundledSearch and stops if the recorded file differs.

To record a new bundled run after the eval set or search code changes:

npm run benchmark:legal-retrieval -- --write

To measure a database catalog without replacing the published file, set DATABASE_URL and run:

npm run benchmark:legal-retrieval -- --backend=search --out /tmp/legal-retrieval-search.json

That output stays off this page. Only a recorded bundled catalog run is shown.