Skip to content

Appendix 02

Book-Wide Glossary: Concepts, Source, and Build ​

Xia A and Lao Z sort colored term cards into concepts, source, and implementation groups, clarifying easily confused terms.

While writing his weekly report, Xiao A used "token" and "context window" interchangeably, and Lao Z caught him. Sheepishly he asked: "Then where am I supposed to look up what these words actually mean?"

"You're not the first to ask." Lao Z brought out this index. "The index runs through the whole book. Part I · Concepts entries give this book's working definitions, Part II · Pi in Source entries are pinned to a named source snapshot, and Part III · Build It entries describe only this book's reference artifact. Each entry records the chapter where it is defined or expanded — chapter names only, no links. Terms listed side by side mean that chapter explains them as one group of concepts; that does not mean they are interchangeable in every implementation."

How to use this index

When a term leaves you unsure, check the working definition here first. The chapter name noted in the definition tells you where to read the full argument. A working definition is a convention of this book, not an industry standard. In another book, the same word may carry a different emphasis.

Models and Inference ​

TermEnglish / AbbreviationWorking definition in this bookDefining chapter
Large language modelLarge Language Model (LLM)A model or service that generates a probability distribution over subsequent tokens from the input tokens: a next-token machine, not an entity that "thinks"Ch. 2 The Truth About the Next-Token Machine — LLM
token / tokenizertoken / tokenizerText is encoded into the discrete units a model processes; one token is not one character, one word, or half a word — it depends on the tokenizerCh. 2 The Truth About the Next-Token Machine — LLM
Autoregressive generationautoregressive generationOnce a token is chosen it is appended as a condition, then the next one is generated — the model generates its own continuationCh. 2 The Truth About the Next-Token Machine — LLM
Parametersparameters / weightsThe numbers optimized during training; fixed at inference time, they determine how the model responds to inputCh. 2 The Truth About the Next-Token Machine — LLM
TrainingtrainingThe process of updating model parameters against a training objective; a completely different stage from inferenceCh. 2 The Truth About the Next-Token Machine — LLM
Model inferenceinferenceProcessing new input with fixed parameters to produce output; keep it separate from the "intermediate computation" sense of reasoningCh. 2 The Truth About the Next-Token Machine — LLM
SamplingsamplingThe rule for choosing a token from the probability distribution of the next token (greedy, temperature, top-k, top-p, and so on)Ch. 2 The Truth About the Next-Token Machine — LLM
TemperaturetemperatureA control parameter that changes the flatness of the candidate distribution; high temperature is more random, low temperature more deterministicCh. 2 The Truth About the Next-Token Machine — LLM
HallucinationhallucinationA fact, citation, or code detail that looks plausible but is not true; the root cause is probabilistic generation rather than verification, not the model "lying"Ch. 2 The Truth About the Next-Token Machine — LLM
Context windowcontext windowThe token budget jointly visible to one request; content beyond the window is invisible to the model because it was never received, so it cannot be "forgotten"Ch. 2 The Truth About the Next-Token Machine — LLM
Prompt cachingprompt cachingA service mechanism that reuses computation for a reusable input prefix; a hit requires a stable prefix — change the prefix and everything after it is voidCh. 2 The Truth About the Next-Token Machine — LLM
reasoningreasoningThe intermediate computation, search, or control process in a task with several constraints; a completely different thing from inference, a distinction the Chinese wording blursCh. 3 Leaving a Scratch Paper for Thinking — CoT
Chain-of-ThoughtChain-of-Thought (CoT)A method of putting intermediate reasoning steps in the output or the prompt; it makes the model think before answering, not "smarter"Ch. 3 Leaving a Scratch Paper for Thinking — CoT
reasoning effort / budgetreasoning effort / budgetA control item in specific APIs for reasoning resources or output budget; turning it up does not mean more accurate — it may be slower and dearerCh. 3 Leaving a Scratch Paper for Thinking — CoT
Stop reasonstop reason / finish reasonThe state offered when a response ends, from which the caller picks the control flow (complete / length / tool_use / error, and so on); it decides the next step, it is not just a labelCh. 3 Leaving a Scratch Paper for Thinking — CoT

Providers, Prompts, and Messages ​

