Cost, Latency, Isolation, and Production Topology

Choose topology for latency, not aesthetics. Tier models by node difficulty. Isolate parallel writers.

~3hcostlatencyisolationmodel-tiering
Learning objectives
  • Choose topology for latency, not aesthetics.
  • Tier models by node difficulty.
  • Isolate parallel writers.
Note

This course extends the existing Agentic Engineering track. The focus is not "more prompting"; it is shaping the work: loops, fan-out, fan-in, routing, verification, cost, and convergence.

Topology is latency

Parallel barriers are fast for independent breadth but slow when every stage waits for the slowest item. Pipelines reduce idle time when items do not need cross-set synchronization.

Tier the models

Extractor and classifier nodes can often run on cheaper models. Synthesis, adjudication, and risky decisions deserve stronger models. Spend tokens where judgment lives.

await agent(prompt, { model: 'cheap-fast-model', schema: Extracted });
await agent(reportPrompt, { model: 'strong-reasoning-model' });

Isolation

Parallel agents that write files need isolation: separate branches, worktrees, temporary directories, or explicit file ownership. Otherwise nodes can poison each other by overwriting shared state.

Recap

A loop is a controlled cycle. A graph is the work shape around that cycle. The production skill is knowing which parts need model judgment, which parts are deterministic edges, and where confidence gates belong.

Cost, Latency, Isolation, and Production Topology — Exercises

Exercise 1 — Draw the hidden graph

Take a linear workflow you already use, such as "research sources → summarize → compare → write report". Draw every step as a node. Then remove every arrow where the downstream step does not consume upstream data.

Reference solution

A strong answer identifies independent nodes and labels edges by data, not by time. Example: "source A research" and "source B research" are independent; both feed a deterministic reduce step; the reduced evidence feeds synthesis.

Exercise 2 — Write node contracts

For three nodes in your graph, define:

  • input shape
  • output shape
  • failure mode
  • downstream consumer
Reference solution

Good contracts are narrow: { topic, sourceUrl } in; { claims: [{ text, sourceUrl, confidence }] } out. Avoid "return a useful summary" because the next node cannot validate it.

Exercise 3 — Add one safety gate

Place a verifier, schema validator, budget check, or human approval gate on the edge most likely to poison downstream work.

Reference solution

For a research graph, gate unsupported claims before synthesis. For a code graph, gate findings with reproduction or a second reviewer before reporting.