From Idea to Agent - Resources

Resource Page Link

This resource link is where you interact with the manual process, get your API key, and see the results of the agent in action.

https://pathfinder.automationanywhere.com/challenges/training/MHG/WorkerPortal.html

API Documentation Page Link

The resource below has all the API Documentation for this process.

View API Documentation (YAML)

1. Getting Next Work Item

Goal:

We need to gather the next work item from the My Work table and make it available to the agent or inform the agent there is no work to complete.

Inputs Required:

  • API_Key: This is the API Key to access the APIs for our work queue

Outputs Required:

  • Complaint_ID: This is the unique ID number for the complaint
  • Associated_Customer: This is the customer number associated with the complaint
  • Complaint_Text: This is the text body of the complaint
  • Date_of_Complaint: This is the date the complaint was filed
  • Error Message: If applicable, this is the error message from the API call
  • Tool Selected:

    API Task

    Relevant Endpoint:

    https://wmkjvdlsxeohfnsyftag.supabase.co/functions/v1/next-work-item

    Example Response Body:

    
    {
      {
        "item": {
          "Complaint ID": "0000458",
          "Associated Customer": "CUST123",
          "Complaint Text": "Product arrived damaged during shipping",
          "Date of Complaint": "2024-10-15",
          "Associated Product ID": "PROD001",
          "Customer Disposition": null,
          "Customer Assessment": null
        }
      }
    }

    Work Remaining:

    The 'GetNextWorkItem' API Task is already built and mostly complete. The only thing left to do are add the input and output variables and their descriptions and update the JSON mapping.

    The exercise is intended to explain the importance of identifying and describing input and output variables for an agent to be able to get the right context to start working.

  • 2. Complete the Sentiment Analysis AI Skill

    Goal:

    Assess the sentiment of the customer’s complaint text and classify it into one of the following categories: Happy, Neutral, Frustrated, or Hostile.

    Inputs Required:

    • EmailBody: The body of the email from the customer.

    Outputs Required:

    • ComplaintSentiment: The sentiment analysis result of the complaint

    Tool Selected:

    AI Skill (inside API Task)

    Prompt for AI Skill

    You are a complaint review specialist reviewing the sentiment of a customer complaint.  Examine the complaint text and determine which of the following four types it matches best.
    
    - Happy: Providing positive feedback about their experience.
    - Neutral: Noreal discernable positive or negative tone, simply stating facts or providing information.
    - Frustrated: Exasperated details highlight a pattern of issues.  This goes beyond just stating facts and moves towards a true negative tone and experience.
    - Hostile: Actively threatening.
    
    Return ONLY one of the 4 types with no other information,  markdown, or formatting.
    
    Complaint Text: $Complaint_Text$
    

    Work Remaining:

    You will need to create the AI Skill and API Task using the provided prompt. Name the AI Skill 'SentimentSkill' and the API Task 'SentimentAPITask'. Use the above goal for the description of this API Task tool. Grab a complaint text body from your worker portal and paste it in the default value for the variable.

    The exercise is intended to explain how to deal with unstructured data while still adhering to single responsibility principles and input and output design.

    3. Disposition Complaint

    Goal:

    Use an API call to disposition the current complaint.

    Inputs Required:

    • complaintID: This is the unique ID number for the complaint
    • customerDisposition: This is the disposition of the complaint.
    • customerAssessment: This is the assessment of the complaint sentiment.
    • API_Key: This is the API Key to access the APIs for our work queue

    Outputs Required:

  • Error Message: If applicable, this is the error message from the API call
  • Tool Selected:

    API Task

    Relevant Endpoint:

    https://wmkjvdlsxeohfnsyftag.supabase.co/functions/v1/disposition-complaint

    Example Request Body:

    {
      "complaintID": "0000458",
      "customerDisposition": "Resolved",
      "customerAssessment": "Happy"
    }

    Work Remaining:

    You will need to create the input variables paste the example in the customer parameters of the REST Web Services action. Replace the static values in the body with the variables you created. You will also need to explain the purpose of the tool to the agent.

    The exercise is intended to explain how to create the tool for an agent to take an action by describing its function.

    4. Update the Customer Investigations Agent

    Objective:

    We need to ensure all the tools are available to the agent and that it understands its assignment perfectly.

    Steps:

    1. 1. Open the Customer Investigations Agent in the parent folder.
    2. 2. Add a new tool by clicking the + sign and selecting API task. Browse to the SentimentAPITask API task in the tools folder. You will notice all the descriptions you created are already there.
    3. 3. Find the GetNextWorkItem tool in the Tools menu and press Refresh twice. This brings in the variables you created and their descriptions so the agent can understand them.
    4. 4. Repeat this for the SentimentAPITask API task.
    5. 5. Click on the Prompt tab.
    6. 6. The fields currently in here work perfectly already, and we can hit play and watch the agent work through all available complaints.
    7. 7. To see this in part of the tool in action, let's click on Generate and give it a brief description of its job. Make any edits you think are necessary, or put back back the original items from copying below.
    8. Role:
    9. You are a fraud investigator specializing in identifying and analyzing patterns of fraudulent customer complaints.
    10. Goal:
    11. Your goal is to assess customer complaints to determine their authenticity by analyzing complaint history, sentiment, and associated order data.
    12. Action Plan:
    13. # Assumptions
      - The customer has a history of complaints and orders available for analysis, otherwise they are "Customer Not Found"
      - Sentiment analysis and order history tools are accessible.
                    
      # Process
      1. Retrieve the next available complaint using the 'GetNextWorkItem' tool to gather the complaint ID, text, and associated customer ID.
      2. Use the 'GetCustomerComplaints' tool to retrieve the customer's historical complaints, including product details and dispositions.
      3. Analyze the sentiment of the current complaint using the 'SentimentAPITask' tool to determine emotional tone.
      4. Retrieve the customer's order history using the 'getorderHistory' tool, filtering by customer ID
      5. Use the 'CustomerDispositionBusinessRules' tool to apply business logic and determine the disposition of the complaint based on the customer's complaint and order history.
      6. Update the complaint status using the 'DispositionComplaint' tool, including the sentiment label and disposition decision.
      7. Document your work using the 'WorkDocumentation' tool by sending in the relevant items and allowing it to make them a comma separated string.
                   
      # Notes
      - Repeat this process until there is no more work to complete.  Once all work is completed successfully, you are finished.
      - When complete, output the completed work list object to the output variable CompletedWork.
      - Be diligent to map exact values throughout the process to avoid mistakes.
                    
    14. 9. Click run, and input your API Key from the worker portal.