Module 1 Lesson 5: When You Should Not Use Agents
Avoiding the 'Everything is a Nail' trap. Understanding the cost, latency, and reliability trade-offs.
The "Agentic AI" Reality Check: When to Say No
When you have a hammer like LLMs, everything looks like a nail. But agents are expensive, slow, and unpredictable. Applying an agentic architecture to a problem that could be solved with three lines of Python is a major engineering failure.
Here is when you should AVOID agents.
1. High-Stability Workflows
If the task is strictly defined and never changes (e.g., calculating sales tax), use Code.
- Agent: Might decide to "research" the tax rate instead of using your local library, doubling the cost and potentially getting the number wrong.
- Code: Always correct, zero cost, sub-millisecond latency.
2. Low-Latency Requirements
Agents take time to "think." Every turn of an agent loop involves an API call to an LLM, which can take 1-5 seconds.
- Agent: Not for real-time gaming, high-frequency trading, or instant search suggestions.
- Rule of Thumb: If the result is needed in less than 500ms, an agent is not the solution.
3. Fixed Step Sequences
If a process always has the exact same 5 steps:
- Fetch User
- Fetch Order
- Compare IDs
- Update Database
- Send Email
Do NOT use an agent. Just write a function. Using an agent here is "Autonomy Theater"—you’re paying for a model to "decide" to do exactly what you already told it to do.
4. Sensitive Financial/Medical Actions
Unless you have a Human-in-the-Loop (see Module 3), do not let an autonomous agent move money or provide medical prescriptions. The risk of a "Hallucinated Action" is too high.
5. The "Over-Engineering" Checklist
Ask yourself these four questions before building an agent:
- Can I solve this with a Regex? (If yes, use a Regex).
- Can I solve this with a fixed Python script? (If yes, use a script).
- Is the path to the solution variable? (If no, use a script).
- Is the data format unpredictable? (If yes, this is a good candidate for an agent).
6. The Cost Comparison
| Factor | Script / Function | Agentic AI |
|---|---|---|
| Development Time | Low | High (Prompt tuning + testing) |
| Unit Cost | $0.0001 | $0.01 - $1.00+ |
| Reliability | 99.99% | 85% - 95% |
| Complexity | Linear | Exponential |
| dock |
7. Visualization: Script vs Agent Complexity
graph TD
subgraph "Script (Stable & Fast)"
A[Input] --> B[Step 1: Fetch]
B --> C[Step 2: Calculate]
C --> D[Step 3: Save]
D --> E[Output]
end
subgraph "Agent (Flexible but Expensive)"
F[Goal] --> G{LLM Plan}
G -->|Try 1| H[Tool Call A]
H --> I[Observe Result]
I --> G
G -->|Try 2| J[Tool Call B]
J --> K[Observe Result]
K --> G
G -->|Success| L[Final Output]
end
Key Takeaways
- Agents are for Unstructured inputs or Dynamic environments.
- Don't use an agent for a fixed-step workflow.
- Latency is a deal-breaker for many agent use cases.
- Cost scales with the number of "Thinking loops" the agent performs.
- When in doubt, start with simple code and only add agency when the code breaks.