An agent loop is powerful, and it is also expensive: every tool call is a round trip, and every loop needs a budget, a stop condition and error handling. A single prompt is cheaper and simpler, and it is enough when the answer can be worked out from the prompt alone. Choose by counting what the task needs that the prompt does not already contain.
Prerequisites
- The task, written in one sentence.
- A list of the facts the task needs, and where each one lives.
- A note of the cost of a wrong answer for this task.
Steps
Step 1: Count the unknowns
List the facts the task needs that are not in the prompt: a stock level, a price, a record. If the list is empty, a single prompt can answer; if it has items, something must fetch them, and that something is a tool.
Step 2: Count the steps
Count the steps the task needs: one lookup, or a lookup then a calculation then a message. One step fits a single function call; several dependent steps fit a loop.
Step 3: Pick the simpler tool
Pick a single prompt when there are no unknowns and one step, and an agent loop when there are unknowns or several steps. If both would work, pick the single prompt: simpler is better until the task proves otherwise.
Worked example: Northgate Clinic two tasks
The fictional Northgate Clinic compares two tasks: writing a reminder from a known template, and finding a free appointment slot.
| Task | Unknowns | Steps | Choice |
|---|---|---|---|
| Write a reminder from a template | None | 1 | Single prompt |
| Find a free slot next Tuesday | The diary | 2: check diary, then book | Agent loop |
The reminder has no unknowns and 1 step, so it takes a single prompt, and the slot search needs the diary and 2 steps, so it takes an agent loop.
Expected result. Each task has a written choice with the unknown count and step count behind it. UNTESTED: this guide was not run against a live model or API. The worked example below is fictional practice material, and its result is the expected result, not a measured one.
Limits
- A task that looks single-step can grow unknowns as it runs; re-check the choice when it does.
- An agent loop is not a substitute for a missing fact; if the data does not exist, no loop will find it.
- This guide does not cover cost; an agent loop costs more per task than a single prompt.
