Agentic AI Patterns

Course Content

Agentic AI Patterns

9 sections · 50 lessons

What are the different task execution patterns in Agentic AI?


From least to most dynamicSingle call — the baseline to beatChains and routers — code sets pathParallel and orchestrator-workersEvaluator-optimizer — revise to passAgent loop — the model owns the path
In the claims system only about one claim in five ever reaches the bottom rung, which is what a good design looks like.

What you need to know

The patterns

PatternHow it worksUse when
Single callOne well-prompted requestAlways the baseline
Prompt chainingFixed steps; each output feeds the next, with checks betweenTask splits into known stages
RoutingClassify, then dispatch to a specialised prompt, model or tool setDistinct request types
Parallelisation: sectioningSplit into independent parts, run together, mergeIndependent subtasks
Parallelisation: votingSame task several times; majority or judgeNeed confidence on high-stakes answers
Orchestrator-workersLead model decides the subtasks at runtime, workers do themSubtasks not known in advance
Evaluator-optimizerGenerate, critique against criteria, reviseClear criteria; revisions help
Agent loop (ReAct)Think, call a tool, observe, repeatUnknown number of steps
Plan-and-executeWrite a plan, execute, re-plan on failureLong tasks; approval needed
Human checkpointPause before a gated action, resume after approvalIrreversible or regulated actions

The first six are workflows: code controls the path. The loop and plan-and-execute are agents: the model controls it. This split, and most of these names, come from widely used industry guidance on building agents; interviewers expect them.

Routing in code

Python
ROUTES = {    "status":  {"model": "small",  "handler": "lookup_chain"},    "change":  {"model": "medium", "handler": "change_booking_agent"},    "refund":  {"model": "strong", "handler": "refund_agent"},}def route(classify, request):    label, confidence = classify(request)          # one cheap model call    if label not in ROUTES or confidence < 0.7:        return {"model": "strong", "handler": "general_agent"}   # safe fallback    return ROUTES[label]

A cheap classifier decides where the request goes. Unknown labels and low confidence fall back to the capable general handler, so a routing mistake costs money, not correctness.

Choosing

Ask in order: Can one call do it? Are the steps fixed (chain)? Are there distinct types (route)? Are parts independent (parallelise)? Are subtasks unknown until runtime (orchestrator-workers)? Is the number of steps unknown (agent loop)? Stop at the first yes. Every pattern from the agent loop onwards needs step budgets, timeouts and a stop condition.

A real-life example

An insurance company's claims system uses almost every pattern, each in its place:

  • Routing: a small model tags incoming mail as new claim, status query, document upload or complaint. Status queries (45% of volume) go to a simple lookup chain.
  • Prompt chaining: new claims run extract fields, then validate against the policy, then check for duplicates, with a code check between each step.
  • Parallelisation (sectioning): the fraud check, policy check and repair-cost estimate run at the same time.
  • Voting: for suspected fraud, three independent assessments; two of three must agree before a claim is flagged.
  • Agent loop: only messy claims with missing or conflicting documents go to an agent that can request documents and search history.
  • Evaluator-optimizer: the customer letter is checked against a rubric (correct amount, clause cited, plain language) and revised once if needed.
  • Human checkpoint: every denial and every payout above Rs 2 lakh.

Only about 20% of claims ever reach the agent loop. That is typical of good designs.

Follow-up questions to expect

  • "Orchestrator-workers versus parallelisation?" — In parallelisation, code defines the subtasks in advance. In orchestrator-workers, the lead model decides them at runtime, based on the input.
  • "Where does plan-and-execute fit?" — It is an agent pattern with an explicit plan artefact, useful for long tasks, approval and parallel steps.
  • "Can patterns be nested?" — Yes. A router can send to a chain, one chain step can be an agent loop, and the loop can call a parallel fan-out.