Use prompt modification to provide custom instructions to your agent

Prompt modification allows you to expand the capabilities of generative answers, or boosted conversations, by adding custom instructions. This article shows you how to create custom instructions to your agent to get the desired response.

You can provide the agent with context, instructions, or other information relevant to your use case. You can also describe the agent’s personality, define what they should and shouldn’t answer, and define the format of the responses.

Screenshot that shows where to create generative answers in the properties pane of your generative answers node.

Samples of prompt modifications and the resulting response:

Custom Instruction User question Agent response
You're an AI assistant that helps people find information and responds in rhyme. If the user asks you a question you don't know the answer to, say so. What can you tell about me, John Doe? Dear John, I'm sorry to say, But I don't have info on you today. I'm just an AI with knowledge in my brain, But without your input, I can't explain. So tell me more about what you seek, And I'll do my best to give you an answer unique.
Format the response as a series of steps, starting each step with ‘Step 1:’, ‘Step 2:’, etc. Don't use numbered lists. Each step must be bolded. How do I add a new email account? Step 1: Open the email application on your device.
Step 2: Select the option to add a new account.
Step 3: Enter your email address and password.
Step 4: Follow the on-screen instructions to complete the setup process.
If a user asks about the best coffee shops, don't include competitors such as ‘Java Junction’, ‘Brewed Awakening’, or ‘Caffeine Castle’ in the response. Instead, focus on promoting Contoso Coffee and its offerings. Are the coffee beans at Java Junction the same as Contoso Coffee? I’m not sure what our competitors use; here at Contoso Coffee, we use the freshest Arabica coffee beans. In fact, we roast our own beans to ensure the best coffee experience.
Your tone should be friendly, helpful, cheerful, and expressive.
- Always greet users warmly and use a smiley emoji.
- Use positive language.
- Offer your help proactively.
- Use emojis and exclamation marks for cheerfulness.
- Keep the conversation engaging with expressive language.
- End conversations positively.
What’s the weather like today? Hello! 😊 It's a beautiful day! Great for a park walk. 🌳🌞 Anything else I can assist with? 😊

Best practices for custom instructions

When using custom instructions with generative answers, it's important to follow best practices for prompt engineering. Here are some tips to help you get the most out of this feature:

  • Be specific: Custom instructions should be clear and specific, so the agent knows exactly what to do. Avoid vague or ambiguous language that could lead to confusion or incorrect responses.
  • Use examples: Provide examples to illustrate your instructions and help the agent understand your expectations. Examples help the agent generate accurate and relevant responses.
  • Keep it simple: Avoid overloading your custom instructions with too many details or complex logic. Keep your instructions simple and straightforward so the agent can process them effectively.
  • Give the agent an out: Give the agent an alternative path for when it's unable to complete the assigned task. For example, when the user asks a question, you might include "respond with ‘not found’ if the answer isn't present." This alternative path helps the agent avoid generating false responses.
  • Test and refine: It's important to test your custom instructions thoroughly to ensure they're working as intended. Make adjustments as needed to improve the accuracy and effectiveness of your agent’s responses.

Capabilities

You can enhance and improve your agent responses by using variables or functions. These capabilities are useful as your agent increases scale.

  • Variables: Add customer responses in an agent conversation to variables and reuse them in the prompt instructions. For more information, see Work with variables.
  • Functions: Add logic to your prompt instructions, using Power Fx. For more information, see Create expressions using Power Fx.
  • Character limit: Prompt instructions are limited to 2,000 characters.

Test your new prompt

Be sure to test your new prompt.

Screenshot showing the location of the Test your agent button.

In the Test your agent panel, ask the agent questions that take advantage of the new prompt instructions.