What's Copilot Studio topic and how to use it effectively?

From this article you'll know:

  • what's topic in Copilot Studio
  • how to use it, depending on your needs,
  • what to avoid regarding topics.


Topic in the context of Copilot Studio is the main building block of a chatbot. It enables you to extend the capabilities of your bot by giving it new ways to interact with the end-user. How to use it effectively? Let me try to answer this question.


Old vs. new

Currently, when we start our chatbot development, we have two ways to perform it:
  • classic approach,
  • generative orchestration approach.

I won't cover pros and cons of each one - you can find it here - but all in all I think for now it's best to stick to the classic one. It has it's advantages like stable outcome, reliable technology and testing capabilities.


Classic topic

Topic in the classic context is being invoked by:
  • trigger phrases: you write "apple" - it invokes the topic. Simple and easy. It can also understand synonyms, so the key is to use the trigger phrases that you expect the user to write.
  • invoking from another topic: you can modularize the chatbot, so that each topic can act as a separate "function", instead of building a monolith.

Thanks to that, your chatbot can we quite flexible in terms of functions that it can perform.

Regarding types of classic topics, we can define two:

  • system topic,
  • custom topic.
System topic in general is, as Microsoft states: "System topics are necessary to help your agent run effectively. Without them, your agent may not work as intended. You can't delete system topics.". So it's a necessary part of your chatbot, without which it wouldn't work correctly. What system topics cover? In general they're defined for the essential parts of the conversation, like start, end, fallback. It makes your chatbot more reliable. We can modify system topics in order to alter the chatbot's behavior, for example:
  • we can alter the "Conversation Start" topic, so that the chatbot sends a different message, when you open it,
  • we can modify "End of Conversation" topic, so that it resets all our global variables values,

etc.

Regarding custom topics, to put it bluntly, it's just a building block that you can freely define as you wish.


How to use topics effectively?

The key to use topics effectively is to modularize your logic. Let's say you have a chatbot which asks a question to the user and, based on the user's choice, it needs to perform some kind of business logic. What usually comes into your mind is to define this logic within the same topic. What about splitting it into smaller parts? How to achieve this, you would ask? It's quite simple! For each condition branch, you can define a separate subtopic and redirect to it. Here's a simple example of this approach:


You can see that I've defined a question with multiple choices and for each choice I've defined a separate topic. It's easier from development perspective to debug, when you use this design approach, because, usually, you don't need to review the whole topic logic - you can just stick to the topic that causes the error. It's also easier to write additional "modules" to already existing functionalities. Why? Because you don't need to modify main topic, instead you can add another "building block" to it.

Summary

I hope that you like the approach that I've proposed above. I think that it'll be a lot easier to develop, debug and monitor chatbots if we'll use this way of development. Any questions, doubts or maybe you have a different opinion? Share it in the comments section!


Artur Stepniak