Member-only story
Build a Customer Service Chatbot Using Python, Flask, and Pinecone
Apply similarity search with AI/ML
Similarity search is a subset of the machine learning field that deals with finding items that are closely related to the original input. It’s incredibly useful for things like product, music, or movie recommendations. You watched The Office on Netflix, so here are some other shows you may like. You frequently listen to Bayside on Spotify, so go check out these other pop-punk bands.
Similarity search can also be used to automate customer support. What if when a customer asks a question, you could easily find previously asked similar questions and answers that could help them?
In this article, we’ll build a Python Flask app that uses Pinecone — a managed similarity search service — to do just that.
Motivation and Real-World Application
Before we jump into the demo app, let’s take a minute to examine the problem we’re trying to solve.
Imagine you’re an executive at a large company with thousands or even millions of customers. Your customer support team is repeatedly asked the same questions day after day. To save time and money, you could streamline your support process by having good public-facing documentation and FAQ pages.
But how can you ensure that customers find the information they need? After all, creating the documentation is only half the battle.
One approach that many companies take is to use a customer service chatbot. When a customer first initiates a conversation, they’re chatting with a robot. The customer enters their question and the bot tries to help solve their problem. If the bot can respond with accurate, related questions and answers, then the customer may be able to solve their problem on their own.
And if that doesn’t work, then the customer can request to speak with an actual human being who can help. Artificial intelligence and machine learning can’t solve all of our problems — at least not yet.
Demo App Overview
Let’s now take a look at our demo app. Below you can see a brief animation of how the app works. The user enters a question and…