Not Everything Needs an Agent: Models, Solvers, and the Case for Deterministic Building Blocks
How to decide when a problem needs generative AI, when it needs mathematical optimization, and when a Lambda function and a Step Functions state machine are all you ever needed.
There is a pattern I keep seeing in customer conversations: a team has a business problem, and the first question on the table is "which model should we use?" Sometimes that is the right question. But often the problem is not a prediction problem or a language problem at all. It is a decision problem with hard constraints, or a workflow problem with well-defined steps. Reaching for an LLM or an agentic framework in those cases does not just add cost; it adds non-determinism exactly where the business needs guarantees.
This post is about three different kinds of tools that get lumped together under "AI," and how to pick between them:
1. Models, which predict or generate
2. Solvers, which decide under constraints
3. Deterministic primitives, which execute reliably (AWS Lambda, AWS Step Functions, Amazon EventBridge)
Most real systems need all three. The failure mode is using one where another belongs.
Models predict. Solvers decide.
A model, whether it is a demand forecasting model on Amazon SageMaker AI or a large language model on Amazon Bedrock, is fundamentally a pattern machine. You give it inputs, it gives you a probabilistic output. A forecast. A classification. A paragraph of text. Models are extraordinary at problems where the answer is fuzzy, the input space is messy, and "approximately right most of the time" creates enormous value.
A solver is a different animal entirely. Linear programming (LP) and mixed-integer programming (MIP) solvers take an objective function ("maximize expected revenue") and a set of constraints ("no store receives more than its capacity," "don't break case-pack sizes," "respect the DC's outbound limit") and find the provably optimal answer. Not a likely answer. Not a plausible answer. The mathematically best feasible answer, every single time, given the same inputs.
That distinction matters enormously in domains like supply chain, logistics, scheduling, and pricing:
| Model | Solver |
|---|---|---|
Output | Probabilistic
prediction | Deterministic optimal
decision |
Same input, same output? | Not necessarily (LLMs especially) | Yes, always |
Handles
hard constraints? | No, it can only be
nudged | Yes, constraints are
the contract |
Explains itself? | Post-hoc, approximate | Duals, shadow prices, slack: built into the math |
Good at | Fuzzy inputs,
language, patterns | Allocation, routing,
scheduling, resource decisions |
If your business problem sounds like "distribute a limited resource across competing demands without violating rules," you have a solver problem. Asking an LLM to allocate inventory across 3,000 stores is not just expensive. It will hallucinate an answer that violates capacity constraints, and it will do so confidently. Meanwhile a MIP solver will hand you the optimal allocation and tell you exactly which constraints were binding.
The beautiful part: the two compose. A very common production architecture is forecast with a model, decide with a solver. The demand forecast (probabilistic, ML) becomes an input to the optimization (deterministic, mathematical). Each tool does what it is actually good at.
Where agents actually earn their keep
Agentic AI is genuinely transformative for a specific class of problem: tasks that require dynamic, multi-step reasoning over an unpredictable input space. An agent shines when:
- The user's request arrives in natural language and could mean many different things
- The path to the answer is not known in advance (which data to query, which tool to call, in what order)
- The output needs to be synthesized into human-readable explanation
Interpreting a question like "why did the Northeast region get shorted last week?" requires figuring out that the answer involves querying allocation results, joining constraint metadata, and translating shadow prices into business language. That is agent territory. No amount of if/else statements handles the long tail of ways a human can phrase a question.
But notice what the agent is doing in that example: it is interpreting and explaining. It is not making the allocation decision. The solver already made the decision, deterministically. The agent is a translation layer between the mathematics and the human.
The quiet workhorses: Lambda and Step Functions
Here is the part that gets skipped in the AI-first era: a huge fraction of "we need an agent for this" requests are actually well-defined workflows. Known steps, known branching logic, known failure modes. That is not an agent problem. That is an AWS Step Functions problem.
Consider a nightly optimization pipeline:
1. Ingest sales and inventory data
2. Run the demand forecast
3. Feed forecasts into the solver
4. Validate solver output against business rules
5. Publish allocations and notify downstream systems
Every step is deterministic. The orchestration logic is knowable in advance. Building this with Step Functions gives you:
- Determinism: the same input takes the same path, every run
- Auditability: every state transition is recorded, and compliance teams can replay history
- Cost: state transitions cost fractions of a cent, while an agentic loop making LLM calls to decide "what to do next" costs orders of magnitude more, per run, forever
- Failure handling: retries, backoff, and catch states are declarative, not prompt-engineered
An LLM deciding your orchestration path is paying token costs to reproduce, unreliably, what a state machine does for free. If you can draw your workflow on a whiteboard as boxes and arrows, build the boxes and arrows.
The same logic applies at smaller scale. Request routing, data validation, CRUD APIs, and scheduled jobs are handled by Lambda functions and EventBridge rules with millisecond latency and no hallucination risk. A regex-based classifier in a Lambda that routes obvious requests costs $0 and responds instantly. Reserve the LLM call for requests that genuinely require reasoning.
A decision framework
When a new problem lands on your desk, walk it through these questions in order:
1. Are the steps known in advance? If yes, use Step Functions, Lambda, and EventBridge. Done. Don't feel bad about it. Boring is a feature in production.
2. Is it a constrained decision problem? Limited resources, competing demands, hard rules that cannot be violated? Use a solver (LP/MIP). Run it on AWS Batch or Amazon ECS, and orchestrate it with Step Functions.
3. Is it a prediction problem? Forecasting, classification, or anomaly detection over structured data? Use classical ML on SageMaker AI. You usually don't need generative AI to predict next week's demand.
4. Does it require understanding or generating language, or dynamic multi-step reasoning over ambiguous input? Only now reach for an LLM on Bedrock. And only now consider whether the task needs a full agent with tools, or a single well-crafted model invocation.
5. Hybrid? Almost always. The strongest production systems layer these: deterministic orchestration on the outside, solvers and models as steps in the middle, and an agent at the human boundary where ambiguity lives.
The trust dividend
There is one more reason to keep deterministic components deterministic, and it is the one that matters most in enterprise settings: trust.
When a planner asks "why did the system do that?", a solver-based system has a real answer: these constraints were binding, this was the objective, here is the proof of optimality. A Step Functions execution has a real answer: here is the exact path the workflow took, timestamped. A pure LLM decision has, at best, a plausible-sounding rationalization generated after the fact.
Business stakeholders do not distrust AI because it is new. They distrust systems that cannot account for their own behavior. Every component you keep deterministic is a component you can defend in a room full of skeptical operators. Ironically, that is what buys you permission to deploy generative AI where it genuinely belongs.
Takeaways
- Models predict, solvers decide, primitives execute. These are different jobs. Match the tool to the job.
- If the workflow is knowable in advance, use Step Functions and Lambda. Determinism, auditability, and near-zero cost are features you cannot prompt-engineer.
- If the problem has hard constraints and an objective, use a mathematical solver. An optimal, explainable answer beats a plausible one.
- Use LLMs and agents at the boundary where ambiguity lives: natural language in, human explanation out, dynamic tool use in between.
- The best architectures are hybrids, and the deterministic parts are what make the AI parts trustworthy.
The next time someone asks "which model should we use?", it is worth asking a prior question: does this need a model at all? Sometimes the most sophisticated architectural decision is a Lambda function.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article