AI agents: when should a decision use a model, and when should it use code?
A common AI architecture mistake is sending every step through a large language model. But an agent workflow often contains several different kinds of decisions:
- Fixed rules: Is the user authorized? Is this action within the spending limit? These should usually be enforced in application code.
- Open-ended reasoning: What does the user mean? How should several pieces of information be summarized? A general-purpose language model may be useful here.
- Bounded choices: Which known category fits this request? Which of these approved workflows should handle it? A structured decision model may be worth testing.
Example: a support-ticket agent
Consider a support-ticket agent. Code can enforce access controls. A language model can understand an unusual request and draft a response. A classifier or decision model can route common tickets to a queue.
The model should not be the only safeguard: validate its output, define a fallback for uncertain results, and require human approval for consequential actions.
Structured decisions and Jev
This is the technical question behind Jev, a model designed for structured decisions. Eduonix's Kickstarter campaign proposes a course on using Jev in application engineering, with tools such as Python and LangChain.
The outline is an interesting curriculum proposal, but it doesn't establish how well the finished lessons work. I'd look for sample code, a clear evaluation method, and a comparison against simple rules.
For a different learning angle, a Udemy course outline for building an agent with LangGraph describes constructing an agent loop in Python, then rebuilding it with a framework. Its listed topics include tool calling, memory, evaluation, and guardrails.
That makes it a useful syllabus to compare against a course focused on structured decisions; it isn't a like-for-like course comparison or a claim about either course's teaching quality.
How to evaluate a specialized decision model
A practical way to evaluate a specialized decision model is to:
- Define a narrow task, such as routing support tickets.
- Create representative examples, including ambiguous cases.
- Compare the model with a simple code-based baseline.
- Measure accuracy, latency, cost, and low-confidence behavior.
- Decide what the application should do when the model is uncertain or wrong.
The Jev campaign outline is the project description I reviewed - not a course I've completed.
Where do you draw the boundary between model decisions and application code in your own agent systems?
Comments
No comments yet. Start the discussion.