cCarebun Reading‹ All reading
Carebun Interactive/Agents whiteboardpattern catalogueglossary Study view

Appendix

Chapter 19

The words, by analogy

Every technical term in the book, each with a plain meaning and a picture from everyday life or the newsroom, grouped the way the book is: models, the loop, tools, evaluators, graphs, plugins and memory, measuring, shipping.

12 min read

On this page
  1. Models and tokens
  2. The loop
  3. Tools
  4. Evaluators
  5. Graphs
  6. Plugins and memory
  7. Measuring
  8. Shipping
  9. Try it yourself
  10. Common questions
  11. Carry this
  12. Check yourself

In this appendix, we will learn nothing new and understand everything better. Every term the book uses is here, with a one-line meaning and a picture to hang it on. Read it once straight through before Part II if the vocabulary is new to you, and come back to it whenever a word stops you. The pictures are the newsroom's where the newsroom has one, and everyday ones where it does not.

Models and tokens

TermMeaningPicture
modelthe program that reads a prompt and writes a reply, one token at a timethe reporter's brain: the same brain whether it is on the phone or in the building
tokenthe unit a model reads and writes in; a piece of a word, about four characterscolumn inches: the paper pays for every one, news or filler
prompt tokens, completion tokenswhat goes in and what comes out of one call, counted in tokensthe brief you hand over, and the copy that comes back; you pay for both, and the brief gets longer every round
reasoning tokenscompletion tokens the model spent thinking before answeringthe scribbled notes before the clean copy; billed like copy
prompteverything the model is shown before it answersthe whole desk the reporter looks at: the job description, the notes, the assignment
system promptthe standing part of the prompt: who the agent is, how to behavethe job description pinned above the desk
contextthe material for this one job: documents, files, remembered factsthe folder of clippings handed over with the assignment
context windowthe most tokens one call can carrythe size of the desk; past it, things fall off
temperaturethe randomness dial; 0 picks the most likely word every timea careful clerk at 0, a brainstormer at 1
reasoning efforthow long the model thinks before answeringa quick note versus a considered memo; the memo costs more
model API, endpointthe service over the network that runs the model; the address it listens atthe phone network and the number you dial
SDKthe official library for talking to the model API from codethe phone app that knows how to dial
API keythe secret that proves to the API who is calling and who to billthe account number on the phone contract; never printed in the paper
environment variablea setting kept outside the code, read when the program startsa label on the switchboard saying which number to dial
worker, judge, specialistthe three model roles: does the work, grades it, handles one hard stepreporter, editor, the expert called in for one story
structured outputasking the model for an object matching a schema instead of prosea form with boxes instead of a letter
streamingreceiving the answer word by word as it is producedwatching the wire service tick in versus reading the finished page

The loop

TermMeaningPicture
agenta model plus tools, a loop, an evaluator and a place to worka reporter with a badge, a desk and an editor, not a voice on the phone
loopprompt, model, action, result, again, until an evaluator says passa reporter chasing a story until the desk accepts it
stepone model call inside a loopone round of thinking at the desk
history, messagesthe list of everything said so far, sent in full on every callthe growing folder the reporter carries to every meeting
action, resulta tool call the model asks for, and what the tool returnedmaking a phone call, and the note of what was said
evaluatesomething other than the model deciding whether the answer is finalthe editor's desk
pass, fail, feedbackthe evaluator's verdict and, on a fail, the note that goes back to the model"run it", or "back to you, and here is why"
statushow a run ended: pass, fail, max_steps, budget, errorthe stamp on the folder when it leaves the desk
max_steps, max_failsceilings on tool rounds and on rejected answers"three hours and two rewrites, then we run what we have or spike it"
tracethe file where every event of a run is written, one JSON line eachthe archivist's log of every call made and every note filed
runaway, flailinga loop that calls tools without end; a loop that tries many things and gets nowherea reporter who keeps phoning the same number; one who phones everyone and files nothing
context bloat, context rota history that grows until every call is expensive; a model that attends less to the middle of a long historya folder so thick the reporter cannot find the brief; and skims the middle
compactionshortening old tool results in the history while keeping the gistthe sub-editor trimming old notes to a line each
prompt injectioninstructions hidden in text the model reads, which it may followa forged note slipped into the clippings folder

Tools

