Objective
The existing decision model, “Patient Therapy,” determines an appropriate therapy for patients with Acute Sinusitis. We now aim to extend this capability by building an interactive doctor assistant (AI agent) that leverages an LLM to support plain-English dialogue with physicians.
This AI agent will help determine the most suitable therapy based on individual patient characteristics. Importantly, we want this AI agent to rely on the same underlying business logic described here, rather than general knowledge from the LLM.
Business Logic
We want our AI agent to use 4 different decision services deployed as loosely-coupled decision services, e.g., as AWS Lambda functions. Here they are:
- Determine Medication
- Determine Dosing
- Calculate Creatinine Clearance
- Check Drug Interaction.
We described the business rules for each of these 4 services in the proper sub-folders of the folder “Repository”. We can test and deploy each of them from the folder “Projects”.
Here is the business logic for “Determine Medication“:

Here is the business logic for “Determine Dosing“:

Here is the business logic for “Calculate Creatinine Clearance“:

Here is the business logic for “Check Drug Interaction“:


The last decision table iterates over all drug incompatibility records in the file “ConflictingMedications.csv” that look as follows:

Creating AI Agent Prompts
We asked LLM to create the agent prompts in the MD format using a link to this webpage. Here are the results:

