🚀 It’s live! Access exclusive 2025 live chat benchmarks & see how your team stacks up.

Get the data
How to Write Topic Instructions

When creating a Topic for an AI Agent, you can define the Topic answer by workflow or by natural language. Natural language allows you to give instructions in plain text to tell the AI Agent what to do if the topic matches.

Instructions have both advantages and drawbacks, so consider them carefully before choosing this type of response.

  • By letting the AI Agent manage the entire conversation, you gain flexibility. For instance, if the user pauses the process (“Wait, let me check”), a traditional workflow might stop. However, an AI Agent operating with instructions can resume the workflow later while remembering the entire conversation. 
  • Setting up instructions requires more effort in testing and fine-tuning to achieve the desired results.
Note:
  • Instructions are NOT used to provide direct answers. They must align with typical logical rules. For example, if you instruct the AI Agent to provide an obviously incorrect answer (for example, provide answer “3” for the question “1+1”), it may not comply.
  • To let the AI Agent provide direct answers, use the By Workflow type instead. To learn more about how to set up a topic, see this article.

This article introduces how to write effective instructions by providing a sample use case.

Instructions work best in combination with functions. You can guide the AI Agent on how and when to use specific functions to fulfill a task. Instructions are not recommended if the topic does not involve any function calling. For complicated tasks, you can also add some notes and provide a sample dialogue for the AI Agent to understand better.

Note: To learn more about how to use functions, see this article.

Sample Use Case

Topic: The user wants to schedule a product installation.

Functions involved:

  • check_order   
    • Input: OrderID 
    • Output: JSON containing order details (including the shipping address).
  • get_installation_time_slot   
    •  Input: Address 
    •  Output: An array of available installation time slots.
  • schedule_installation   
    • Input: The selected time slot and address 
    • Output: Success or failure message

Sample Instructions 

 

1. Ask for the user’s email and order ID, then call the check_order function to get the shipping address and arrival date. 

2. Next, call the get_installation_time_slot function, using the shipping address to retrieve available time slots. 

3. Present these slots to the user and ask them to choose one. 

4. Once they choose, call the schedule_installation function with the selected slot and address. 

5. Finally, confirm the appointment. If scheduling succeeds, let the user know that a confirmation email will be sent.

Notes: 

  • If the user rejects all available time slots, offer to connect them to a human agent. 
  • If you already know the user’s email from the prior conversation, don’t ask for it again.

The following is a sample dialogue.

User: Hi, I want to make an appointment to install the air conditioner.

Assistant: Sure. May I have your email address and order ID so I can get your order details?

User: OK. My email is myname@abc.com, and the ID is 10000.

Assistant: Your order (ID 10000) is shipping and will arrive in Boston on May 15, 2025. The available installation slots for March 16, 2025, are 9 AM, 11 AM, 2 PM, and 4 PM. Please choose one of these slots.

User: 11 AM would be good.

Assistant: Your installation has been scheduled for March 16, 2025, at 11 AM. A confirmation email will be sent to test@abc.com shortly.