TermMeaningPicture
toola function the model may ask to run, described by a name, a description and a schemaa door the badge opens
signaturea function's name and its typed argumentsthe label on the door and the shape of its key
docstringthe explanatory text under a function's first linethe sign on the door saying what is behind it
schema, JSON schemathe shape of a piece of data: fields, types, which are requireda form with labelled boxes
JSONthe bracketed text format programs use to exchange datathe standard form every desk can read
JSONLa file with one JSON object per linea ledger: one entry per line, searchable
regexa pattern that matches texta search with wildcards: "only digits", "ends in .json"
parser, parsecode that reads a format and complains if it is malformedthe clerk who rejects a form with the boxes filled in wrong
confinement, work directorytools may only touch files under one folderthe badge opens doors on one floor
shell, subprocessrunning another program and reading what it printssending a runner to another department and reading the note they bring back
exit codethe number a program leaves behind; zero means successthe runner's thumbs up or down
timeoutthe longest a tool may run before it is stopped"if you are not back in an hour, we go without you"
globa filename pattern with wildcards"every folder marked 2026"
grepsearch files for lines matching a patternflipping the archive for every page that mentions a name
container, sandboxa sealed environment a program cannot see out ofa locked room: break what you like, it stays in the room
allow-listthe set of things permitted; everything else is refusedthe guest list at the door
human in the loop, approvala person must say yes before a tool that acts can runlegal signs off before anything risky goes out

Evaluators

TermMeaningPicture
deterministic checka test a program runs with the same answer every time, freethe byline-and-word-count checklist a junior runs in a minute
judgea second model reading the answer against a rubric and scoring itthe senior reader
rubrica written marking scheme the judge appliesthe teacher's grading sheet; a literal reader applies it word for word
thresholdthe judge score at or above which an answer passesthe pass mark
all_ofrun evaluators in order; stop at the first failchecklist first, senior reader only for copy that passed it
verdictpassed or not, feedback, scorethe editor's note on the top of the copy
validator, contracta deterministic check with many rules; the rules the output must meet to be acceptedthe printer's proof: either it prints or a page goes back
groundingputting the source material in the prompt and requiring facts to come from it"quote the document in front of you, not what you remember"

Graphs

TermMeaningPicture
graphnodes and edges: steps, and which may follow which, fixed in advancethe desk's plan for the day, written down
nodeone step: a function of the state that returns new keysone person's job on the plan
edge"when this finishes, that may start"an arrow on the assignment board
statethe shared dictionary of everything the graph knows so farthe whiteboard everyone writes their results on
keyone named value in the stateone labelled box on the whiteboard
waveall the nodes whose inputs are ready, run at the same timethe morning meeting sending several reporters out together
snapshota copy of the state taken before a wave startsa photograph of the whiteboard before the meeting
threadhow a program does several things at onceseveral reporters out at the same time
fan-out, fan-inone node feeding several; several feeding one that waits for allassigning three angles; the rewrite editor waiting for all three
map, fanout nodethe same work for every item in a list, in parallelone reporter per town for the election results
routera function of the state that returns a label; the label picks the next nodethe news editor reading the wire and deciding which desk gets it
back edgean edge that closes a cycle; it re-triggers its target but is not waited forthe return path when legal bounces a piece
dependencyan input a node waits for"rewrite cannot start until all three have filed"
depth-first searchfollow each arrow as far as it goes before trying the nextwalk one corridor to its end before opening the next door
cycle, max_visitsa path that returns to a node; the ceiling on how often a node may runthe rewrite loop, and "three rewrites, then we decide"
state collisiontwo nodes in one wave writing the same keytwo reporters filing into the same slot
stalla graph that stops early with no error because a node waits for an input that cannot comea page that never prints because it waits for a sign-off that waits for the page
sub-grapha whole graph used as one node of anothera desk inside a desk
stub nodea placeholder function that returns its own name, for testing the shapea rehearsal with the actors reading their names
checkpoint, resumethe state saved after every wave; a rerun that skips finished nodesthe proof sheet saved after each page, so a crashed press restarts at the right page
retries, on_errorre-running a node that failed; jumping to a fallback node when it raisesredialling, and the backup reporter
text formthe six-line notation (a -> b, c, a ?label-> b) that builds a graphthe assignment board itself as the plan
Mermaid, excalidrawtwo drawing formats the graph exports tothe clean org chart and the hand-drawn whiteboard

Plugins and memory

TermMeaningPicture
plugin, hookan object with named methods the loop and graph call at known momentsthe people around the reporter who see everything and write nothing
Trace, Consolewrite every event to a file; print one line per stepthe archivist; the editor shouting progress across the room
Budgetstop a run that spends or steps too muchthe managing editor pulling the plug
Compactshorten old tool results in the historythe sub-editor trimming old notes
Approvalguarded tools run only if a policy or a person says yeslegal's sign-off
skilla markdown page of standing instructions appended to the system promptthe style guide on every desk
memory framework, backendsoftware that stores facts from conversations and finds them later; the six-method interface agl talks to it throughthe archive, and the archivist's counter
mem libthe small memory backend agl shipsa one-room archive with a good index
recall, rememberfetch relevant facts before a run; extract and store facts after onepulling the clippings before; filing the story after
extractiona model call that turns a conversation into short dated factsthe archivist deciding what is worth clipping
keyword search, full-text indexfinding facts by the words they containthe index at the back of a book
embeddingnumbers that place similar meanings near each othera librarian who understands what you meant
user id, scopingevery fact stored under one person or project, every search limited to itone archive drawer per client, locked
semantic, episodic, proceduralfacts about the world; what happened when; how to do thingsthe clippings, the diary, the style guide
token budgetthe most tokens of recalled facts allowed into the prompt"one page of clippings, no more"

