Copilot Studio – The perfect instructions

When I create an agent, I spend a significant amount of time generating effective instructions.

The best practice is to understand right from the start how crucial this step is and to put it into practice even in the testing phase.

The agent, just like us humans, can provide more information or more detailed information (depending on what we want), and by ensuring clarity, accuracy, and formatting, we will receive precise and useful content for the purpose.

Where did I start?

Developing agents, I noticed how often the response is not exactly what I expect, sometimes in terms of content, other times in form.

In fact, an agent created in a few seconds can already provide answers, but accuracy will certainly be lacking.

A practical example is as follows:

1-

User: “Where is New York located?”

Agent: “New York is located on the east coast of the United States, in the state of New York. It is one of the largest and most famous cities in the world, known for its skyscrapers, such as the Empire State Building, and for the Statue of Liberty. Do you have plans to visit New York? 😊”

2-

User: “I would like to know exactly where New York is located.

Provide me with latitude and longitude.

Indicate the state.

Finally, indicate other geographical features.”

Agent: “New York City is located at latitude 40.71427° N and longitude -74.00597° W.

State: New York City is located in the state of New York, which is in the northeastern United States. The state capital is Albany, but the most populous and well-known city is New York City.

Geographical features:

Coastal location: New York City is located on the east coast of the United States, at the mouth of the Hudson River, which separates it from New Jersey.

Districts: The city is divided into five main districts: Manhattan, Brooklyn, Queens, Bronx, and Staten Island.

Natural harbor: The city overlooks a natural harbor that has contributed to its development as a global commercial and financial center.

Terrain: Much of New York City is built on islands, including Manhattan, Staten Island, and Long Island, which has led to a very high population density.

Altitude: The average altitude of New York City is about 57 meters above sea level.

I hope this information is helpful! Do you have any other questions about New York? 😊”

Two very different responses, but the secret was also in the question.

Create the perfect instructions:

What I do during agent development is manage the instructions one at a time, and with each modification or new instruction, retest the responses (generally with the same set of questions).

I create an agent, in my case, that serves as an assistant to the onboarding process and to provide important information such as the illness guide, expense reimbursement procedures, and providing the hiring document.

I start by inserting a sentence that explains the context (for convenience in English):

“You are the onboarding assistant of the company. You need to provide information on the documentation to which you have access.”

I test my agent:

As you can see, summarizing a document in a few points is complicated; in fact, we have 8 pillars.

At this point, we add the first steps to the instructions.

“Steps:

Get the necessary information.

Summarize the information so that it is precise but brief.

Make sure the user understands the answer.”

I test my agent again:

The result is very similar to the previous one, at least in terms of length, and this is not what I desire.

I add a few more lines of instructions.

“You must respond in a friendly and summary manner. The content you provide must be precise but very brief.”

I test once again:

Finally, I am achieving the desired result.

A brief text explaining the topic during the conversation.

Note: as you can see, the agent always reports the reference used in parallel.

I want to add one more thing:

“At the end of each response, add the phrase ‘I hope my answer is satisfactory.’”

I do a final test:

Conclusions:

Context + Task + Instruction + Clarify + Refine

These 5 words combined will help our agent a lot.

Maybe the perfect prompt does not exist yet, but we can certainly get closer.

Boom Done 💣

Follow me:

LinkedIn

YouTube

Instagram


Discover more from BEYOND THE PLATFORMS

Subscribe to get the latest posts sent to your email.


Comments

Leave a comment