Chapter 13 of 16: Coordinate work

When does an assistant become an agent?

Arun MalikSeriesAIFoundations
Table of Contents
Builds on chapter 12. Specific dependencies are in the concept map.

Sometimes the cafe's software should follow a known procedure. Sometimes the next useful step depends on what it just found. These are design choices, not a race to make everything autonomous.

Start with the whole application

An application is the complete software people use to accomplish a task. It can include an interface, ordinary code, models, storage, and connections to other services. The chat box and its model are only part of that system.

A workflow organizes work into steps and transitions. A fixed cafe workflow might validate an item ID, read its description, ask a model to shorten the wording, and display a draft. Code decides the sequence.

  1. ValidateCode checks the selected recipe identifier.
  2. DescribeA model drafts a shorter description.
  3. Store draftAuthorized application code saves and verifies it.
A fixed route can contain a model call. Fixed orchestration does not make generated text deterministic.

Deterministic and hybrid designs describe how fixed rules and model behavior are combined. A deterministic calculation follows specified rules for given inputs. A hybrid workflow mixes such steps with model calls, whose outputs may vary. A fixed route through the workflow does not make every generated word deterministic.

Let observations affect the next step

An agent, in this guide, is a system where a model helps choose actions and next steps toward a goal, using observations from the environment. The application constrains and executes those actions.

An agent loop repeatedly gives the model current information, receives a proposed action or answer, executes allowed actions, and incorporates the resulting observations. It stops when done, blocked, paused, or limited.

For example, the task is to draft a short menu description using the current recipe. The assistant searches for the recipe. If it finds conflicting versions, it checks their metadata or asks a person. If it finds one authorized current note, it drafts the description. The next step depends on what the search returned.

Agent loopAn action's result informs a later choice. The runtime enforces permissions and stopping conditions around the loop.ObserveChoose next stepAllowed actionor stop
An action's result informs a later choice. The runtime enforces permissions and stopping conditions around the loop.

This does not require a human-like inner plan or unlimited independence. “Agent” is used differently by different systems; our definition makes the decision loop explicit.

Who keeps the work moving?

Orchestration coordinates steps, tools, model calls, and their dependencies. A runtime is the executing software environment that runs the system and manages those operations.

Imagine the order rail and the person coordinating preparation. A proposed next task needs somewhere to run, something to track its result, and a rule for what can follow. In software these duties live in code and services, not in a model's promise to remember them.

State is recorded information about the system's current situation. It might include the selected recipe ID, a draft description, and whether a person approved it. State is not necessarily identical to the conversation transcript.

Leave a recoverable handover

A checkpoint is a saved snapshot or record from which work can resume. In an application, it can preserve which steps finished and what remains. In model training, the same word can refer to saved model and training state; these are different uses.

Durable execution is execution designed to recover from interruptions using persisted progress. If the computer restarts, it should know that an order was already created rather than blindly doing it again.

CheckpointPersistent progress supports recovery. Resuming must reconcile external actions, not merely repeat the last sentence.ProgressSavedResumeInterruption
Persistent progress supports recovery. Resuming must reconcile external actions, not merely repeat the last sentence.

Saving a conversation is not enough to make external actions exactly-once. Operations need identifiers, duplicate protection where available, and checks for uncertain outcomes. A handover note cannot undo a sandwich already sold.

A multi-agent system coordinates more than one agent. Separate agents might investigate independent recipe collections, but their findings still need reconciliation. Extra agents add communication, cost, and opportunities for conflicting or repeated work. They are optional, not a guaranteed upgrade over one well-bounded workflow.

WorkersSeparate agents can work on independent tasks. Coordination and result checking add work; two agents are not automatically better than one.CoordinateAgent AAgent BReconcile results
Separate agents can work on independent tasks. Coordination and result checking add work; two agents are not automatically better than one.
Must a fixed menu lookup become an agent loop?

No. If the required steps are known and ordinary code can perform them, a fixed workflow may be simpler to test and operate. Add model-chosen steps when the task benefits from that flexibility.