Skip to content
echogeco
Prompt and context engineering on real data · Context assembly

Structured output for the claims form

Design the record that pre-fills the claims platform's triage form: the fields the model writes, the ones it never writes, the checks, and the decline path.

designmediumExercise · 4 min · 37 of 64
On this page

The claims platform pre-fills its triage form from whatever the model returns, and its parser refuses anything it does not expect. The design is the record: what the model writes, what it never writes, and what the handler sees when it cannot decide.

The situation

The claims platform's triage form has four fields the handler confirms: a route code (FT, ADJ or FRD), up to three governing clause references, an exclusion tick-box, and a note of at most 250 characters. The pilot writes one row per claim to pilot.triage_output, and the platform pre-fills the form from it. Its parser rejects a row with an unknown code or an over-long note, showing the handler a blank form; a row with the route left empty is accepted and shows the note. In the prototype the model returned JSON with nothing enforcing it: the route as free text ("fast track", "Fast-track (4.2)") and the clauses as one string read by a regex. Replayed through the platform's parser, 3 of its 50 replies failed, 6%, or 72 blank forms a day at 1,200 claims, and on 1 the regex took a clause number from the reasoning. Each call retrieves three clauses with ids such as 4.2. The output budget is 160 tokens, about 120 words at 0.75 words per token. The definition of done allows 10% of claims, 120 a day, to go undrafted.

The question

Design the record the model returns, field by field, saying what the schema enforces and what code checks, and decide what the handler sees when the model declines or the record fails.

A strong answer · Rubric · Where answers go wrong

Write your answer first, then open