Hunter Brennick AI Systems & Advisory ↗
AI Systems Orchestration
Part I · Foundations/Chapter 02
02

LLM Primitives

The raw building blocks: models, prompts, structured outputs, tool calls, retrieval, context windows, and routing.

5 min read3 figures
The gist
  • Learn the pieces before agents: prompts, structured outputs, tool calls, retrieval, routing.
  • A context window is capacity, not knowledge.
  • Structured output is the handle that lets software safely grab model work.
  • Strong models reduce orchestration needs but never eliminate them.
THE PARTS TRAY · TEN PRIMITIVES model call one prompt in one answer out prompt structure instructions the model can follow structured output validated JSON software can grab tool calling the model reaches outside itself retrieval find and rank candidate context context window capacity not knowledge memory retained across runs not an authority model routing cheap · fast · strong per task multimodal images · audio documents computer use screens · browsers real software learn the pieces before the agents · every serious system is these ten parts composed with judgment
FIG 02.1The parts tray: ten primitives to learn before anything deserves the name agent.

Module 2: LLM Primitives

The on-ramp covered the plain versions of these. This chapter makes them precise and adds the rest.

Learn the pieces before the agent talk starts. Model capability versus cost versus latency. Prompt structure. Structured outputs. Function and tool calling. Retrieval. Context windows. Token budgets. Knowledge sources versus selected context versus retained memory. Summarization and compaction. Model routing. Multimodal inputs. Computer and browser use.

ONE REQUEST · THE CALL LOOP assemble instructions + selection context window the token budget model reason · decide good enough? answer structured output validated before use needs the world? call a tool tool real data · real action result folds back in the loop repeats until the model answers or the budget says stop
FIG 02.2One request through the loop: assemble, fill the window, reason, reach for tools, validate.

Build a one page model routing table covering:

  • a cheap model
  • a strong reasoning model
  • a coding model
  • a vision model
  • a browser or computer use model

Write a structured output prompt that returns validated JSON. Then keep a failure log. Did the model misunderstand the task? Did it invent context? Did it choose the wrong tool?

Why Capacity Is Not Knowledge

A context window includes everything sent to the model in a single call. The system prompt counts. Every message counts. Every tool result counts. Every attached document counts. The model's own output counts too including any extended thinking. All of it draws against the same budget.

A larger window does not fix poor context selection. A model given a huge pile of loosely relevant material will often underperform a model given a small window with exactly the right few paragraphs. Every added token still has to be read and weighed. Irrelevant content carries a real cost even when it technically fits.

An agent with a bigger context window still needs a real retrieval step. Bigger capacity does not replace good selection.

Why Structured Output Matters

An unconstrained response to "is this ticket urgent" might read like this: "Yes this looks fairly urgent to me." That still needs parsing before software can act on it. Parsing free text reliably is hard.

A schema constrained response returns {"urgent": true} instead. The output can be validated and consumed directly. No regex. No guessing. That is the real value of structured output. It turns a judgment call into a value a program can rely on.

Strong models reduce orchestration needs. They do not eliminate them. A context window is capacity. It is not knowledge. Useful context still has to be selected. It has to be grounded. It has to be kept current. Structured output is not boring. It is the handle that lets software safely grab model work.

ANATOMY OF A CONTEXT WINDOW system instructions the task retrieved evidence selected for this run tool results filtered · summarized working state 0 tokens the budget the window holds what was selected for this run · nothing more knowledge lives in sources · selection is the real work more context is not automatically better context
FIG 02.3Anatomy of a context window: one budget, five claims on it, and no knowledge of its own.
Next chapterChapter 03 · Compound AI Systems The shift from single model calls to systems: retrieval, code execution, verifiers, sampling, model programs, and feedback loops.