One AI workflow, two versions, and the catch
Text on screen
The benefits of redesigning an agentic workflow with decision models. An example from a real-world application. Two pairs of bars, time and cost: V1 100%, V2 minus 89% on time and minus 96% on cost.
V1: the old design, based on language models. V2: the new design, combining decision models.
Calls to a model, one night. V1: 343 to a language model. V2: 991 to Jev, a decision model, and 30 to a language model. (The numbers count up.)
Eight steps, both versions. Eight steps. What changed is who does each one. A table of the steps: Keep it or drop it? Which topic? Same story as another? How important? Pick the top ones. Final check. Tag it. Write it up.
Step 1 of 8. Keep it or drop it? One real item from that night. Which version answers first? The item: "US Military had close call after using AI for hallucinated intelligence report".
Step 1, V1, a language model, answered: keep, reliability-assurance, plus a written reason: "Documented case of military relying on AI-hallucinated intelligence report demonstrates urgent risk in high-stakes deployments…" Its batch: 228 items, 40 to a call. 105 s until the step was done for every item.
Step 1, V2, Jev, a decision model, answered, and how sure. In the remit? Direct 0.65, indirect 0.35, none 0.00. How sure: 0.47, not certain. 35 s until the step was done for every item.
Step 2 of 8. Which topic? V1: no step of its own. The keep-or-drop answer also named a theme. This item: reliability-assurance. V2: its own question: Jev picks one of five shelves. Under 0.85 sure, it goes to Other. This item: reliability-assurance, 0.97, how sure 0.96.
Step 3 of 8. Same story as another? V1: not run. Its topic dedup had been off since 25 Aug. V2, code, then Jev: code proposes pairs of items; Jev confirms each merge. That night: 9 calls to Jev.
Step 4 of 8. How important? The same item, scored. Which version is done first? V1, a language model, reading item by item: 9 of 10, plus a written summary: "A CNN investigation reports that a hallucinated AI-generated intelligence report nearly triggered a US military operation against a Chinese ship…" 345 s. V2, Jev: relevance 6.7, 6.2, 6.6; urgency 7.3; must not miss 0.71; top of its shelf 0.67; kind: incident. 10 s.
Step 5 of 8. Pick the top ones. V1, a language model: 92 rounds of a language model, comparing items in small groups. A tournament, 92 rounds; this item: first of 120; 162 s until the cut was made. V2, code, no model: one sort by score, one cut. No model. Top 4 per shelf; by score, this item: second on its shelf; 2.3 s for all its code steps together.
Steps 6 and 7 of 8. Final check: V1 asked a language model: publish or refuse. V2 moved that judgement into keep-or-drop and pick-the-top. Tag it: new in V2: Jev labels each pick with its form, evidence and horizon.
Step 8 of 8. Write it up. What each version handed over. V1, a language model: 5 articles, their headlines listed. V2, Jev, and a small writer: 16 lines, 4 shelves. This item's line: "A US military analyst's chatbot hallucinated a Chinese ship's cargo as nuclear components, nearly triggering an armed intercept…"
One night, in total. V2 against V1, the same items. Time: minus 89%. Cost: minus 96%.
See the radar: radar.bcoelho.com. Jev Confidence Explained: What a decision model is, in a minute. Like this item's answer at the gate: direct 0.65, indirect 0.35, none 0.00; 0.47, how sure. bracoelho.github.io/jev-explainer
Same night. Same news. A new design. Using decision models meant redesigning the workflow, step by step.
Want to save costs by redesigning your agentic workflows? Reach out.
Under each step, three running meters compare the two versions: time (it ends at 12.4 min for V1 and 83 s for V2), tokens (787k and 1.68M) and cost (shown as bars only, ending on "96% less"). During the timed steps a note reads "Clock runs 13× fast", then 34× and 27×.
Decision Models. I ran 2 versions of my Agentic AI radar workflow. V1 took 12 min, V2 took 89% less, with an amazing 96% cost reduction... hold on, there is a catch.
Applying decision models in an agentic workflow is more than simply replacing the language models. With decision models you can break down complex decisions into a series of questions, leading to a set of simpler logic decisions where you are aware of the risk of making a decision.
In addition, it is about stepping back and asking what we want to achieve, and what risk we are willing to accept.
V2 asks Jev, the original decision model from TypeSafe AI, and every answer comes back with how sure it is.
The twist: V2 read about 2x as many tokens... the cost? 96% less!
I dare to ask:
When did you ever have at your disposal a new technology that can save more than 90% of your existing token costs, doing the same jobs within a bounded risk?
My Point of view:
To get the most from the new decision models, resist the temptation to replace language models with decision models. What you need is a new design, with its own best practices.
Question for your board:
Do we have a proven approach to redesign our agentic workflows using decision models?
Question to all:
What is your experience using decision models?
Want to save costs by redesigning your agentic workflows? Reach out.
See my AI radar: https://radar.bcoelho.com
Try the Jev explainer, free, independent, and not affiliated with TypeSafe: https://bracoelho.github.io/jev-explainer/
Drafted with AI agents I built, run and tune, following my editorial guidelines. I reviewed, edited, and approved.
#AIEngineering