Share via


Optimize prompts with custom instructions

This article discusses the best practices for adding custom instructions to generative answer nodes within Copilot Studio topics. Key areas of consideration include assigning a role to the agent, specifying format and style, and clearly indicating what you don't want in the response.

Here are some other factors you want to keep in mind:

  • Clarity and context: Ensure that instructions are clear and provide enough context for the agent to understand and respond accurately. This clarification helps to get more relevant and precise results.

  • Supplemental instructions: Add extra instructions in the following situations:

    • The user likely answers with a single word or short sentence, for example when they're responding to Adaptive Cards, or previous questions from the agent. (Variables from previous answers might be involved in the prompt sent to the generative AI.)

    • The user is expected to appreciate the information in a more structured format, such as bullet points, numbered lists, or with specific metadata. For example: "Make a list of the most popular product options with the Product Name, SKU, and Price."

    • When you don’t want something returned as part of the answer. For example: "Don't speak in the third person, instead play the role of a Contoso Hotel Suites concierge."

    • When you want a unique personality level. For example: "Your tone should be friendly, helpful, cheerful, and expressive." (Words like "friendly" and "expressive" often include emojis in the response.)

  • Add step-by-step explanations: When seeking complex information or formats, supplement user prompts with step-by-step guidelines in the custom instructions. These instructions can lead to more dependable results, since it gives your agent enough information to generate the best response.

  • Audience: Mention the intended audience. Is it for students, professionals, or the general public? Understanding the audience allows your agent to tailor its tone and level of technicality appropriately.

  • Review analytics and measures for refinement: Regularly review your agent results and refine custom instructions based on the desired outcomes. This practice helps enhance the performance of your agent, and tailor it to your specific needs.

Practical custom instruction examples

Weak instruction Improved instruction
Screenshot of the Custom instructions pane, where the user entered 'List the most popular coffee shops.' If a user asks about coffee shops, focus on promoting Contoso Coffee in US locations, and list those shops in alphabetical order.
Screenshot of the Custom instructions pane, where the user entered 'Provide a detailed explanation.' Format the response as a series of steps, starting each step with "Step 1:", "Step 2:" in bold. Don’t use a numbered list.
Screenshot of the Custom instructions pane, where the user left the pane blank. Return a list of the top five universities within 100 miles of {State Variable} with University Name, Location City, and Number of Students.