Book-Wide Glossary: Concepts, Source, and Build

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
| Term | English / Abbreviation | Working definition in this book | Defining chapter |
|---|---|---|---|
| Large language model | Large 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 / tokenizer | token / tokenizer | Text 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 tokenizer | Ch. 2 The Truth About the Next-Token Machine — LLM |
| Autoregressive generation | autoregressive generation | Once a token is chosen it is appended as a condition, then the next one is generated — the model generates its own continuation | Ch. 2 The Truth About the Next-Token Machine — LLM |
| Parameters | parameters / weights | The numbers optimized during training; fixed at inference time, they determine how the model responds to input | Ch. 2 The Truth About the Next-Token Machine — LLM |
| Training | training | The process of updating model parameters against a training objective; a completely different stage from inference | Ch. 2 The Truth About the Next-Token Machine — LLM |
| Model inference | inference | Processing new input with fixed parameters to produce output; keep it separate from the "intermediate computation" sense of reasoning | Ch. 2 The Truth About the Next-Token Machine — LLM |
| Sampling | sampling | The 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 |
| Temperature | temperature | A control parameter that changes the flatness of the candidate distribution; high temperature is more random, low temperature more deterministic | Ch. 2 The Truth About the Next-Token Machine — LLM |
| Hallucination | hallucination | A 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 window | context window | The 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 caching | prompt caching | A service mechanism that reuses computation for a reusable input prefix; a hit requires a stable prefix — change the prefix and everything after it is void | Ch. 2 The Truth About the Next-Token Machine — LLM |
| reasoning | reasoning | The intermediate computation, search, or control process in a task with several constraints; a completely different thing from inference, a distinction the Chinese wording blurs | Ch. 3 Leaving a Scratch Paper for Thinking — CoT |
| Chain-of-Thought | Chain-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 / budget | reasoning effort / budget | A control item in specific APIs for reasoning resources or output budget; turning it up does not mean more accurate — it may be slower and dearer | Ch. 3 Leaving a Scratch Paper for Thinking — CoT |
| Stop reason | stop reason / finish reason | The 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 label | Ch. 3 Leaving a Scratch Paper for Thinking — CoT |
Providers, Prompts, and Messages
| Term | English / Abbreviation | Working definition in this book | Defining chapter |
|---|---|---|---|
| Provider | Provider | The 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 |
| adapter | adapter | The conversion implementation between the unified contract and a vendor's protocol; it hides external shapes and may drop vendor-specific information | Ch. 4 How the Translation Bureau Connects to Models — Provider |
| unified message | unified message | The business representation of roles, content blocks, calls, and results; converted to and from each vendor's native format by an adapter | Ch. 4 How the Translation Bureau Connects to Models — Provider |
| streaming | streaming | Incremental 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 / retry | timeout / retry | Controls 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 |
| idempotency | idempotency | The property that repeating an operation does not further change the target state; a precondition for safe retry, and not every operation has it | Ch. 4 How the Translation Bureau Connects to Models — Provider |
| System Prompt / System Message | System Prompt / System Message | The 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 being | Ch. 5 Set the Rules Clearly First — System Prompt |
| instruction hierarchy | instruction hierarchy | The precedence of message sources or roles defined by specific APIs; system usually ranks above user, but not absolutely | Ch. 5 Set the Rules Clearly First — System Prompt |
| prompt composition | prompt composition | The 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 / evaluation | prompt version / evaluation | Recording changes and comparing observable behaviour with probes; editing a prompt without running regressions is editing blind | Ch. 5 Set the Rules Clearly First — System Prompt |
Tools and the Loop
| Term | English / Abbreviation | Working definition in this book | Defining chapter |
|---|---|---|---|
| function calling / tool use | function calling / tool use | The interface capability by which a model outputs a structured call request; deciding on the call is the model's job, executing it is not | Ch. 6 From "Saying" to "Doing" — Function Calling |
| tool call | tool call | An unexecuted request carrying a name, arguments, and a call ID; it is an intention, and the host decides whether it runs | Ch. 6 From "Saying" to "Doing" — Function Calling |
| JSON Schema | JSON Schema | Constraints describing the data shape of arguments; arguments from a model still need runtime validation, and you cannot assume they are valid | Ch. 6 From "Saying" to "Doing" — Function Calling |
| tool result | tool result | The 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 calls | parallel calls | The protocol possibility of several call requests in one round; what is parallel are the requests, and the host decides whether execution is | Ch. 6 From "Saying" to "Doing" — Function Calling |
| Tool | Tool | A 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 boundary | Ch. 8 Fitting Handles onto Capabilities — Tool |
| ToolSpec | ToolSpec | The declaration of name, description, input schema, and result contract; it is the tool's instruction manual, and the executor is the hand | Ch. 8 Fitting Handles onto Capabilities — Tool |
| runtime validation | runtime validation | Schema and business checks on the actual values a model gives; models do produce values outside the schema, so this step cannot be dropped | Ch. 8 Fitting Handles onto Capabilities — Tool |
| execution boundary / output budget | execution boundary / output budget | Where 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 perceive | Ch. 8 Fitting Handles onto Capabilities — Tool |
| Agent Loop | Agent Loop | The 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 Agent | Ch. 9 Making the Work Actually Loop — Agent Loop |
| turn | turn | The state unit of one model response and the tool results that follow it; one turn can contain several tool calls | Ch. 9 Making the Work Actually Loop — Agent Loop |
| ReAct | Reasoning and Acting | A research method that alternates reasoning traces and actions; one historical pattern of the Agent Loop, not the only implementation | Ch. 9 Making the Work Actually Loop — Agent Loop |
| stop condition | stop condition | Terminating transitions such as budget, completion, failure, and cancellation; it decides when the loop ends, and a loop that never ends burns money | Ch. 9 Making the Work Actually Loop — Agent Loop |
| event / state machine | event / state machine | Observable facts and the control model of permitted transitions; debugging an Agent means debugging this state machine | Ch. 9 Making the Work Actually Loop — Agent Loop |
| cancellation | cancellation | Requesting that current work stop through a signal or controller; it is cooperative, and cancellation has no effect if a tool ignores the signal | Ch. 9 Making the Work Actually Loop — Agent Loop |
Memory, Extensions, and Protocols
| Term | English / Abbreviation | Working definition in this book | Defining chapter |
|---|---|---|---|
| session | session | The application record that organizes messages, calls, and state across several turns; it is not the model's "memory", because the model itself is stateless | Ch. 10 What to Remember, What to Forget: Memory |
| short-term / long-term memory | short-term / long-term memory | Material for the current task, versus information confirmed for reuse across sessions; the boundary is whether it crosses sessions, not where it is stored | Ch. 10 What to Remember, What to Forget: Memory |
| truncation / compaction | truncation / compaction | Deleting 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 differently | Ch. 10 What to Remember, What to Forget: Memory |
| retrieval | retrieval | Fetching 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 low | Ch. 10 What to Remember, What to Forget: Memory |
| retention | retention | The rules for keeping, accessing, updating, and deleting data; a privacy and compliance question, not a purely technical one | Ch. 10 What to Remember, What to Forget: Memory |
| Agent Hook / Hook | Agent Hook / Hook | Application code invoked when an Agent lifecycle event occurs; interface names and timing are defined by the specific implementation, not by a common standard | Ch. 11 A Word Inserted Before the Action — Hooks |
| interceptor | interceptor | A hook that may allow, reject, or rewrite the main path; an error there can affect the whole turn | Ch. 11 A Word Inserted Before the Action — Hooks |
| subscriber / listener | subscriber / listener | A receiver that observes events without changing the main path; an error there costs at most one log line | Ch. 11 A Word Inserted Before the Action — Hooks |
| lifecycle event | lifecycle event | A state-transition point agreed by the runtime; hooks attach to events, and the loop triggers the events | Ch. 11 A Word Inserted Before the Action — Hooks |
| reentrancy | reentrancy | Triggering the same event chain again while a hook is running; it causes infinite recursion and needs explicit protection | Ch. 11 A Word Inserted Before the Action — Hooks |
| Model Context Protocol | Model Context Protocol (MCP) | The capability and context-exchange protocol defined by a version-pinned specification; not some vendor's private API but an open specification | Ch. 12 Leaving a Door for External Tools — MCP |
| host / client / server | host / client / server | The three roles: the hosting application, the initiator of protocol operations, and the exposer of capabilities; one process can play several at the same time | Ch. 12 Leaving a Door for External Tools — MCP |
| protocol version / client capabilities | protocol version / client capabilities | In 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 feature | Ch. 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 ID | Ch. 12 Leaving a Door for External Tools — MCP |
| Prompt / Resource / Tool | Prompt / Resource / Tool | The three primitives: templates, readable context, and callable actions; each has its own boundary and they cannot be mixed | Ch. 12 Leaving a Door for External Tools — MCP |
| stdio / Streamable HTTP | stdio / Streamable HTTP | The local and remote transports defined by the specification; stdio is local process-to-process, HTTP is remote over the network | Ch. 12 Leaving a Door for External Tools — MCP |
Skills, Collaboration, and Retrieval
| Term | English / Abbreviation | Working definition in this book | Defining chapter |
|---|---|---|---|
| Skill | Skill | Task-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 bundle | instruction bundle | The combination of applicability conditions, steps, material, tools, and acceptance notes; one skill is one complete instruction bundle | Ch. 13 Putting Experience into an Instruction Manual — Skill |
| discovery / trigger / progressive loading | discovery / trigger / progressive loading | The three steps: read the index, judge applicability, then load the body; it avoids loading every skill at once and blowing up the context | Ch. 13 Putting Experience into an Instruction Manual — Skill |
| soft constraint | soft constraint | A rule that influences model decisions through text; "soft" means the model may not obey it, and hard constraints have to come from tools and permissions | Ch. 13 Putting Experience into an Instruction Manual — Skill |
| subagent | subagent | An independent executor delegated a bounded task; independent means its own context and state, not shared with the main Agent | Ch. 14 Work Alone or Work in a Group: Multi-Agent |
| multi-agent system | multi-agent system | A system in which two or more executors collaborate through tasks or messages; "more" is not "better", and coordination cost is a real price | Ch. 14 Work Alone or Work in a Group: Multi-Agent |
| orchestrator / control plane | orchestrator / control plane | The coordination layer that assigns, cancels, aggregates, and observes tasks; it manages the queue, it does not remove conflicts | Ch. 14 Work Alone or Work in a Group: Multi-Agent |
| task ownership / shared state | task ownership / shared state | The contract over who may change what and which states are jointly visible; without it, a multi-agent system produces bugs nobody can attribute | Ch. 14 Work Alone or Work in a Group: Multi-Agent |
| Retrieval-Augmented Generation | Retrieval-Augmented Generation (RAG) | The pipeline that retrieves evidence and folds it into the generation context; retrieval is the means, generation is the goal | Ch. 15 Letting the Model Answer with Materials — RAG |
| ingestion / chunking / index | ingestion / chunking / index | Turning source material into retrievable chunks carrying metadata; the chunking strategy sets the ceiling on recall quality | Ch. 15 Letting the Model Answer with Materials — RAG |
| sparse / dense / hybrid retrieval | sparse / dense / hybrid retrieval | Recall methods over terms, vectors, and merged candidates; sparse catches keywords, dense catches semantics, hybrid serves both | Ch. 15 Letting the Model Answer with Materials — RAG |
| reranking / grounding | reranking / grounding | Re-selecting candidates, and making answers supported by evidence; reranking improves precision, grounding prevents invented citations | Ch. 15 Letting the Model Answer with Materials — RAG |
Orchestration and Security
| Term | English / Abbreviation | Working definition in this book | Defining chapter |
|---|---|---|---|
| Workflow / Graph | Workflow / Graph | Fixed steps, versus an expression of nodes, edges, and routing; a workflow is a preset route, a graph allows dynamic routing | Ch. 16 When There Is More Than One Route — Workflow & Graph |
| checkpoint / replay | checkpoint / replay | Saving a recovery point, and executing again under a recovery contract; replay requires idempotency, otherwise side effects repeat | Ch. 16 When There Is More Than One Route — Workflow & Graph |
| threat model | threat model | Assumptions about assets, attack surface, actors, and acceptable loss, used to tell what is worth defending — not a list of every risk | Ch. 17 Fitting Guardrails onto Autonomy — Security |
| trust boundary / prompt injection | trust boundary / prompt injection | The boundary of untrusted input, and content that lures the model past its authority; injection is the new attack surface of the Agent era | Ch. 17 Fitting Guardrails onto Autonomy — Security |
| least privilege / approval | least privilege / approval | Narrowing capabilities by default, and deciding case by case on high-risk actions; least privilege is the default, approval is the exception | Ch. 17 Fitting Guardrails onto Autonomy — Security |
| sandbox / isolation | sandbox / isolation | Mechanisms 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 equivalent | Ch. 17 Fitting Guardrails onto Autonomy — Security |
| defense in depth | defense in depth | Several independent layers of control jointly limiting the loss; no single layer can guarantee safety on its own | Ch. 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 term | Working definition in the pinned snapshot | Defining chapter |
|---|---|---|
ModelsImpl | The model-collection implementation that holds the Provider map and owns model lookup, authentication merging, and delegation of the stream entry point | Part II Ch. 2 The Catalog and the Household Register — pi-ai |
Provider | The runtime service boundary that exposes stream implementations, authentication, and model-catalog behaviour per model API | Part II Ch. 2 The Catalog and the Household Register — pi-ai |
lazyStream | A wrapper that defers stream creation until subscription and unifies the error entry point; it does not change the vendor's event format | Part II Ch. 3 Issue the Ticket First, Act Later — pi-ai |
Agent | The host wrapper that holds the transcript, listeners, message queue, and current abort controller, and calls the low-level loop | Part II Ch. 4 The Two-Layer Loop — pi-agent-core |
| turn sockets | The three callbacks finishTurn, prepareNextTurn, and prepareRequest, injected by the host to rewrite running state at turn boundaries | Part II Ch. 4 The Two-Layer Loop — pi-agent-core |
AgentSession | The assembly layer in coding-agent that wires session writing, compaction, extension, and request projection into the Agent sockets | Part II Ch. 5 The Dispatch Desk — pi-coding-agent |
| JSONL session entry | A session-tree entry after the JSONL header; it can record messages, configuration changes, compaction, or navigation information — it does not store conversation alone | Part II Ch. 5 The Dispatch Desk — pi-coding-agent |
| session fork | The operation that derives a new session from a chosen session history; it creates no Git branch and no worktree | Part II Ch. 5 The Dispatch Desk — pi-coding-agent |
| compaction | The lossy process of shrinking later context through a separate summarization request that may itself fail, and writing a compaction entry | Part II Ch. 5 The Dispatch Desk — pi-coding-agent |
ValidatedMessageDecoder / FrameDecoder | The first chains frame parsing, CBOR, and schema validation; the second cuts complete payloads out of byte chunks | Part II Ch. 9 Shipping and Customs — pi-protocol |
| attachment | The current binding of one remote connection to one hosted session, with a random attachmentId; session requests must match it | Part II Ch. 10 The Blackboard and the Sticky Notes — pi-server+pi-client |
subscription snapshot / service_update | The complete state returned with the response when a service is subscribed, and the increments pushed onto that snapshot afterwards | Part II Ch. 10 The Blackboard and the Sticky Notes — pi-server+pi-client |
| eval harness | The adapter layer that builds a temporary environment for one evaluation, runs the Agent, collects the output and artifacts, and cleans up the resources | Part 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 term | Working definition in mini-agent today | Defining chapter |
|---|---|---|
ModelClient | The injectable interface that takes system, messages, tools, and an optional signal, and asynchronously produces internal model events | Part III Ch. 2 Connecting the First Pipe — ModelClient |
ModelEvent | The internal event union type the current artifact uses to express text, tool_call, and done | Part III Ch. 2 Connecting the First Pipe — ModelClient |
ToolSpec | The contract of name, description, input schema, and execute function for the current tools | Part III Ch. 4 Fitting Tools onto the Hands — Tools |
BeforeToolCall | The policy extension seam that returns an allow or deny result before a tool executes; it is not a globally enforced security layer | Part III Ch. 7 A Checkpoint Before Execution — Approval |
| workspace path boundary | The boundary that constrains workspace paths with realpath, the nearest existing ancestor, and relative-path checks; it is not an OS sandbox | Part III Ch. 4 Fitting Tools onto the Hands — Tools |
| character approximation budget | A budget estimated from the character length of the full message JSON, used to trim coherent context units; it is not a token count | Part III Ch. 5 Keeping Memory Continuous — Session |
FakeClient | The offline test double that implements ModelClient with preset event rounds; it does not exercise a real Provider network | Part III Ch. 1 The Blank Sheet and the Boundary — Scope |
complete / max_turns / aborted | The return states of the current loop, meaning respectively: finished with no tool call, turn budget exhausted, and aborted by an external signal | Part III Ch. 3 Handing the Steering Wheel to the Loop — Agent Loop |