Measuring

TermMeaningPicture
measurablea program can print one number after every attempt, and better moves it the right waythe sports desk: there is a score
open-ended, closedthe model picks what to try; we pick"find me a story" versus "cover these three events"
exam, evala file of tasks with expected answers, graded the same way every timethe daily edition, checked
task, expectone exam row: the text, the allowed tools, the checksone assignment and its acceptance criteria
score, pass ratemean task score; share of tasks that passedthe grade, and how many pages printed clean
latency, p50, p95the wait for an answer; the typical wait; the wait the unlucky one in twenty seeshow long the reader waits for the paper, on a normal day and on a bad one
wall clockreal elapsed time, as a clock on the wall would showthe deadline clock, not the hours worked
noise, marginrun-to-run variation; the change required before a difference countsthe same edition is never quite identical twice; a real improvement shows past that
cache (for measuring)exact replay of an identical run, for freere-reading yesterday's edition instead of reprinting it
fixturea frozen file the exam's expectations are pinned tothe reference copy in the vault
results logone row per run: commit, score, cost, verdict, descriptionthe lab notebook
commit, version controla saved, named snapshot of the code; the system that keeps them allthe bound archive of every edition as printed
lint, testsa program that checks code style; programs that check code behaviourspelling check and fact check for code
improvement loop, briefan agent that changes one thing, runs the exam, keeps or discards, logs, repeats; the file that tells it howthe night desk and its standing orders
scope, gate, logwhat the loop may edit; what must pass before a run counts; one row per runthe night desk may touch tomorrow's pages but not the stylebook; nothing prints unchecked; every change in the log
simplicity criterionequal results with less code winsa shorter story that says the same is the better story

Shipping

TermMeaningPicture
HTTP, POST, GETthe web's request language; sending a document; asking for onethe mail room: a parcel out, a request for one back
serve, servicea program that waits for requests and answers themthe counter that never closes
localhostthis machine only; nothing from outside can reach itan internal extension, not a public number
authentication, rate limitproving who is calling; capping how often they maythe badge at the door; the queue
stagingwhere generated work waits before it is publishedthe proof table before the press
review before publisha gate between generating and going livenothing reaches the press without the editor's initials
deploy, releaseputting a new version of the service into usethe edition going to press

Try it yourself

Pick ten terms from this appendix and write your own picture for each, from your own work rather than a newsroom. Then reread one chapter from Part III with your pictures in mind. The words that still stop you are the ones to look up in the code: every term here names something in agl you can open.

Common questions

Why a newsroom for everything?

One analogy, used consistently, is worth more than ten clever ones: once the reporter, the desk, the editor and the archive are fixed in your mind, every new term has a place to go. Where the newsroom has no picture, we used an everyday one and said so.

Are these definitions exact?

They are exact enough to read the book and the code. A token is not always four characters; a thread is more subtle than "several things at once". The chapters give the precise version where it matters; the picture is for remembering.

Which ten terms matter most?

Token, prompt, evaluator, rubric, state, wave, router, back edge, trace and exam. Know those and the rest follow.

Where are the words defined in code?

Tokens and cost in agl/llm.py; the loop's words in agl/loop.py; tools in agl/tools.py; the graph's words in agl/graph.py; plugins in agl/plugins.py; memory in agl/memory.py and agl/memlib.py; the exam in agl/eval.py.

Carry this

  • Tokens are column inches; the paper pays for every one, and the brief gets longer every round.
  • The loop is a reporter; the evaluator is the editor; the graph is the desk's plan; the state is the whiteboard.
  • A deterministic check is the junior's checklist; a judge is the senior reader; the rubric is the grading sheet.
  • Memory is the archive: pull the clippings before, file the story after, one drawer per client.
  • The exam is the daily edition; the improvement loop is the night desk; scope, gate and log keep it honest.

Check yourself

1. In one picture each: token, wave, back edge.

Answer

A token is a column inch the paper pays for; a wave is the morning meeting sending several reporters out at once; a back edge is the return path when legal bounces a piece.

2. What is the difference between a deterministic check and a judge, in newsroom terms?

Answer

The check is the junior's byline-and-word-count checklist, free and the same every time; the judge is the senior reader with a grading sheet, paid per read, and only shown copy that passed the checklist.

3. Why does a cache have to miss when one word of the question changes?

Answer

Because a cache is honest only for an identical question; serving yesterday's clipping for a different story would be a wrong answer dressed as a fast one.