Clients are the spine of any enterprise. Understanding buyer expertise is vital for each firm, and conducting buyer suggestions evaluation is all the time a significant device for elevating your model. On this article, we are going to discover how a man-made intelligence agent can be utilized to carry out buyer suggestions extraction and evaluation simply and effectively. We’ll construct the AI agent utilizing Kumologica, a low-code growth platform, and the Anthropic AI platform.
Use Case
ABC restaurant chain has determined so as to add a suggestions function to their menu and ordering cell app. Together with the traditional star ranking mannequin, they launched a easy free-text field permitting prospects to supply suggestions in their very own phrases. This affords extra flexibility for patrons to share detailed feedback. It permits administration to higher perceive buyer expectations.
Determine 1: Suggestions type (Picture source: writer)
Design
Primarily based on the use case, the client is given a easy type within the cell app with solely a free textual content subject and a ranking choice. The structure group determined to make use of a man-made intelligence platform to learn the consumer feedback, extract needed data, and analyze the sentiment. The extracted particulars, such because the menu merchandise, consumer suggestions, and related sentiment, might be saved for later retrieval and evaluation. The group will develop an AI agent utilizing Kumologica, join with Anthropic AI for extraction and evaluation, and retailer the info in AWS DynamoDB.
Determine 2: Structure diagram (Picture source: writer)
Primarily based on the design we might be growing an API with the POST
methodology and useful resource path as /buyer/suggestions
. The request to the API might be a JSON payload having two attributes; i.e., remark and ranking. The JSON payload is as follows.
{
"comment" : "",
"rating” : ""
}
The response from Anthropic AI might be as follows:
{
"feedback": "",
"item" : "",
"sentiment" : ""
"rating" : ""
}
These attributes might be saved in AWS DynamoDB.
Now let’s get began with the event of the API.
Implementation
Prerequisite
1. Obtain and set up Kumologica Designer.
2. Set up the OpenAI node within the Kumologica mission bundle.
npm i @kumologica/kumologica-contrib-anthropicai
3. AnthropicAI account entry and token for accessing the AnthropicAI platform
4. AWS account entry with entry key and secret having needed permission to attach and insert information into DynamoDB.
Steps
Now we are going to begin the implementation of the suggestions service in Kumologica.
Step 1
Open the Kumologica Designer. On the menu click on File > New Mission. It will open the next popup to supply the mission identify and file location to avoid wasting the mission.
Determine 3: New mission choice (Picture source: writer)
Step 2
Drag and drop the EventListener
node from the pallet to the canvas. Present the next config for the node.
Show Title : [POST] /buyer/suggestions
Supplier : AWS
EventSource : Amazon API gateway
Verb : POST
URL : /buyer/suggestions
The article takes the belief that ABC restaurant’s IT division has AWS cloud infrastructure.
Step 3
Drag and drop the Logger and wire it to the EventListener
node added in the 1st step. Present the next config for Logger.
Show Title : Log Entry
Stage : INFO
Message : 'Request recevied : ' & msg.payload
Log format : String
Step 4
Add two set property nodes to the canvas and supply the next config. The primary one is to extract the request information and the second is to set the foundations for extracting the remark to fields to retailer and analyze sentiment.
Set-Property 1
Show Title : Set Suggestions Knowledge
Operation : Set
Goal : msg.remark
Supply : msg.payload.remark
Operation : Set
Goal : msg.ranking
Supply : msg.payload.ranking
Set-Property 2
Show Title : Set Rule
Operation : Set
Goal : msg.rule
Supply : 'Primarily based on the suggestions given by the consumer extract the objects talked about, the remark in regards to the merchandise and supply the sentiment.' &'The extracted particulars to be responded within the following JSON format solely: { "item" : "" , "comment" :"" , "sentiment" : ""}'
5. Now add the AnthropicAI node from the pallet and supply the next config. Then wire the node to the set property node in step 4.
Show Title : AnthropicAI
Operation : Single Q&A
Mannequin : claude-3-sonnet-20240229
API Key : >
System : msg.rule
Consumer : msg.remark
Step 6
Now we have now the response from Anthropic AI which will be saved in DynamoDB utilizing the DynamoDB
node. The next is the configuration for the DynamoDB
node.
Show Title : DynamoDB
Operation : PutItem
Desk ARN : >
Attributes:
Itemid = msg._msgid
Merchandise = msg.payload.merchandise
suggestions = msg.payload.remark
sentiment = msg.payload.sentiment
ranking = msg.ranking
Step 7
Lastly wire the DynamoDB
node to the EventListener Finish
node with a logger
reporting the exit.
The finished circulate will look as proven under.
Determine 4: Buyer suggestions circulate (Picture source: writer)
Attempt It
The above circulate will be invoked with the next endpoint domestically.
Endpoint : http://localhost:1880/buyer/suggestions
Methodology : POST
Content material-Kind : utility/json
Physique : {
"rating" : "2",
"comment" : "The chicken curry is too salty. Would have been better if less spicy as well"
}
You’re going to get the response under. The response exhibits that the Anthropic AI has extracted the merchandise and suggestions and recognized the sentiment on the consumer suggestions remark. These information will be seen within the DynamoDB desk as nicely.
{
"item":"chicken curry",
"comment":"too salty and spicy",
"sentiment":"negative"
}