TermEnglish / AbbreviationWorking definition in this bookDefining chapter
ProviderProviderThe service boundary for authentication, the model catalog, and request behaviour — a complete abstraction wrapping authentication, rate limiting, and error semantics, not just a "URL"Ch. 4 How the Translation Bureau Connects to Models — Provider
adapteradapterThe conversion implementation between the unified contract and a vendor's protocol; it hides external shapes and may drop vendor-specific informationCh. 4 How the Translation Bureau Connects to Models — Provider
unified messageunified messageThe business representation of roles, content blocks, calls, and results; converted to and from each vendor's native format by an adapterCh. 4 How the Translation Bureau Connects to Models — Provider
streamingstreamingIncremental events with a lifecycle, advancing as a start / delta / stop event stream rather than "returning everything at once"Ch. 4 How the Translation Bureau Connects to Models — Provider
timeout / retrytimeout / retryControls for cancelling an unfinished request and for a bounded number of retries on clearly transient failures; not "retry until success"Ch. 4 How the Translation Bureau Connects to Models — Provider
idempotencyidempotencyThe property that repeating an operation does not further change the target state; a precondition for safe retry, and not every operation has itCh. 4 How the Translation Bureau Connects to Models — Provider
System Prompt / System MessageSystem Prompt / System MessageThe working rules the application supplies up front in the request; they set the rules, not the persona — a system prompt does not turn the model into a different beingCh. 5 Set the Rules Clearly First — System Prompt
instruction hierarchyinstruction hierarchyThe precedence of message sources or roles defined by specific APIs; system usually ranks above user, but not absolutelyCh. 5 Set the Rules Clearly First — System Prompt
prompt compositionprompt compositionThe process of assembling base rules, tool descriptions, project material, and the task into a request in layers — not "writing a paragraph"Ch. 5 Set the Rules Clearly First — System Prompt
prompt version / evaluationprompt version / evaluationRecording changes and comparing observable behaviour with probes; editing a prompt without running regressions is editing blindCh. 5 Set the Rules Clearly First — System Prompt

Tools and the Loop ​

TermEnglish / AbbreviationWorking definition in this bookDefining chapter
function calling / tool usefunction calling / tool useThe interface capability by which a model outputs a structured call request; deciding on the call is the model's job, executing it is notCh. 6 From "Saying" to "Doing" — Function Calling
tool calltool callAn unexecuted request carrying a name, arguments, and a call ID; it is an intention, and the host decides whether it runsCh. 6 From "Saying" to "Doing" — Function Calling
JSON SchemaJSON SchemaConstraints describing the data shape of arguments; arguments from a model still need runtime validation, and you cannot assume they are validCh. 6 From "Saying" to "Doing" — Function Calling
tool resulttool resultThe structured state the executor returns against a call ID; a failure is still a result, not "no result"Ch. 6 From "Saying" to "Doing" — Function Calling
parallel callsparallel callsThe protocol possibility of several call requests in one round; what is parallel are the requests, and the host decides whether execution isCh. 6 From "Saying" to "Doing" — Function Calling
ToolToolA concrete capability the host can declare, validate, and execute — the "handle" by which the model acts on the world, and one with its own security boundaryCh. 8 Fitting Handles onto Capabilities — Tool
ToolSpecToolSpecThe declaration of name, description, input schema, and result contract; it is the tool's instruction manual, and the executor is the handCh. 8 Fitting Handles onto Capabilities — Tool
runtime validationruntime validationSchema and business checks on the actual values a model gives; models do produce values outside the schema, so this step cannot be droppedCh. 8 Fitting Handles onto Capabilities — Tool
execution boundary / output budgetexecution boundary / output budgetWhere side effects actually happen, and the limits on the size and shape of tool results entering the context; both are engineering constraints the model cannot perceiveCh. 8 Fitting Handles onto Capabilities — Tool
Agent LoopAgent LoopThe control flow that repeatedly calls the model, handles tool results, and updates state; the loop is its essence, and a single question-answer is not an AgentCh. 9 Making the Work Actually Loop — Agent Loop
turnturnThe state unit of one model response and the tool results that follow it; one turn can contain several tool callsCh. 9 Making the Work Actually Loop — Agent Loop
ReActReasoning and ActingA research method that alternates reasoning traces and actions; one historical pattern of the Agent Loop, not the only implementationCh. 9 Making the Work Actually Loop — Agent Loop
stop conditionstop conditionTerminating transitions such as budget, completion, failure, and cancellation; it decides when the loop ends, and a loop that never ends burns moneyCh. 9 Making the Work Actually Loop — Agent Loop
event / state machineevent / state machineObservable facts and the control model of permitted transitions; debugging an Agent means debugging this state machineCh. 9 Making the Work Actually Loop — Agent Loop
cancellationcancellationRequesting that current work stop through a signal or controller; it is cooperative, and cancellation has no effect if a tool ignores the signalCh. 9 Making the Work Actually Loop — Agent Loop

