In a previous post, From Chat to Decision: Building an AI Assistant with SAS Intelligent Decisioning and Azure, we demonstrated how to combine conversational AI with decision-making logic to calculate customer risk scores. This post dives deeper into the mechanics of that solution, showing how SAS Intelligent Decisioning, Azure OpenAI, and Azure Logic Apps work together to deliver intelligent, automated decisions.
The AI assistant collects user inputs, such as demographic and financial data, processes them via an Azure Logic app, and sends a scoring request to the decision logic deployed in an Azure Container Instance (ACI). This decision logic calculates the risk score, which is then returned to the AI assistant in a user-friendly format.
Here’s how the components interact in this solution:
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
This solution brings several innovations to the table:
Start by building the decision logic that calculates the risk score. Notice the expected inputs and the returned outputs:
To publish the decision logic for deployment:
Once the Docker image is in the ACR:
To test the container, you can use the following curl command:
curl --location --request POST "http://${CONT}.${LOCATION}.azurecontainer.io:8080/${IMAGE}" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{"inputs" : [{"name": "age", "value" : 30}, {"name": "credit_score", "value" : 720}, {"name": "dti", "value": 40}, {"name": "employment_status", "value": "full-time"}, {"name": "income", "value" : 45000} ] }'
Azure Logic Apps bridge the gap between the assistant and the decision logic. Here's how to set it up:
Configure the Logic App to trigger on an HTTP request. The request body should adhere to a specific JSON schema, which includes user inputs such as age, employment status, income, credit score, and DTI.
In Azure AI Foundry, when you attach to the AI assistant the Azure Logic App as a function:
A JSON schema is generated:
When the Logic app receives a JSON payload that adheres to that schema, the rest of the logic is triggered.
Send a POST request to the container endpoint using the JSON payload.
Use a predefined schema to parse the JSON response from the container.
Extract the variables from the array and convert to a CSV format for readability.
Send the processed response back to the AI assistant.
Sample Instructions for the Assistant:
You are an AI assistant that helps people calculate risk rating depending on inputs. Greet with: 'Hi, I can calculate your risk rating. For a precise calculation, I am going to need some inputs.'
You will need some inputs for the calculation.
Ask each person the following: 'What is your age?', 'What is your employment status? (choose only from this list: "unemployed", "part-time", "full-time")',
'What is your yearly income?', 'What is your current credit score?', 'What is your debt to income ratio or 'DTI'?
Collect those values, keep track of the value you collected or not.
Pass the collected values to the __ALA__sas-decisioning function.
The function returns a csv table. Extract risk_rating (a string) from the raw csv table outputs.
Provide a text with the calculated risk_rating. Provide additional data used for risk calculation, if asked.
Answer with a message: 'Based on the inputs you provided, SAS Intelligent Decisioning calculated your risk rating: …'
If the question is not related to a risk rating calculation say: "Please contact your Credit Officer. I do not have knowledge of what you are asking, or I am not authorized to respond."
The assistant is programmed with instruction-based prompt engineering to ensure it gathers all required inputs systematically. It integrates with the Logic App via a function (e.g., __ALA__sas-decisioning) that passes the inputs to the container instance and processes the results.
The instructions are an example of instruction-based prompt engineering, ensuring the assistant operates within a predefined domain and delivers accurate, task-specific responses while avoiding ambiguity or scope creep. It uses:
Before deploying the solution in production, test it end-to-end:
{
"parameters": {
"properties": {
"age": 30,
"employment_status": "full-time",
"income": 45000,
"credit_score": 720,
"dti": 40
}
}
}
Example Response:
"Based on the inputs you provided, SAS Intelligent Decisioning calculated your risk rating: Low Risk."
Ask details about the calculation: "Explain how you calculated my Low Risk. What is behind?"
This post has shown how to:
By adopting a similar approach, businesses can deliver personalized, decision-driven insights at scale. Whether for financial risk assessment or other domains, this solution demonstrates how conversational AI can be combined with powerful decision-making tools to create intelligent, automated workflows.
Video demonstrating the approach:
I was inspired by the following resources:
If you liked the post, give it a thumbs up! Please comment and tell us what you think about the AI Decisioning Assistant. For further guidance, reach out for assistance. Let us know how this solution works for you!
Find more articles from SAS Global Enablement and Learning here.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.