Hey everyone, I wanted to share how we've been scaling our prompts with classification! For context, we build “ChatGPT for customer support” and our AI-based customer support system has to handle all sorts of questions ranging from "Where's my order?" to "Does your product do X?" As our range of support questions increase, we can’t just keep adding more instructions onto a huge, “mono prompt”.

For a little background, the task of “Where’s my order” structurally is answered differently than “Does your product do X?”. For the first question, we have to authenticate the user (make sure we don’t give out random order details), make API calls to fetch tracking details, and properly respond. Lots of external information is needed. For “Does your product do X?”, if it’s in the help docs, then we can easily do a retrieval to answer!

So, we had to get creative to solve these range of questions. We first realized that separating task-specific prompts (”agents”) performed better. So now we had to figure out how to classify each request and “hand it off” to the right agent. We wanted it to figure out the type of request and then follow a set of actions (we call them "agents") to solve it. It's like telling it, "Hey ChatGPT, classify this task." And voila, it slots the request into the right category, like recognizing "Where's my order?" as an order tracking request. After that, an agent specifically designed to handle order tracking kicks in.

You might be wondering, "How do you even teach ChatGPT to classify tasks?" Well, there are two main ingredients: examples and a 'chain of thought'. The first one's simple - give it a bunch of examples for each task, and it starts recognizing patterns. But the second one, that's where the magic happens.

It's like teaching a kid that 1+1=2. “Here’s how you get 2. You first start with one, add another, and end up with two.” That's the kind of logic we're trying to instill in ChatGPT. Let's say we want it to classify a request. We start by teaching it how to classify. For each classification, we help it understand the reasoning. For example, for a "Where's my order?" task, we'd tell it, "The customer is asking for updates about their order, therefore it should be classified as an order tracking request". After the classification, we guide it to formulate an appropriate response.

Using this 'chain of thought' approach, we've seen a big improvement in how well ChatGPT handles tasks.

This whole task classification thing has been a game-changer for us. It's letting us automate customer support prompts in a way that we used to do in a “hard coded” way, and we're just scratching the surface here. We're stoked to see where this takes us and the possibilities for improving customer experience.

AI, and especially ChatGPT, has crazy potential for customer support. We're on an exciting journey, and we can't wait to share more of our adventures with ChatGPT with you all.

As a shameless plug, feel free to check us out at https://www.spryngtime.com/

If you guys have any ideas or suggestions around chain of thought/agents/prompt chaining, feel free to hit me up at *[michael@spryngtime.com](mailto:michael@spryngtime.com)*. Cheers!