Memory, Extensions, and Protocols ​

TermEnglish / AbbreviationWorking definition in this bookDefining chapter
sessionsessionThe application record that organizes messages, calls, and state across several turns; it is not the model's "memory", because the model itself is statelessCh. 10 What to Remember, What to Forget: Memory
short-term / long-term memoryshort-term / long-term memoryMaterial for the current task, versus information confirmed for reuse across sessions; the boundary is whether it crosses sessions, not where it is storedCh. 10 What to Remember, What to Forget: Memory
truncation / compactiontruncation / compactionDeleting part of the material, versus replacing older material with a summary; truncation is lossless but bounded, compaction is lossy but keeps a summary — the two cost differentlyCh. 10 What to Remember, What to Forget: Memory
retrievalretrievalFetching material back from a controlled store for a query; retrieval quality sets the ceiling of RAG and model capability sets the floor, and the floor is not very lowCh. 10 What to Remember, What to Forget: Memory
retentionretentionThe rules for keeping, accessing, updating, and deleting data; a privacy and compliance question, not a purely technical oneCh. 10 What to Remember, What to Forget: Memory
Agent Hook / HookAgent Hook / HookApplication code invoked when an Agent lifecycle event occurs; interface names and timing are defined by the specific implementation, not by a common standardCh. 11 A Word Inserted Before the Action — Hooks
interceptorinterceptorA hook that may allow, reject, or rewrite the main path; an error there can affect the whole turnCh. 11 A Word Inserted Before the Action — Hooks
subscriber / listenersubscriber / listenerA receiver that observes events without changing the main path; an error there costs at most one log lineCh. 11 A Word Inserted Before the Action — Hooks
lifecycle eventlifecycle eventA state-transition point agreed by the runtime; hooks attach to events, and the loop triggers the eventsCh. 11 A Word Inserted Before the Action — Hooks
reentrancyreentrancyTriggering the same event chain again while a hook is running; it causes infinite recursion and needs explicit protectionCh. 11 A Word Inserted Before the Action — Hooks
Model Context ProtocolModel Context Protocol (MCP)The capability and context-exchange protocol defined by a version-pinned specification; not some vendor's private API but an open specificationCh. 12 Leaving a Door for External Tools — MCP
host / client / serverhost / client / serverThe three roles: the hosting application, the initiator of protocol operations, and the exposer of capabilities; one process can play several at the same timeCh. 12 Leaving a Door for External Tools — MCP
protocol version / client capabilitiesprotocol version / client capabilitiesIn the 2026-07-28 revision of MCP, every request declares the protocol version and client capabilities in _meta, and the server can be queried first with server/discover; older revisions negotiated both once in the initialize handshake. Never assume that connecting gives you every featureCh. 12 Leaving a Door for External Tools — MCP
Multi Round-Trip Requests (MRTR)Multi Round-Trip Requests (MRTR)When an MCP server needs more information it returns input_required, and the client resends the original request with inputResponses under a new request IDCh. 12 Leaving a Door for External Tools — MCP
Prompt / Resource / ToolPrompt / Resource / ToolThe three primitives: templates, readable context, and callable actions; each has its own boundary and they cannot be mixedCh. 12 Leaving a Door for External Tools — MCP
stdio / Streamable HTTPstdio / Streamable HTTPThe local and remote transports defined by the specification; stdio is local process-to-process, HTTP is remote over the networkCh. 12 Leaving a Door for External Tools — MCP

Skills, Collaboration, and Retrieval ​

