How to write instructions for your agents
When creating a customized agent, you must provide clear instructions for the agent to follow, including the specific tasks it should perform and the expected output among other things.
This page offers tips on how to effectively write instructions for your agents.
Best practices
1. Write clear and detailed instructions
Begin by specifying the agent's role, tasks, and objectives.
Ensure your instructions are clear and detailed.
2. Specify the desired output
If you expect a specific result from your agent, include it in the instructions.
Consider the following:
What kind of output do you expect? Is it text, a list, a file, a code block, etc.?
What tone should the agent use when responding to users - formal, informal, friendly, conversational, etc.?
How long should the answer be? Short, long, a specific length (for example: “less than 300 words”)?
In what format should the output be presented to the user? For example, if your agent is designed to write to a file, you might want to instruct your agent to provide a snippet of the content written in the file or a link to download the file.
If necessary, you can include examples of the expected output in the instructions.
3. Fine-tune your instructions by testing
Test your instructions by reading them from the perspective of someone completing the task. Are they clear and easy to follow? If not, revise them until they are.
You can also test your agent with the initial version of the instructions and refine the instructions until you achieve satisfactory results.
If you have trouble coming up with your own instructions, you can ask the Prompt expert agent to generate a prompt tailored to your use case and then refine it to achieve the desired results.
What can be excluded from your instructions
Certain information can be omitted from your instructions, as it is automatically considered.
As such, you do not need to include the following elements in your agent’s instructions:
The name of the agent;
The current date;
Reference to the tools and their parameters;
The language in which the agent should answer, as the response language is determined by previous messages;
The requirement to cite sources used in responses and the method for citing them.