Core concept · Module 04 · Beginner

What is an agent, really?

"Agent" is one of the most abused words in tech right now. Let's fix that.

Workflow vs. agent — the one distinction that matters

Anthropic drew the clearest line, so we'll use it:

  • Workflow — a system where LLMs and code follow predefined steps. You know the flow chart in advance.
  • Agent — a system where the LLM decides its own steps, using tools and feedback loops, until the goal is met.

Both are useful. Workflows are cheaper, more predictable, easier to debug. Agents are more flexible but slower and more expensive. Start with a workflow. Move to an agent only when the steps genuinely can't be predicted.

Common mistake

Building an agent when a three-step workflow would do. Symptoms: unpredictable output, high API bills, hours of debugging "why did it loop." If you can draw the flowchart, build the workflow.

The six canonical patterns

Straight from Anthropic's "Building effective agents" — the industry reference. Five workflows, one agent.

1. Prompt chaining

Step A → step B → step C. Each step's output is the next step's input. Example: draft a customer email → translate to Spanish → strip jargon.

2. Routing

Classify the input, then send it to the specialized prompt. Example: inbound email → NEW_LEAD path vs. EXISTING_CLIENT path vs. SPAM.

3. Parallelization

Run multiple LLM calls at once, aggregate. Example: score a proposal on clarity, tone, compliance, and pricing — in parallel — then combine.

4. Orchestrator-workers

A lead model splits the task, dispatches to worker models, synthesizes results. Example: research 12 competitor sites — orchestrator plans the pass, workers browse each site.

5. Evaluator-optimizer

One model drafts, another critiques, first revises. Loop until good. Example: proposal draft → QA reviewer flags weak sections → rewrite.

6. Agent

Given a goal, the model picks its own steps and tools, checks its work, and iterates until done. Example: "Find the top 5 competitors in my city, extract their pricing pages, draft a positioning summary."

Pattern 1: Prompt chaining, illustrated

Kickoff notes Extract scope LLM #1 Draft SOW LLM #2 Brand-voice pass LLM #3
Each step does one thing well. If step 2 is broken you can fix it without touching 1 or 3.

Pattern 6: The agent loop

Every real agent boils down to this loop:

Pseudocodewhile not done:
  action = llm.plan(goal, history, available_tools)

  if action.kind == "tool_call":
    result = execute(action.tool, action.args)
    history.append({tool: action.tool, result: result})
  elif action.kind == "answer":
    done = True
    return action.answer

Perplexity Computer, Claude Code, Cursor, and every "agent framework" you've seen is a variation of this. The interesting engineering is in the details: how do you keep the model from looping? How do you handle a failed tool call? When do you give up?

When to use which — a decision table

QuestionAnswerUse
Can you draw the flowchart in advance?YesWorkflow (chain / route / parallel)
Same task, only inputs differ?YesWorkflow
Need consistent output shape every run?YesWorkflow
Cost or latency sensitive?YesWorkflow
Number of steps depends on what the model finds?YesAgent
You want the system to explore or plan on its own?YesAgent
Task is genuinely open-ended (research, coding)?YesAgent
Exercise · 10 min

Classify five of your workflows

Grab your current project list. For each recurring task, decide: workflow or agent?

  1. Weekly project status roll-up → ?
  2. New client intake → SOW → ?
  3. Accessibility audit of a random new site → ?
  4. "Research 8 competitors and summarize" → ?
  5. "Draft an SEO description for this new page" → ?

Answers, in my opinion: workflow, workflow, agent (site content is unknown), agent (open-ended research), workflow.

Or pass the quiz above.