Build an AI Recommendation Agent using the AI Skill-Execute action to analyze loan requests. The agent leverages the Auto Loan Assistant AI Skill, which uses guidelines from the attached PDF to access loan approval based on the applicant's income and requested loan amount.

Prerequisites

Create an AI Skill named - Auto Loan Assistant and use the following prompt, substituting the prompt for the one you used in the Create AI Skills.
You are an expert in auto loans and approving loans for individuals based on the size of the loan required to purchase the vehicle and their annual income as data points. 
You will have the following inputs to a loan approval request:

1. Size of Loan
2. Annual Income of Borrower

###RULES:
1. Use the Summit_Capital_Finance_Auto_Loans_Guidelines.pdf file located in your Files knowledge to thoroughly understand the relationship between the 
applicant's income, maximum monthly payment amounts, terms, and interest rates.

2. Use that knowledge to respond to the request with whether the loan request is approved or not based on the table of rules located in the loan guidelines document.

3. If approved, provide details of what is approved. Ensure the monthly payments for the term lengths do not exceed the borrowers Max % of Monthly Income. 
If they do, then do not present that term length and interest as an option to the user. 
Ensure a RISK value of High, Medium, or Low is also provided and use the Risk Conditions in the Summit_Capital_Finance_Auto_Loans_Guidelines.pdf document to 
make that determination. If denied, provide details of why the loan was declined as a denial reason.

4. Provide the following as outputs:
- Status: APPROVED OR DENIED are the ONLY valid values
- Table containing the following details
    > Approved Term lengths
    > Interest rate for each term
    > Calculated monthly payment for each term
- Risk: LOW, MEDIUM, OR HIGH are the ONLY valid values 


5. Provide ONLY JSON response to the user using the following structure:

{
   "status" : "approved",
   "denial reason":
   "terms" : [
      {
          "length" : "12 Months",
          "rate" : "7.45%",
         "payment" : "$1287.33"
      },
     {
          "length" : "24 Months",
          "rate" : "7.35%",
         "payment" : "$1012.02"
      },
     {
          "length" : "36 Months",
          "rate" : "7.25%",
         "payment" : "$842.66"
      }
    ],
    "risk" : "Medium"
}
6. DO NOT OUTPUT calculations or evaluation or other details of how the analysis was generated as the user does not need to know this. ONLY provide a JSON response of the table of terms, rates, and payments.


New Incoming Loan Request- Annual Income: $annualIncome$, Loan Amount Requested: $loanRequestedAmount$

Procedure

  1. Log in to your instance of the Automation Anywhere Control Room as a Bot Creator.
  2. Create a new API Task:
    1. From the left pane, click Automation.
    2. Click Create new > API Task.
    3. In the Create API Task window, enter the API Task name.
    4. Accept the default folder location: \Bots\.
      To change where your API Task is stored, click Choose and follow the prompts.
    5. Click Create & edit.
  3. Use the AI Skill-Execute action to execute the prompt. The AI Skill takes in two key variables as seen in the prompt: annualIncome and loanRequestedAmount, representing the applicant's annual income and the desired loan amount.
    AI Agent - AI recommendation agent
    Note: This is the prompt used in the prerequisites.

AI Skill utilization:
  • The agent leverages an AI Skill named Auto Loan Assistant designed to analyze loan requests based on specific guidelines and data.
  • This skill uses Retrieval Augmented Generation (RAG) by accessing a file named Summit_Capital_Finance_Auto_Loans_Guidelines.pdf.
  • This file, stored in the Control Room repository, contains rules defining the relationship between income, loan amount, terms, and interest rates.

  1. Map the automation's input variables (annualIncome andloanRequestedAmount) to the corresponding variables used in the AI Skill prompt ($Income$ and $Loan_Amount$).
  2. Save the response of the AI Skill and store it in a variable named ai_response.
    • The ai_response JSON is then fed into the automation actions to formulate a logic to decide on the application.
    • Here is a sample logic of how this application can be processed.
    Loan approval/denial logic:
    • The AI Skill processes the input variables and the loan guidelines to determine the loan's status (APPROVED or DENIED).
    • If approved, the AI Skill generates a JSON response including:
      • Approved term lengths: A table containing the approved loan durations (e.g., 12 Months, 24 Months).
      • Interest rate: The corresponding interest rate for each approved term length.
      • Calculated monthly payment: The calculated monthly payment for each term, ensuring it does not exceed the borrower's maximum allowable monthly payment based on their income.
      • Risk: A risk assessment (LOW, MEDIUM, or HIGH) assigned to the loan based on the analysis.

      JSON output: The agent is asked to output the loan decision and supporting details in a structured JSON format. This structured output is crucial for seamless integration with other systems and processes within the automation workflow.

      Post-processing:
      • After generating the recommendation, the automation processes the JSON output.
      • The automation extracts key information such as the loan status, risk level, and approved terms.
      • This information is then used to update records, trigger notifications, and begin subsequent steps in the workflow, such as assigning tasks to loan underwriters and notifying them via Microsoft Teams.

By accessing external knowledge sources and applying predefined rules, the AI Recommendation Agent efficiently automates auto loan evaluations and provides valuable insights to human decision-makers.