Wiki · concept

Structure in structure out for LLM calls

LLMs behave better (see: workflows encode domain knowledge better than agents) with structured input and produce more reliable output when asked to fill a schema. Parse free-text artifacts into clean JSON before reasoning. Require structured output so results plug into a larger workflow. Ask the model to cite specific evidence IDs so outputs are verifiable.

The principle applies at every layer of the stack. At the input layer, parse free-text artifacts into clean JSON before reasoning. At the output layer, require the model to fill a typed schema so the result plugs into the next step. At the evidence layer, ask the model to cite specific IDs so outputs are verifiable. Each structuring step costs a little setup time but prevents the cascading ambiguity that makes agent (see: evals define what success means for an agent) systems hard to debug and impossible to trust.