Skip to content
AI Engineer Guide.

concept · concepts · intermediate · concept 24 of 37

Single-agent

0 of 37 complete

Why it matters

Every boundary in a system is a place where information is lost and a failure must be handled. A single agent avoids most of that: one prompt, one state, one trace. The discipline is to keep it single for as long as possible and to recognise the specific symptom that justifies splitting — tool selection errors, conflicting instruction sets, or a permission boundary.

Mental model

A single agent is a general practitioner with a full bag, not a hospital with departments. The metaphor breaks because a practitioner can refer a case onward, while the agent cannot refer unless you build the referral, so the cost of the split is hidden.

How it works

Two guards keep one agent; a third has to justify a splitInteractive

Keyed transitions

  1. Selects? → Fits?: accuracy holds
  2. Narrow → Selects?: retried
  3. Fits? → Stay single: fits
  4. Fits? → Distinct scope?: over cap
transitionfailurerepeat

Event · step 1 of 10

Single agent · 6 tools

Entry: one prompt, one context, six tools and a 4.1k-token prompt. This is the baseline, and any split has to beat it on success and cost rather than sound more capable.

In state

  • Single

Next: Toolset grows to 11

Tools
6
Agents
1
Prompt
4.1k
Step 1/10 · Single agent · 6 tools

Figure. Nine states. Per-tool selection accuracy decides whether the toolset is narrowed, and the prompt budget decides whether a split is even considered. A split then needs a distinct data or permission scope. Stay single and Split are both terminals; the red states are the page's failures, a selection collapse and a split no scope justified.

What to notice. The 12k window, the 0.9 per-tool threshold, the tool counts and the 14.2k prompt are illustrative. Staged prompts, one agent with several phases, are omitted: they change the prompt without adding an actor and share Stay single. Cost per task against the baseline is the comparison to run, not a state in the machine.

Text version

A state machine with nine states. Single is the start, a pill. Single goes to Selects, a hexagonal decision, when the toolset grows. Selects goes to Fits on accuracy holds, to Narrow on accuracy falls, and to Selection collapse, a red failure box, on still falls. Narrow has a repeat edge back to Selects labelled retried. Fits goes to Stay single, a terminal pill, when the prompt fits, and to Distinct scope on over cap. Distinct scope goes to Split, a terminal pill, on yes, and to Premature split, a red failure box, on no. The trace walks Single, Selects, Narrow, Selects, Fits, Stay single, then a second task at over cap, Distinct scope, Split, then Premature split. Counters show tools falling from 11 to 7, agents rising from 1 to 2 only at Split, and the prompt at 14.2k before the boundary question.

  1. Start with one agent, a small toolset and an explicit task description.
  2. Measure tool-selection accuracy and context size as the toolset grows.
  3. Group tools by permission and data access to see where a boundary would fall.
  4. Move a subtask out only when it has a distinct toolset or a context that cannot share the prompt.
  5. Keep the single-agent version as a baseline for cost and success comparisons.
  6. Document the justification for any split next to the code so it can be revisited.

Trade-offs

ChoiceGood forCostFails when
One agent, broad toolsetOne state and one traceTool confusion and prompt bloatTools exceed what one prompt can distinguish
One agent, narrow toolsetHigh selection accuracyCannot cover the whole taskThe task genuinely spans domains
One agent, staged promptsFocus per phase without new actorsPhase transitions are hand-codedPhases need different permissions
Split into several agentsIsolation and specialisationCoordination and boundary lossThe subtasks interact heavily
Trade-off mapInteractive

Good for

One state and one trace

Cost

Tool confusion and prompt bloat

Fails when

Tools exceed what one prompt can distinguish

  1. Tools exceed what one prompt can distinguish
  2. The task genuinely spans domains
  3. Phases need different permissions
  4. The subtasks interact heavily

Figure. Each choice with what it buys, what it costs, and the case where it loses.

What to notice. The fourth column is the decision: if the losing case describes your situation, the choice is wrong.

Text version

Four trade-offs: One agent, broad toolset is good for One state and one trace, costs Tool confusion and prompt bloat, and fails when Tools exceed what one prompt can distinguish. One agent, narrow toolset is good for High selection accuracy, costs Cannot cover the whole task, and fails when The task genuinely spans domains. One agent, staged prompts is good for Focus per phase without new actors, costs Phase transitions are hand-coded, and fails when Phases need different permissions. Split into several agents is good for Isolation and specialisation, costs Coordination and boundary loss, and fails when The subtasks interact heavily

Failure modes

  • Tool selection collapse. Accuracy drops as similar tools are added and calls go to the wrong one. Debug: measure per-tool precision from traces as the toolset grows.
  • Instruction conflict. Two roles in one prompt produce inconsistent behaviour. Debug: ablate one instruction block and compare outputs on a labelled set.
  • Premature split. A multi-agent version costs more with no success gain. Debug: run the same tasks against the single-agent baseline.

In production

Monitor tool-selection accuracy, prompt size and cost per task. Set a threshold at which the toolset is reviewed, rather than letting it grow until quality falls.

Common misconceptions

People think: Complex tasks require multiple agents.

Actually: Complexity is often handled by a longer loop and better tools; agent count is a separate decision.

People think: A single agent cannot be specialised.

Actually: Prompts, tool subsets and phases specialise behaviour without creating a second context.

Interview angle

Strong answers treat one agent as the baseline, name the measurement that would justify a split, and describe how the split's cost is bounded. Weak answers reach for multiple agents because the task sounds large.

Sources