Skip to content
BIASED

Workflows, frameworks and protocols

Five workflows, when to fix the steps, and MCP as the standard to tools.

The augmented LLM and design choice

Memory, planning and self-correction can each be an open-ended agent decision or a fixed point in code. One model with every tool handles anything in principle and pays four ways already seen: every schema in every context, unchecked compounding errors, unreproducible runs, and unbounded cost without budgets.

Key idea. Most LM systems are a small number of model calls arranged by ordinary code — chained with checks, routed, parallelised, orchestrated, or looped with an evaluator. Use the simplest arrangement that measurably works; leave step choice to the model only when steps cannot be known in advance. Connect tools through a protocol so each tool is written once.

The building block is the augmented LLM: a model with retrieval, tools and memory. Workflows arrange several such calls on paths written in code; an agent lets the model direct its own process.

Five workflows

Prompt chaining. Fixed sequence of calls with programmatic gates between them. Without gates, kk steps succeed with probability sks^k; with a gate that catches fraction gg of failures and one retry, a step succeeds with s+(1−s)gss+(1-s)gs. For s=0.9s=0.9, k=4k=4, g=0.8g=0.8: 0.6560.656 without gates versus ≈0.893\approx 0.893 with them.

Routing. A classifier sends each input to a specialised handler. Overall success ρh+(1−ρ)h′\rho h+(1-\rho)h'. With h=0.9h=0.9, h′=0.3h'=0.3 versus a 0.80.8 generalist, routing wins only for ρ>5/6≈0.83\rho>5/6\approx 0.83 — measure the router first.

Parallelization. Sectioning cuts latency to the slowest part; voting aggregates independent samples (self-consistency). Three votes at p=0.7p=0.7 give majority 0.7840.784 if independent — real votes correlate, so less.

Orchestrator–workers. A central model invents subtasks at run time and merges results — the bridge to multi-agent systems.

Evaluator–optimizer. Generate, critique, repeat until accept — ceiling set by the evaluator’s false-positive rate from the previous topic.

Autonomous agents. The model chooses steps in a ReAct loop until stop or budget — for open-ended work, with sandboxes, budgets and confirmation before side effects.

When to fix the workflow

A decision list from cheapest to most expensive: (1) one call with retrieval and exemplars if it works; (2) known steps → chain with gates; (3) distinct input classes and a reliable router → route; (4) independent parts → parallel, unreliable single answers → vote; (5) checkable, improvable drafts → evaluator loop; (6) only if later steps depend on earlier revelations and mistakes can be detected or undone → orchestrator or agent. Combining patterns is normal (router in front of chains, one of which is an agent with an evaluator).

Frameworks

Two families package the plumbing. Graph orchestration (e.g. LangGraph, 2024) uses a typed state, nodes, conditional edges and a checkpointer under a thread id — chains, routers and eval loops map to graphs; an agent is a node with a loop-while-tools edge. Provider agent SDKs (OpenAI Agents SDK, Google ADK, Claude Agent SDK, 2025) package the loop: instructions, tools, runner, hand-offs, guardrails, tracing. Ask of any framework: can you see every prompt and response; is state persisted for resume/replay; can a person interrupt and approve; does it get out of the way when plain code is better? Start with direct API calls until you understand the prompts underneath.

Model Context Protocol

Without a standard, MM apps and NN tools need up to M×NM\times N integrations; with one, M+NM+N. The Model Context Protocol (Anthropic, Nov 2024; Agentic AI Foundation / Linux Foundation, Dec 2025) is that standard — LSP’s idea for editors, applied to tools. A host owns the model, conversation and consent; it creates one client per server. Servers expose tools (JSON Schema, tools/list / tools/call), resources (URI-addressed data) and prompts (templated workflows). Messages are JSON-RPC 2.0. Protocol errors (unknown tool, bad request) are JSON-RPC errors for the client; tool execution errors are ordinary results with isError: true for the model to read and retry. Transports: stdio and Streamable HTTP. Revision 2026-07-28 is stateless: no handshake — every request carries protocol version and client capabilities in _meta; server/discover replaces initialize; sampling/roots deprecated. Tool lists should be deterministic for prompt caching. Agent2Agent (Google → LF, 2025) connects agents to agents via Agent Cards; MCP remains the widely deployed tools path. A protocol does not make a tool safe — consent, sandboxing and least privilege stay the host’s job (Agent security).

Section close and next

This section gave the loop memory, planning, self-correction and structured composition. Next: put the pieces to work, starting where agents are most developed — coding agents, with repositories, shells and tests as a judge the agent can run itself.

Check your understanding

The same questions as in Pulse. Answers are shared between modes.

Full notes

Answers are saved on the server and tied to this browser until you sign in.