Joel Stevick

Introduction · section 1 of 8

Introduction

A question comes in at the left. A model restates it in the law’s own vocabulary. Your code then ranks the laws by the words they share with the question and those restatements, and separately by their meaning, fuses the two rankings into one list, has a model choose the few worth reading, and adds what lookups find once the right part of the code is known. A model writes two sentences from those laws and names the ones it used. Your code checks the sentences against the laws it was given before anyone sees them, and either the answer goes to the screen under the law it rests on, or the pipeline’s own line goes instead. The model’s jobs are purple; everything else is yours.

A workflow is a fixed sequence of jobs that a piece of work passes through, where each job has one responsibility and a defined output.

An agentic workflow is one in which some of those jobs are carried out by a language model rather than by a person or by code you wrote in advance.

The picture above is one. A question goes in at the left and an answer comes out at the right, and of the eight jobs between them, three are done by a model: one restates the question in the words the law uses, one picks the few laws worth reading from a longer list, and one writes the answer. The other five are ordinary code you will type, and the one at the end is the reason the whole thing can be trusted: it decides, without asking any model, whether the answer may be shown.

What it is not

An agent is a program that calls a model in a loop, runs whatever tool the model asks for, and stops when the model stops asking. The model picks the next step. This book does not build one, and the pipeline it builds has no loop of that kind anywhere in it.

That is a design choice, and it is worth stating at the start because the word agentic on the cover will make some readers expect the other thing. In this pipeline your code picks every next step, and each model call is one request and one reply. The model never decides whether to search again, never decides which law to look up, and never decides whether its own answer is good enough. Where a job needs judgement about language, a model does it; where a job needs to be the same every time, code does it; and the job of deciding what reaches the screen is always the second kind.