DEV Community

Cover image for From Scribbles to Spells: Perfecting Instructions in Copilot Studio
Bala Madhusoodhanan
Bala Madhusoodhanan

Posted on

From Scribbles to Spells: Perfecting Instructions in Copilot Studio

Intro:
While experimenting with Generative Answers, I noticed that the output often didn't align with my expectations. My goal was to build a chatbot based on Standard Operating Procedures (SoP), which included detailed step-by-step instructions for completing tasks. However, when using the out-of-the-box Generative Answer feature in Copilot Studio, the responses tended to summarize and provide context rather than delivering the specific instructions users needed.

This led me to explore how I could leverage detailed instructions within the agent to ensure accurate and relevant responses. Instructions are crucial in AI-generated content because they guide the AI to produce responses that are not only relevant and accurate but also contextually appropriate. Well-crafted instructions ensure that the AI understands the user's intent and delivers the desired output.

TCR Framework (Task, Clarity, Refine)

Image description

  • Task: Clearly list all the steps required to complete the instruction. If you do not then the generative AI will basically summarise what it thinks is the bast answer. Be articulate on how you would interpret the SoP. What are the segments that you would be interested to see from the documents.

  • Clarity: Provide clarity on the expected output, ensuring the AI understands what the final result should look like.

  • Refine: Added couple of instruction like

  1. Validation:Ensure the AI validates the user query against the knowledge base accurately.

  2. Formatting: Pay attention to the formatting of the markdown table to ensure it displays correctly.

Sample Instruction Prompt looks like this

Search the Knowledge Base:
1) Search the knowledge base using the user's query.
2) If multiple instances are found, exit the knowledge base and prompt the user to explore a different topic
3) Provide Methodology Status and Category:

Once the specific emission scope is identified, provide a brief description of the methodology status and the category of the scope.
Extract and Present Methodology Details:

From the Methodology section for the specific topic, extract the relevant details.

Present the details in a transposed markdown table format **without summarizing the content**. The table should include the following rows:
Definition
Scope
Method 
SoP steps
How to Input into Inventory System

### Example Output
### Methodology Status and Category
**Status**: [Brief description of the methodology status]

### Methodology Details

| **Category** | **Details** |
|--------------|-------------|
| **Definition** | [Full text from the knowledge base] |
| **Scope** | [Full text from the knowledge base] |
| **Method** | [Full text from the knowledge base] |
| **SoP Steps** | [Full text from the knowledge base] |
| **How to Input into Inventory System** | [Full text from the knowledge base] |

**Additional Tips**
<u>Validation</u>: Ensure the AI validates the user query against the knowledge base accurately.
<u>Formatting</u>: Pay attention to the formatting of the markdown table to ensure it displays correctly.
Enter fullscreen mode Exit fullscreen mode

Demo:

Image description

Image description

I am sure we could optimise the number of steps in the prompt. Its trial and error but this feature is super cool to know

Top comments (0)