Glossary#
The chapters are written tight on purpose. This page is where the longer explanations live, so the argument stays readable and the background is one click away.
Every term is linked the first time it appears in a chapter. You never need to read this page top to bottom.
Each entry has the same two parts: one line you can carry in your head, and a longer explanation of what it means here, in this system.
transaction#
One line: one row on a bank statement.
A date, an amount, and a description string the bank chose. The description is the hard part. There is no standard for it: each bank prints what it likes, and the same purchase at the same shop can arrive as three different strings from three different cards. Everything in this course is about turning that string into something a person can read.
raw description#
One line: the description string exactly as the bank printed it.
SQ *BLUE BOTTLE COF SAN FRANCISCO CA is a raw description. It usually contains a merchant name, often truncated; sometimes a city; sometimes a store number, a reference id, a date, or a payment processor's name stamped on the front. It is never punctuated helpfully.
merchant#
One line: the shop or company on the other side of the transaction.
In this system a merchant is a row of data: a pattern to match, a display name, a category and a subcategory. "Blue Bottle Coffee" is a merchant. A person you sent money to is deliberately not one, which is why person payments get skipped rather than guessed at.
category and subcategory#
One line: the two-level label a spending report groups by, like `Dining > Coffee`.
The set of allowed labels is called the taxonomy and it is fixed. A classifier that may invent labels produces a report nobody can total up, so "is this label in the taxonomy" is one of the checks in chapter 5.
facet, or tag#
One line: a small extra fact about a row, like `city:oakland` or `processor:square`.
Facets are the by-products of cleaning the string up. When SQ * is stripped off, the fact that Square processed the payment is kept rather than thrown away. A row can carry many facets, and they are useful even when the merchant is unknown, which is why chapter 2 says a partial answer is the normal case.
review rate#
One line: the share of rows the system flagged as "I am not sure".
This is the number the course optimises, in preference to accuracy. Accuracy counts a confidently wrong row the same as a flagged one, and those are not the same: a flagged row costs the user a moment, a wrong row costs them their trust in the report. Review rate is what a person actually feels when they open the app.
classifier#
One line: the program that turns a raw description into a labelled row.
In the miniature it is classify.mjs, 130 lines. It contains no world knowledge at all: no merchant names, no categories, no mention of coffee. All of that lives in a data file it reads.
pipeline#
One line: a fixed sequence of small steps, each handing its output to the next.
The alternative would be one big function that does everything at once. The reason to split it up is measurement: you can run one stage alone, on one example, and see exactly which step went wrong. A step you cannot run on its own is a step you cannot improve.
stage#
One line: one step of the pipeline.
The miniature has five: context, normalize, split, identify, confidence. The production system has eleven. The number does not matter; naming the output of each one does, because that is what lets you say which stage is wrong instead of just "the answer is wrong".
normalize#
One line: strip the junk the bank added, and keep it as evidence.
Removing SQ *, a store number, or a trailing city. The word "junk" is misleading: each thing removed is turned into a facet first. This is the stage where the system learns the payment was a card tap, not an online order, purely from a prefix it was about to delete.
normalizer rule#
One line: one instruction for the normalize stage, stored as data, not code.
For example: "if the text starts with PAYPAL *, remove it and record processor:paypal". Rules are rows in a file, so the improvement loop can write new ones. They are harder to get right than merchant rows because they run in sequence and can interfere with each other, which is what the last section of chapter 8 is about.
span#
One line: the piece of the description that answers one question.
The merchant span is the who; the location span is the where. Splitting a string into spans without any punctuation to guide you is chapter 1's third step, and the whole of stage 2's usefulness rests on it: clustering groups by merchant span, not by raw text.
lookup#
One line: searching the knowledge base for a merchant whose pattern appears in the span.
The rule is longest match wins. That is the sensible default and it is also the source of the shadowing bug in chapter 5: a new short pattern can silently outrank a longer one that was already handling those rows correctly.
fuzzy match#
One line: "this looks nearly like something I already know", with a score.
Compares two strings by their overlapping three-letter chunks, so WHOLE FOOD MKT scores 0.72 against Whole Foods without anyone writing a rule about it. In the loop it is used to push the model towards attaching a new spelling to an existing merchant rather than inventing a second one.
confidence#
One line: the system's own estimate of whether it got the row right.
A number, and a decision that follows from it: below the threshold, the row is flagged. The reason this is a named step rather than an afterthought is in chapter 1: a system that cannot say "I do not know" says something wrong with total conviction instead.
fallback#
One line: the label returned when nothing matched.
In the miniature it is Shopping > Online Retail, paired with low confidence and a review flag. Worth writing down and marking, because it will be the most common answer early on and it distorts every measurement: rows leaving the fallback bucket look like improvement even when nothing was learned.
pure function#
One line: a piece of code whose output depends only on its inputs.
It reads no global state, touches no network, and remembers nothing between calls. The practical payoff here is replay: you can run one stage ten thousand times on old examples in a second, and compare a change against the version before it. A stage that only works inside the whole pipeline can never be measured.
knowledge base, or KB#
One line: the file holding everything the system knows about the world.
Merchant rows, normalizer rules, the taxonomy, the city list. In the miniature it is kb.json. The single most important decision in the whole design is that this is a file rather than code, because a file can be edited safely by a program and code cannot.
procedure versus fact#
One line: the dividing line the whole architecture rests on.
"Strip a known prefix" is a procedure: write it once and it works on inputs you have never seen. "BLUE BOTTLE COF is Blue Bottle Coffee" is a fact: there is no procedure that derives it, somebody simply knows. Procedures become code. Facts become rows in a file. Chapter 1 ends by drawing this line and nothing afterwards crosses it.
pattern#
One line: the piece of text a merchant row matches on.
BLUE BOTTLE rather than the full description, so it catches every rendering the banks produce. Choosing it is the skilled part: too long and it misses variants, too short and it swallows unrelated merchants. Most of the validator in chapter 5 exists to police this one choice.
alias#
One line: a second spelling for a merchant that already exists.
There is no alias table and no alias record type: an alias is just another merchant row with the same display name. That is a deliberate design note. The most common improvement to the system should be the least structured thing you can write down.
taxonomy#
One line: the fixed list of allowed categories and subcategories.
Dining allows Coffee, Restaurant, Bakery and a few more; it does not allow Coffee Shops, however reasonable that sounds. Proposals using an invented label are rejected, because a label nobody agreed on cannot be totalled, filtered or compared across months.
fixture#
One line: one pinned example: this input, under these conditions, gives this answer.
Ordinary tests, with two differences. They live next to the knowledge rather than next to the code, because they pin a fact rather than a function. And they check only the keys they mention, so a fixture silent about tags is not claiming the tags are wrong. That silence is what lets you add a hundred narrow fixtures without them fighting each other.
context#
One line: what you knew before reading the description.
Which bank the file came from, whether the account is a credit card or a checking account, which country. Chapter 7 is entirely about this, because the same string means two different things depending on it, and a fact learned under a condition that nobody recorded gets asserted everywhere.
`when` clause#
One line: the conditions under which a piece of knowledge applies.
A merchant row can say "only on credit accounts". If the context is unknown, the row does not apply and the system says it does not know, rather than guessing the more common reading. Getting that default wrong is how a stranger's income gets labelled as a card payment.
the loop#
One line: the six-stage cycle that improves the knowledge base without anyone writing code.
Collect the rows the classifier got wrong, group them, ask a model what to write down, check every answer, apply the safe ones, then run the tests and keep or throw away the batch. Five of those six stages are ordinary programs.
agentic system#
One line: a program that decides and acts on its own, with a model as one component inside it.
The word suggests the model is in charge. In this design it is the opposite: code owns the control flow at every point, and the model produces suggestions that code then checks. Chapter 2 spells out the trade: the model cannot route around a stage doing the wrong thing, and in exchange nothing it does is unbounded.
collect, or residue#
One line: stage 1: keep the rows the classifier could not resolve.
The rows it got right need no attention. What is left over, the residue, is the raw material for everything that follows. Person payments are dropped here, before anything else sees them.
cluster#
One line: stage 2: group the leftover rows so one decision covers many of them.
Four rows that are all Blue Bottle become one question instead of four, and the answer is worth four rows instead of one. Grouping happens on the merchant span, not the raw text, so different renderings of the same name land together. Chapter 4 argues this stage decides what the model is even able to say.
proposal#
One line: one suggested change to the knowledge base, in a fixed shape.
Not free text. The model must pick one of four: add an alias, add a merchant, add a fixture, or skip. Constraining the output to a small set of shapes is what makes checking it in code possible at all.
skip#
One line: the model saying "this group needs no change", with a reason.
A first-class answer, not a failure. An agent that cannot decline will invent something for every input you show it, so refusal has to be cheap and legible.
validator#
One line: stage 4: code that checks whether a proposal is well-formed, before anything is written.
Nine checks in the miniature. It knows nothing about outcomes; it only asks whether this is a sensible thing to write down. Its rejection message matters as much as its verdict, because a specific message is something the proposer can act on and a vague one is not.
critic#
One line: the model reading its own proposal again, in a fresh context, to argue against it.
A second pass with no memory of wanting the proposal to be true. It catches the class of mistake that is internally sensible and wrong in context, which no code check can reach. The production loop has this stage; the miniature does not.
gate#
One line: stage 6: run the whole system after the change and compare, then keep or discard.
Different from the validator in a way worth being precise about. The validator inspects the proposal; the gate inspects the world after the proposal was applied. Each catches things the other cannot see, which is why chapter 5 argues you need both.
ratchet#
One line: a rule that a number may improve or stay the same, but never get worse.
The defence against slow drift: a hundred changes each costing a tenth of a point, and a year later the system is worse than when it started with no single change to blame. A ratchet makes that impossible by construction rather than by anyone remembering to check.
baseline#
One line: the stored score a new run has to match or beat.
In the miniature, baseline.json holds the review rate. It is the ratchet's memory.
eval, or evaluation harness#
One line: the program that scores the classifier over a whole corpus, stage by stage.
One overall accuracy number tells you nothing about what to fix. Chapter 9 has a real case where a single change raised category accuracy and dropped a span score at the same time, for a reason worth knowing, and the aggregate would have hidden both.
autonomy ladder, L0 / L1 / L2#
One line: sorting changes by how much damage each could do, and who signs off.
L0 is merged by the gate automatically: aliases, fixtures, noise rules. L1 waits for a person: new merchants, anything claiming a fact about the world. L2 needs a code change and a human to write it. The line is not how confident the model sounds. It is whether the gate can check the claim.
shadowing#
One line: a new short pattern silently stealing rows from a longer one that was already right.
Nothing errors. The answers just quietly change, and the new thing works perfectly while an old thing breaks in the dark. Chapter 5 shows a proposal that passes every check and is caught only by a fixture written months earlier.
shape finding#
One line: what several different merchants have in common, which is usually bank formatting.
The mirror image of clustering. Clustering asks which rows share a merchant; shapes ask which rows share everything except the merchant. That is how PAYPAL * surfaces without anyone having heard of PayPal. Two out of three shape findings in chapter 8 are wrong, which is exactly why they are findings and not changes.
operator#
One line: one of the named, pre-built things a proposal is allowed to use.
prefix, token, substring, trailer, regex, extract, when, merchant, fixture. Nine of them. The model never writes code; it writes parameters to these. Adding a new operator is a code change with tests and human review. Using one is a text edit a gate can approve at three in the morning.
JSON#
One line: a plain-text format for structured data that both people and programs read.
{ "p": "BLUE BOTTLE", "name": "Blue Bottle Coffee" } is JSON. The knowledge base is a JSON file, which is the whole reason a program can edit it and a person can review the edit in a normal diff.
YAML#
One line: the same idea as JSON, with less punctuation and room for comments.
The production knowledge base uses YAML because humans edit it by hand and comments matter. It is compiled to code at build time so the classifier itself carries no parser and can run in a browser or on a phone.
regex, or regular expression#
One line: a compact pattern language for matching text.
^CHECKCARD \d{4}\s+ matches the literal word CHECKCARD, four digits and some spaces, at the start of a string. Powerful and dangerous: a badly written one can take exponential time on a hostile input, which is why a model-authored regex is linted before it is allowed anywhere near the import path.
token#
One line: one word of a description, after splitting on spaces.
BLUE BOTTLE COF has three tokens. Several checks in the course count tokens rather than characters, because "shares all its meaningful words with an existing merchant" is a better duplicate test than comparing whole strings.
trigram similarity#
One line: how alike two strings are, measured by their overlapping three-letter chunks.
WHOLE FOOD and WHOLE FOODS share almost all of their three-letter runs, so they score high. It needs no dictionary and no model, which is why the same twenty lines handle bank truncations nobody anticipated.
prompt#
One line: the instructions given to a model before it answers.
Twelve lines in this course, and mostly not about the task: what to prefer, what counts as a valid pattern, when to refuse. Every instruction in it is also enforced in code, because saying it makes compliance likely and checking it makes violation harmless.
dry run#
One line: do all the work and report it, but write nothing.
--dry-run in every command in this course. The habit worth taking away is that a system which changes files on its own should always be able to show you what it would do first.
snapshot#
One line: a copy of the state taken just before a risky change, to restore from.
Chapter 5 makes a specific point about this: restore from a snapshot taken just before applying, not from the last commit, or you will also throw away whatever a person had in progress.
corpus#
One line: the whole labelled body of transactions the system is scored against.
25,660 rows in the production numbers in chapter 9. A corpus is what makes a percentage mean anything; a change that helps on ten rows you happened to look at may well hurt on the other twenty-five thousand.
slice#
One line: one subset of the corpus, scored on its own.
Per bank, per account type, per category. The ratchet holds each slice separately, because a large improvement in one area can otherwise hide a collapse in another and the total will look fine.