When to ship an agent, and when to just write SQL
A practical framework for choosing between LLM agents, deterministic automation, and simple queries.
TL;DR / Key Takeaways
- Start with the shape of the work, not the model.
- SQL is often the right answer when the data is structured and the rules are known.
- Agents are useful when a workflow needs tool choice, language reasoning, and bounded judgment.
- The best AI system still needs clear inputs, logging, review points, and handoff.
Most AI projects start with the wrong question: "Can we use an agent for this?"
The better question is simpler: what decision or action needs to happen, and how much uncertainty is involved?
Start with the shape of the work
If the work is mostly structured, repeatable, and based on data that already lives in a database, start with SQL. A clean query, scheduled job, or small dashboard often solves the problem faster than an agent.
Use deterministic automation when the steps are known but tedious. Examples include moving data between systems, validating form submissions, cleaning spreadsheets, or sending status updates.
Use an LLM when the input is messy, language-heavy, or requires judgment. That includes summarizing long documents, classifying inbound requests, drafting follow-up, or extracting fields from inconsistent text.
Agents need boundaries
An agent is useful when the system needs to choose between tools, inspect intermediate results, and work through ambiguity. That power comes with operational cost.
Before shipping an agent, define:
- The tools it can use
- The data it can see
- The actions it can take
- The points where a human reviews the output
- The logs your team will inspect when it fails
If you cannot describe those boundaries, you probably do not need an agent yet.
Practical checklist
- Write down the workflow in plain English.
- Identify which steps are deterministic.
- Identify where language, ambiguity, or judgment enters the process.
- Build the smallest reliable system first.
- Add AI only where it handles the messy part better than code.
FAQ
Should every automation use an agent?
No. Many business automations are better as scheduled jobs, API integrations, SQL models, or simple review queues.
Where does AI usually help first?
AI usually helps first with messy text, document extraction, classification, summaries, and drafts that a human reviews before action.
Related Reading
Related practical notes
Building a practical alerting system for Fivetran and dbt failures with AWS Lambda, DynamoDB, Teams, and Jira
A useful alerting system does not just say something broke. It knows whether the failure is new, whether it already alerted, whether it recovered, and when to create a ticket.
Read articleWhy AI projects need boring plumbing before they need agents
Most useful AI projects start with clean inputs, stable workflows, and reliable handoffs before anyone needs a complex agent.
Read articleClaude Code and Cursor for small business automation
How AI coding tools can help small teams build useful automations faster without turning the codebase into a pile of mystery scripts.
Read article