A lot of decisions start with a conversation. Imagine an investment broker having a conversation with their client, asking about their goals, dreams and their current financial situation. Now there has to be a decision made based on the client's needs.
The broker now has two options, either they can start looking through the portfolio of investments blindly looking for something that would fit the clients profile, or they can start inputting the information into a form that would make the decision for them. With the advent of AI there is now a third option though.
In DecisionRules we have a lot of experience making decisions based on hard data. Forms filled, data received or databases extracted but making decisions based on a freeform text has always been a difficulty, until now.
Using an AI Agent Rule
We recently introduced a new type of rule called the AI Agent rule. This rule type allows you to connect your own AI agent and you can then use it to make decisions straight on a freeform text or use it to extract data from the text that you can then use for deterministic decision making.
AI Agent setup
To set up the rule you first need to connect your AI provider to DecisionRules, the tool has connectors prepared for most of the current models adding new ones each month, waiting only for your API key to be connected.
Then as with any rule, we need to tell the tool what data will come in the input and what will be the results of the execution. Very often the input can be just a JSON object with one property containing a transcript of a conversation.
You can then setup a prompt telling the AI what it should do with the text. For example in our broker example we might just receive the transcript of the broker-client conversation asking the AI to extract a few specific values from it, client’s income , their risk tolerance or their investment horizon.
In the last part of the setup we fill in the annotations, which are descriptions of the output properties that complete the prompt with descriptions of the output parameters, telling the AI what it should fill into the actual results of the rules. At this point we can also turn on the explainable feature giving us a predetermined part to the output with AI’s level of confidence in its results and some additional useful information like a reasoning for the actual decision , some warnings and a list of fragments of the input that were used as sources for the decision.
Using an AI Agent in the Recommendation Flow
The use of the AI agent aims to streamline the process of making the recommendation to the client, mainly taking away the tedious part of filling in a form and asking the client the same questions over and over again.
We do not want to delegate the whole decision to an AI, we only aim to use AI to fill in the data for us and filter the list of all the available investments in the portfolio.
In the actual decision flow we start with introducing the AI Agent to extract the data from the freeform conversation, at this point we also ask the AI to give a warning if there is not enough data in the conversation to fill in some of the fields, based on which we can give feedback to the broker with some additional questions to be asked.
Once we have all the data necessary we can isolate ourselves in the world of deterministic decisions and use regular decision tables and decision trees to filter the investment portfolio based on the data extracted.
The idea is that the deterministic part of the decisions will always make the same decision reliably and if there is something wrong the broker can use their expertise to check and update the extracted data.
AI extracts the client’s needs, deterministic rules identify eligible products, and the broker reviews the final recommendation.
Once we have made the deterministic decision, we can show the use of the AI agent in a bit of a different way, we already have all that we need for the decision, but we can now use the AI to give the broker a bit more direction.
The AI agent at the end of the flow has 2 jobs. Firstly they receive the list of deterministically chosen products and they write a few sentences, based on the description and conditions of the product, about why it was chosen.
Then the AI is prompted to take a look at the portfolio and identify additional products for the broker to review ( the recommendations are clearly divided between the deterministic and AI ). The AI decision can be very valuable to catch products that would be on the edge of being recommended , where they might seem like a good fit but maybe the investment horizon is a year off, this case would be discarded in the deterministic flow, but the AI can still bring it up and then it is up to the broker, whether or not it should be used.
Conclusion
We do not look at AI as something that would replace deterministic decisions, there is always a need for auditable and reliable results that do not drift over time and do not produce inconsistent results from one execution to another. No, we see it as a tool that can make the current processes more efficient and a tool that allows us to make decisions where it was not previously possible, of course we always need to be aware that using AI can produce unreliable results , but if we do not rely solely on it , we can shield ourselves from the consequences quite well.