Using AI to Enhance Znode B2B E-Commerce Workflows
Background
Hardly a moment goes by when I don’t see a new social media post about using ChatGPT to help you do something. As a firm specializing in complex B2B E-commerce implementations, we want to look past ChatGPT as the new shiny toy in the room and find a consistent way to leverage the truly awesome underlying power. If I asked most of my customers, “is it important to you that we use ChatGPT or AI in general as part of your next solution?” the almost guaranteed response would be “absolutely not”. But all of my clients are open to ideas that can simultaneously save them time and increase the quality of service for their customers.
At G[cg] we have been spending a lot of time with our new favorite B2B E-commerce platform, Znode. As a company of developers, we especially love how extensible the Znode platform is — in addition to having a lot of useful features out of the box. While they don’t have a native connector for ChatGPT like they do for major systems like SAP, QuickBooks, Epicor and many more, they do have a built-in tool called Commerce Connector that provides an easy-to-use framework for developing integrations with any outside system. Commerce Connector has native support for scheduling, configuration management, making REST API calls to any other system, and of course, accessing Znode data and being called from any Znode process.
Finding a Use Case
I could go on and on about Znode and its headless architecture, ability to deploy multiple stores, and .net tech stack that happens to be the perfect fit for my engineering team — but for now, I want to zoom in on a really specific feature that isn’t overly unique or special. After submitting a quote or order, the user is presented with an easy option for providing feedback to the online store owner. I can’t say I personally leave a lot of online feedback in any situation, but if the door is open there will definitely be some people that do — and that feedback has the potential to be extremely valuable! See the image below — very straightforward form that allows for open-ended feedback. Upon submission, the form information is sent to an email address configurable in the Znode Admin portal.
Znode customer feedback form
OK — so Znode gives us the ability to collect feedback right away, out of the box. And when users inevitably do leave feedback, Znode will email it to the email address you tell it. What happens next? As things stand, an employee working for the seller will have to read the email, and forward it to the correct department. Remember this feedback form is completely open for any comments, so the submitter could provide feedback that is useful to any department or multiple departments.
Znode feedback workflow with employee screening and forwarding
You might see where I’m going with this — maybe this is a good job for a friendly AI helper! It’s something that would be hard to do programmatically without AI. A seemingly simple alternative could be to add more fields to the form to collect some more context or allow them to target a department directly, but I don’t like adding unnecessary complexity to the end user of any application, not to mention a more complex form will likely reduce submissions in general. GPT-3 is great for natural language processing — things like detecting sentiment, summarizing information and categorizing content. Let’s design a solution that uses these features to free up time for the employee tasked with reading and forwarding customer feedback.
Designing a Solution
Znode feedback workflow with OpenAI
Research
Let’s get to it! For our example, let’s say we have Marketing, Customer Service and IT departments that are interested in feedback from users of this application. And while the ChatGPT API is not available to me yet, OpenAI (creator of ChatGPT) does offer a public API using the same fundamental building blocks of ChatGPT (the GPT-3 machine learning model). Our example will also use the latest and greatest Znode 9.7.5.
OpenAI Setup
First things first, you will need to create an OpenAI API account and generate an API Key. Save this API Key for later as you will not be able to view it again after leaving this page.
Formulate AI Prompt
Next, we need to formulate our AI prompt — remember to be specific, and use natural language like you are talking to a person. OpenAI provides a well-written documentation section about designing your prompt, and an awesome interactive playground for quickly seeing how the different prompts affect your results. Let’s try a prompt in the OpenAI playground, based on this customer feedback that might be relevant to multiple departments.
I tried to place an order but the page errored out the first couple times. Also, the product that I ordered (20v cordless drill) did not have an accurate photo when I was searching for it.
Initial OpenAI prompt in the OpenAI playground
OpenAI response to our initial prompt in the OpenAI playground
OK! OpenAI extracted the feedback regarding the application error when placing an order, and summarized it for IT. OpenAI also extracted the product photo feedback and sent it to Marketing. Lastly, OpenAI summarized the whole situation and told customer service about it.
Revise AI Prompt
I don’t like how OpenAI added opinionated advice to each department — we really just want to use AI to route this to the right person and extract the relevant and factual details. The marketing email leaves a bit to be desired as well. The customer described the product that they believe had an incorrect photo and I would like to see that info included to marketing. The AI result is only as good as the prompt, and I believe we can make this prompt more specific to address these shortcomings. Let’s try adding some more specificity to the AI prompt by including the following instructions with the original prompt and original feedback sample.
Please include any identifying information about the products being purchased if relevant to the feedback. Do not include any advice to any department, only include summarized, factual information. Do not include a subject line with the emails.
OpenAI response to the revised OpenAI prompt
Amazing what a little specificity can do! No more condescending advice to the different departments, no more email subject lines, and our AI also included product details to marketing. So we’ve effectively taken free form text from a customer, and restructured it into emails to the different stakeholder groups and ONLY included information that each department cares about.
Revise AI Prompt …again
I want to adjust the prompt one more time to make the output easier to consume in our upcoming Znode integration. I want the AI response to be formatted as JSON, and I want to also include a sentiment analysis so that we can decide if we want to do something different for positive and negative sentiment feedback.
Once again, adding this to our existing prompt and feedback sample:
Response format should be valid json, using this object shape: \"Emails\" will contain a list of all departments that should be notified: { \"Sentiment\": <customerSentiment>, \"Emails\": [{ \"Department\": <targetDepartment>, \"EmailBody\": <emailBody>}]}.
OpenAI response to our final OpenAI prompt
There we go! OpenAI kept all the details and accuracy we needed, while also formatting the response in a way that will be easy for our application to consume. We also now have a sentiment analysis as another datapoint to give us some flexibility in how and when we are sending these emails out.
Wrapping Up
We started with a real business problem that transcends industries and software platforms. Reading and categorizing long, free-form text content is a high cognitive-load activity with minimal opportunity for that special “human value-add” that could be applied elsewhere. Furthermore, analyzing that free-form text and drawing this kind of insight is something that is highly limited for traditional programming (any programmers reading this, imagine trying to reliably determine sentiment and forward a summary to the correct party without using AI).
Once our business problem was identified, we then took to the OpenAI API Playground. We worked on our prompt with a sample piece of customer feedback, with a few iterations to make our response more specific.
Finally, we added sentiment detection and formatted our response as JSON so that our response is ready to consume by Znode.
What’s Next?
Share your thoughts with us! Do you think this is a good use of AI? Would you design this solution differently? How else would you use AI to enhance a B2B E-Commerce workflow?
Continue to part 2, where we will walk through using our custom Znode ChatGPT Connector using Znode’s Commerce Connector framework.