Low-Code AI Agent for Classifying User Support Tickets With OpenAI and Kumologica
This article discusses the design and implementation of an intelligent case classification scenario using an AI agent in Kumologica and the OpenAI platform.
Join the DZone community and get the full member experience.
Join For FreeThis article will demonstrate how Kumologica and OpenAI can assist in developing an AI agent API that efficiently classifies cases within an enterprise using user data, without the need for customer support agent intervention. An ideal case management solution should be able to automatically categorize and prioritize cases from various channels, identify high-priority cases, apply labels, and assign them to the appropriate groups without requiring agents to manually perform these tasks.
There are several case management products currently available on the market, such as ServiceNow, JIRA, and Salesforce Case Management. While some of these products include built-in solutions for ticket classification, others offer no such functionality. Even for those with built-in solutions, there are limitations in their ability to integrate with third-party systems.
Use Case
In this scenario, an ABC enterprise handles both IT and non-IT issues through an enterprise portal. Users provide key details, such as the issue title, description, and the relevant department (infrastructure, networking, CRM, etc.), where the issue should be submitted. Once the user completes these details, the case is submitted and enters a queue for a support agent to review. The agent then retrieves the ticket from the queue, reviews the information, and manually creates a ticket within the case management system. Below Fig 1 provides the representation of the existing case creation process in ABC enterprise.
Design
New Architecture
The architecture team has proposed a new design to address delays in ticket processing and enhance the efficiency of the ticketing system. They identified that a significant portion of the delay is caused by the manual process where support agents read, understand, and classify tickets into the correct department within the case management platform.
According to the new design, there will no longer be any manual intervention between the user's case submission on the enterprise portal and the case management platform. The enterprise portal will be directly integrated with the case management platform through an intelligent case classification AI agent service. This agent will automatically interpret the user-provided details, categorize the ticket to the appropriate department, and assign the correct labels, tags, and projects within the case management system.
Technical Design
In the new design, an API-based AI agent service will be developed to integrate the enterprise portal with the case management platform. This service will accept requests from the enterprise portal, extract the description details, and pass them to an artificial intelligence provider for classification. The AI will then return the necessary data to create the case within the case management platform. Kumologica will be used as the integration framework to build the AI agent in a low code fashion, utilizing the OpenAI node to connect with OpenAI for intelligent classification.
Implementation
Prerequisite
1. Download and install Kumologica designer.
npm i @kumologica/sdk
3. Install OpenAI node in the Kumologica project package.
npm i @kumologica/kumologica-contrib-openai
2. OpenAI account access and token for accessing OpenAI platform.
Steps
Now we will start the implementation of smartcase classifier service in Kumologica. For those who are new to Kumologica, you can refer the following tutorial link to get started.
- Open the Kumologica Designer, drag and drop the EventListner node from pallet to the canvas. Provide the following config for the node.
Display Name : [POST] /case/create
Provider : AWS
EventSource : Amazon API gateway
Verb : POST
URL : /case/create
Note: The article is taking the assumption that ABC enterprise is having AWS cloud infrastructure.
2. Drag and drop Logger and wire it to the EventListener node added in step one. Provide the following config for Logger.
Display Name : Log Entry
Level : INFO
Message : 'Request recevied : ' & msg.payload
Log format : String
3. Add two set property node to the canvas and provide the following config. This is to extract the request data and to set the rules for classifying the case.
Set-Property 1
Display Name : Set Case Data
Operation : Set
Target : msg.description
Source : msg.payload.description
Operation : Set
Target : msg.title
Source : msg.payload.title
Set-Property 2
Display Name : Set Case Data
Operation : Set
Target : msg.rule
Source : "if the description contains anything related to cloud, AWS, Azure, Sharepoint then provide the following JSON. label depends on if its AWS , Azure, Sharepoint etc.
Description sttribute in JSON will be the original description from user.
{"Department" : "Infra-support", "Project" : "INF", "Label" : "AWS", "Description" : "" }
if the description contains anything related to network then provide the following JSON.
Description sttribute in JSON will be the original description from user.
{"Department" : "Network-support", "Project" : "NET", "Label" : "Networking", "Description" : "" }"
4. Now add the OpenAI node from the pallet and provide the following config. Then wire the node to the set property node in step 3.
Display Name : OpenAI
Operation : Single Q&A
Model : gpt-4o-mini
API Key : <<API key from OpenAI>>
System : msg.rule
User : msg.description
5. Finally we will be ending the flow with the response in EventListener End node.
Display Name : Success
Response : HTTP Response
Status Code : 200
Payload : msg.payload
The final flow will look like the image below.
Try It
The above flow can be invoked by using the below endpoint locally.
Endpoint : http://localhost:1880/case/create
Method : POST
Content-Type : application/json
Body : {
"title" : "Issue in with account access",
"description" : "Request for providing the access the AWS dynamoDB in non prod account"
}
You will be getting the below as the response. The response shows that the AI has classified the department, project, label based on the user description.
{"Department" : "Infra-support", "Project" : "INF", "Label" : "AWS", "Description" : "Request for providing the access the AWS dynamoDB in non prod account"}
Conclusion
While integrating Kumologica and OpenAI for case classification offers a promising solution to streamline case management, there are also important considerations. The automation can greatly reduce delays and improve accuracy, but enterprises should carefully assess their existing infrastructure and potential integration challenges. Additionally, monitoring AI accuracy and ensuring proper oversight will be crucial for maintaining service quality. As with any AI implementation, ongoing optimization will be necessary to ensure that the system adapts to evolving business needs and changing case dynamics.
Opinions expressed by DZone contributors are their own.
Comments