Home Article List

Scored Confidence Agent Workflows in the Decision-Making Process

Shortly before Jev was announced and released publicly, I began working on a project at American Sound that involved a very similar approach to language model applications. Now that the hype has gotten quieter surrounding Jev and decision-based models as a whole, I would like to talk about how you can use any language model (generative or discriminative) with Swamp Club’s Swamp to the same effect.

A Difficult Problem Solved by Decision Making as Classification

There is a famous IBM quote from the late 1970s that has been going around quite a lot recently:

“A COMPUTER CAN NEVER BE HELD ACCOUNTABLE, THEREFORE A COMPUTER MUST NEVER MAKE A MANAGEMENT DECISION.”

If you’ve been on LinkedIn at all in the last three years, you’re probably sick of hearing about that quote. The point it is making is clear: computers are historically (at the very least up to the point of LLMs) unsuitable for consistent, confident, and intelligent decision making. In situations where the stakes require accountability for a failure to execute such a role, computers are simply unfit.

Human-in-the-loop is an increasingly popular approach to the use of LLMs as a whole. In any process where decision making is necessary, keeping a human in the loop to manage and review agent output and behavior is a naturally appealing safeguard against mistakes with nobody to blame. In practice, it can be unclear exactly which decisions qualify, especially when domain knowledge no longer gates much of the idea-to-result pipeline in entire fields such as computer programming. The idea of where this line is drawn is currently contested in tense discourse.

LLMs in particular can be difficult to argue as strong candidates for assistance in the decision-making process. They are, at the end of the day, predicting the next character in a sequence of characters. No matter how impressive (or frightening) the naturally forming reasoning behavior of their networks gets, they are largely unpredictable by nature. At best, you can think of a task and say, “Yeah, a language model should get this right most of the time.” You have to admit, never before has industrial or academic science been so forgiving of something that is usually right.

So, where do we draw this line? Some will tell you that the line doesn’t exist, and I mean that in both ways that it could be taken. I think most people are tired of hearing about opinions from either of those groups. As for the rest of us, across the entire spectrum of expertise, we tend to draw the line somewhere around the ability to write code. When it comes to what decisions are required to write instructions for a deterministic computer to interpret, I believe the majority of us in tech think computers are or are not “capable enough” somewhere in that region.

It is here that I propose using the machines in their capacity below that line in order to maximize the benefits of using that machine. If our line is high enough to the point that some of our cognitive load is outsourced to a machine (in our case, a language model), I believe there is still plenty of benefit to be had. I understand that there are still complex ethical considerations to be made here, and for those I do not yet have an answer that satisfies my own apprehensions. To that end, I leave that discussion to the more qualified to speak on it until I am comfortable doing so myself.

I think that, regardless of how capable you believe machines are when it comes to decision making, most reasonable professionals could agree that executive decisions are somewhere well above that line. But what about classification decisions? When deciding how to classify an entity, humans take note of various features (both qualitative and quantitative) of the subject to aid them in this decision.

Now think to yourself, how often do you perform a task at work that involves making some sort of high-level classification based on textual details of the thing that you are classifying? How often do you categorize an email based on sender, subject, body, or attachments? How often do you enter a product name into one database line item or another based on a serial number? Without allowing a machine to take action, we can still take advantage of the classification decisions made before an executive decision is necessary.

Classification Criteria and Confidence Scoring

We now have an idea of what kinds of decisions we are comfortable with LLM agents making. Now, it is time to analyze an existing human process and identify which of those decisions are:

  1. Classification decisions appropriate for an LLM to make, and
  2. Based on finite, accessible, and reliable criteria that we can feed into an agent workflow.

This is the concept that Jev and other decision-based models seek to expand on. Given a set of criteria for a textual representation of an entity, what qualities and/or quantities are present in that text that qualify it for a specific class or category? What sender, subject, body, or attachments lead you to tag an email as “Important”, “Promotional”, or “Spam”? These criteria and the associated categories are your input and output respectively, and current language models are perfectly capable of deciding on what observations constitute a specific classification, even if that decision is a guess.

In a reliable system, this guess is finalized by a scored confidence produced not by the LLM, but by a deterministic system that scores the classification based on the criteria. This confidence score is then gated by another deterministic system before being presented as a decision on classification. This allows us to integrate a human-in-the-loop verification step, which could be made easier by presenting the user with the evidence on which the decision was made as well as a list of criteria met or unmet.

Returning to the email inbox example, let’s expand on the criteria we have selected thus far.

This is just a mere subset of the things you consider when deciding how to categorize an email. You’ll notice that all of these questions are answered with a boolean or numeric response; in other words, they ask yes-or-no or “how many”. That is because such outputs are ideal forms of data to feed into a deterministic script for scoring against criteria. Consider the following proposal of a system to automate such a process:

First, scripts gather all information available when parsing the text. In other words, they answer the “easy” questions. Anything that requires “intelligent” natural language processing, such as determining urgency, is left to an LLM to determine. These answers are then fed to a scorer in the form of structured data, and the scorer makes a classification decision based on criteria. Finally, the system presents that classification to a human user alongside evidence. The human has the vital role of gating executive decisions behind their review of the provided evidence.

Swamp

This system is similar (though watered down heavily) to something I built at work as part of automation efforts. To do this, I used Swamp, an automation software suite built around the idea of creating deterministic operational workflows with scripts and infrastructure, and then having an agent act on instruction indirectly through calling the Swamp tools. It is an attempt at solving many of the problems associated with unpredictable and token-hungry agent workflows, and in my experience, one that is quite effective at what it is trying to do.

In my system and the email organization system example that we have used so far, Swamp serves as a form of “pipeline engine”. Fetching and formatting email contents, downloading and parsing attachments, and all other tasks best suited for a deterministic script are handled by Swamp. It allows me to easily set up scheduled and/or triggered automation events, such as scanning the inbox overnight or when I click a “refresh” button on a dashboard. Feeding that data to an LLM agent, providing instructions on analyzing that data, and then parsing that data into a structured format is also performed by Swamp. Finally, the analysis of the data against strict criteria and the presentation of the result to the user is, once again, another step handled completely by Swamp.

Swamp comes with so much more than just deterministic scripting. Encryption of security keys and API tokens is provided out of the box with Swamp and its server component, providing a true one-stop-shop for the entire workflow and design process. As you build your system, you can ensure that a roaming agent does not compromise your secrets or environment variables, and this is exactly what I did with my model and database API keys, as well as my IaaS secrets.

No, I am not being paid by Swamp Club to glaze them. The product is simply amazing and an example of AI as a service done properly. It’s only right that I give them a much-needed shout-out from my humble little website, as they are building something truly incredible over there.

Closing Thoughts

The hype surrounding Jev and the copycat products that followed was inevitable. The fact is, a lot of people were already doing something similar. I certainly was, and I was doing it with Claude and a really awesome third-party suite of automation tools. I believe that leveraging LLMs within their capacity with all the skepticism that they deserve is what will allow us to get the most possible value out of the technology. Building processes and tools around this skepticism is quickly becoming a superpower, and more people are noticing it by the day. Sure, in just a few years or less, we may achieve systems so intelligent that such a ruthless, scrutinizing approach to AI is not entirely necessary. I’m not going to sit here and claim that’s impossible, because I don’t know that it is. With that being said, if that were the case, then there would be no point in trying to think about how things will be after we get there.