TermEnglish / AbbreviationWorking definition in this bookDefining chapter
SkillSkillTask-experience instructions that can be discovered and loaded on demand; they influence the model through text and do not execute themselves — an instruction manual, not "code"Ch. 13 Putting Experience into an Instruction Manual — Skill
instruction bundleinstruction bundleThe combination of applicability conditions, steps, material, tools, and acceptance notes; one skill is one complete instruction bundleCh. 13 Putting Experience into an Instruction Manual — Skill
discovery / trigger / progressive loadingdiscovery / trigger / progressive loadingThe three steps: read the index, judge applicability, then load the body; it avoids loading every skill at once and blowing up the contextCh. 13 Putting Experience into an Instruction Manual — Skill
soft constraintsoft constraintA rule that influences model decisions through text; "soft" means the model may not obey it, and hard constraints have to come from tools and permissionsCh. 13 Putting Experience into an Instruction Manual — Skill
subagentsubagentAn independent executor delegated a bounded task; independent means its own context and state, not shared with the main AgentCh. 14 Work Alone or Work in a Group: Multi-Agent
multi-agent systemmulti-agent systemA system in which two or more executors collaborate through tasks or messages; "more" is not "better", and coordination cost is a real priceCh. 14 Work Alone or Work in a Group: Multi-Agent
orchestrator / control planeorchestrator / control planeThe coordination layer that assigns, cancels, aggregates, and observes tasks; it manages the queue, it does not remove conflictsCh. 14 Work Alone or Work in a Group: Multi-Agent
task ownership / shared statetask ownership / shared stateThe contract over who may change what and which states are jointly visible; without it, a multi-agent system produces bugs nobody can attributeCh. 14 Work Alone or Work in a Group: Multi-Agent
Retrieval-Augmented GenerationRetrieval-Augmented Generation (RAG)The pipeline that retrieves evidence and folds it into the generation context; retrieval is the means, generation is the goalCh. 15 Letting the Model Answer with Materials — RAG
ingestion / chunking / indexingestion / chunking / indexTurning source material into retrievable chunks carrying metadata; the chunking strategy sets the ceiling on recall qualityCh. 15 Letting the Model Answer with Materials — RAG
sparse / dense / hybrid retrievalsparse / dense / hybrid retrievalRecall methods over terms, vectors, and merged candidates; sparse catches keywords, dense catches semantics, hybrid serves bothCh. 15 Letting the Model Answer with Materials — RAG
reranking / groundingreranking / groundingRe-selecting candidates, and making answers supported by evidence; reranking improves precision, grounding prevents invented citationsCh. 15 Letting the Model Answer with Materials — RAG

Orchestration and Security ​

TermEnglish / AbbreviationWorking definition in this bookDefining chapter
Workflow / GraphWorkflow / GraphFixed steps, versus an expression of nodes, edges, and routing; a workflow is a preset route, a graph allows dynamic routingCh. 16 When There Is More Than One Route — Workflow & Graph
checkpoint / replaycheckpoint / replaySaving a recovery point, and executing again under a recovery contract; replay requires idempotency, otherwise side effects repeatCh. 16 When There Is More Than One Route — Workflow & Graph
threat modelthreat modelAssumptions about assets, attack surface, actors, and acceptable loss, used to tell what is worth defending — not a list of every riskCh. 17 Fitting Guardrails onto Autonomy — Security
trust boundary / prompt injectiontrust boundary / prompt injectionThe boundary of untrusted input, and content that lures the model past its authority; injection is the new attack surface of the Agent eraCh. 17 Fitting Guardrails onto Autonomy — Security
least privilege / approvalleast privilege / approvalNarrowing capabilities by default, and deciding case by case on high-risk actions; least privilege is the default, approval is the exceptionCh. 17 Fitting Guardrails onto Autonomy — Security
sandbox / isolationsandbox / isolationMechanisms that limit the reach of processes, files, networks, or virtualization; an OS-level sandbox is hard isolation, a "sandbox" at prompt level is a soft constraint, and the two are not equivalentCh. 17 Fitting Guardrails onto Autonomy — Security
defense in depthdefense in depthSeveral independent layers of control jointly limiting the loss; no single layer can guarantee safety on its ownCh. 17 Fitting Guardrails onto Autonomy — Security

Part II · Pi in Source: Terms Pinned to the Snapshot ​

The working definitions below are pinned to the upstream pi tag v1.0.0 (commit a13d35a742c6ef8462812a28fbe1d8c8b7431c32, short form a13d35a7); they are not extrapolated to other versions.

