QRefAI
Contents
Custom AI Agents

Part 1 — What is an agent, really?

What is an agent, really — and does my problem even need one?

4 min · Updated June 2026

Strip away the hype and an agent is a loop around a language model that can take actions in the world and decide what to do next based on what happened.

That’s it. A model receives some context, decides to call a tool — search a database, file a claim, send an email — sees the result, and loops again, continuing until the task is done or it hits a stopping condition. The “agentic” quality comes from the model controlling the loop: it chooses which action to take, in what order, and when to stop. Compare that to a traditional workflow, where a human engineer hard-codes those decisions in advance.

Q1.1 — What is the stripped-down definition?

A workflow is a system where LLMs and tools are orchestrated through predefined code paths. You, the engineer, decide the steps in advance.

An agent is a system where the LLM dynamically directs its own process, deciding which tools to use and how to accomplish the task. The model controls the loop.

Both are useful. The confusion between them is the most expensive mistake teams make.

Q1.2 — What is the most important distinction in the field?

This framing comes from Anthropic’s “Building Effective Agents” guidance, which remains the canonical taxonomy in 2026. The practical lesson hidden in the distinction is the most important piece of advice in this whole series: most business problems do not need a fully autonomous agent.

A predefined workflow with one or two LLM calls is cheaper, faster, more predictable, and infinitely easier to audit. You should reach for genuine agency only when the task has so many branches that you genuinely cannot enumerate them ahead of time. Building a “fully autonomous multi-agent system” for a problem that a routing workflow would solve is the most common and expensive mistake teams make.

Diagram contrasting a workflow (predefined code paths) with an AI agent (LLM dynamically directing its own process and tool use)

So the first design question is never “which agent framework?” It is: does this even need an agent, or is it a workflow?

Decision flowchart for determining whether a problem needs a fully autonomous AI agent or a simpler predefined workflow

Q1.3 — What does every production agent decompose into?

If the answer is yes — it does need an agent — then every production agent you will ever encounter, regardless of vendor or framework, decomposes into the same six concerns. The rest of this series is organised around them.

Diagram showing the six concerns every production AI agent decomposes into: model, context, memory, tools, orchestration, and production envelope
  • The model— the reasoning engine. Increasingly several models at different price and capability tiers, not one.
  • Context— everything the model can see at the moment it makes a decision. This is the discipline that has come to define the field.
  • Memory— what persists across the gaps: across turns, across sessions, across the agent’s whole lifetime.
  • Tools— how the agent touches the outside world, now standardised largely through MCP.
  • Orchestration— the loop, the branching, the coordination between multiple agents.
  • The production envelope — durability, observability, guardrails, governance. The unglamorous layer where most projects actually live or die.

Hold those six in your head. Everything that follows hangs off them.