Source termWorking definition in the pinned snapshotDefining chapter
ModelsImplThe model-collection implementation that holds the Provider map and owns model lookup, authentication merging, and delegation of the stream entry pointPart II Ch. 2 The Catalog and the Household Register — pi-ai
ProviderThe runtime service boundary that exposes stream implementations, authentication, and model-catalog behaviour per model APIPart II Ch. 2 The Catalog and the Household Register — pi-ai
lazyStreamA wrapper that defers stream creation until subscription and unifies the error entry point; it does not change the vendor's event formatPart II Ch. 3 Issue the Ticket First, Act Later — pi-ai
AgentThe host wrapper that holds the transcript, listeners, message queue, and current abort controller, and calls the low-level loopPart II Ch. 4 The Two-Layer Loop — pi-agent-core
turn socketsThe three callbacks finishTurn, prepareNextTurn, and prepareRequest, injected by the host to rewrite running state at turn boundariesPart II Ch. 4 The Two-Layer Loop — pi-agent-core
AgentSessionThe assembly layer in coding-agent that wires session writing, compaction, extension, and request projection into the Agent socketsPart II Ch. 5 The Dispatch Desk — pi-coding-agent
JSONL session entryA session-tree entry after the JSONL header; it can record messages, configuration changes, compaction, or navigation information — it does not store conversation alonePart II Ch. 5 The Dispatch Desk — pi-coding-agent
session forkThe operation that derives a new session from a chosen session history; it creates no Git branch and no worktreePart II Ch. 5 The Dispatch Desk — pi-coding-agent
compactionThe lossy process of shrinking later context through a separate summarization request that may itself fail, and writing a compaction entryPart II Ch. 5 The Dispatch Desk — pi-coding-agent
ValidatedMessageDecoder / FrameDecoderThe first chains frame parsing, CBOR, and schema validation; the second cuts complete payloads out of byte chunksPart II Ch. 9 Shipping and Customs — pi-protocol
attachmentThe current binding of one remote connection to one hosted session, with a random attachmentId; session requests must match itPart II Ch. 10 The Blackboard and the Sticky Notes — pi-server+pi-client
subscription snapshot / service_updateThe complete state returned with the response when a service is subscribed, and the increments pushed onto that snapshot afterwardsPart II Ch. 10 The Blackboard and the Sticky Notes — pi-server+pi-client
eval harnessThe adapter layer that builds a temporary environment for one evaluation, runs the Agent, collects the output and artifacts, and cleans up the resourcesPart II Ch. 11 A New Exam Room for Every Test — pi-evals

Part III · Build It: Terms of the Reference Artifact ​

The names below describe only the current interface and behaviour of examples/mini-agent; they are not an industry standard.

Implementation termWorking definition in mini-agent todayDefining chapter
ModelClientThe injectable interface that takes system, messages, tools, and an optional signal, and asynchronously produces internal model eventsPart III Ch. 2 Connecting the First Pipe — ModelClient
ModelEventThe internal event union type the current artifact uses to express text, tool_call, and donePart III Ch. 2 Connecting the First Pipe — ModelClient
ToolSpecThe contract of name, description, input schema, and execute function for the current toolsPart III Ch. 4 Fitting Tools onto the Hands — Tools
BeforeToolCallThe policy extension seam that returns an allow or deny result before a tool executes; it is not a globally enforced security layerPart III Ch. 7 A Checkpoint Before Execution — Approval
workspace path boundaryThe boundary that constrains workspace paths with realpath, the nearest existing ancestor, and relative-path checks; it is not an OS sandboxPart III Ch. 4 Fitting Tools onto the Hands — Tools
character approximation budgetA budget estimated from the character length of the full message JSON, used to trim coherent context units; it is not a token countPart III Ch. 5 Keeping Memory Continuous — Session
FakeClientThe offline test double that implements ModelClient with preset event rounds; it does not exercise a real Provider networkPart III Ch. 1 The Blank Sheet and the Boundary — Scope
complete / max_turns / abortedThe return states of the current loop, meaning respectively: finished with no tool call, turn budget exhausted, and aborted by an external signalPart III Ch. 3 Handing the Steering Wheel to the Loop — Agent Loop