Principles for good instructions
- Be specific. Say exactly what you want. Don’t write instructions like a search query with keywords. Vague or very broad instructions give unfocused answers.
- Give context. Describe the topic, the audience, and the format you expect. The more context the agent has, the better it can adapt its answer.
- Show examples. An example of a good answer is often clearer than a description of it.
- Give the agent a role. An agent that acts as “a teacher for engineering students” answers differently from one that acts as “a sales representative.”
- Break down complex tasks. List the steps that the agent must follow, in order.
- Use simple and direct language. Avoid words that can have more than one meaning.
- Read your instructions as a newcomer. If someone who doesn’t know your project can understand them, the agent can too.
- Iterate. If an answer isn’t right, change the instructions and try again.
Design your agent around its users
Start with the people who will use the agent and the questions they will ask. This tells you what the agent must do and which knowledge it needs. Only give the agent the data it needs. The more data an agent can access, the harder it is for it to find the right information at the right time.A framework for your instructions
Use these parts to structure your instructions:- Role and goal: what the agent is and what it must achieve. This limits the agent to the answers that fit its purpose.
- Steps (optional): the steps that the agent follows to guide the user. For example: “When the user asks a question, first ask them if they want A or B.”
- Expertise: your knowledge of the domain, and how the agent must work differently from a general assistant. This is the most important part.
- Constraints: the rules that the agent always follows. For example: “Ask only one question at a time,” “Reply in bullet points,” or “Reply in French only.”
- Output: the format of the answer, like an explanation, a table, or a SQL query.
Related
Sidekick
Get help to draft and improve your instructions.
Create your first agent
Build an agent step by step in the Agent Builder.
Understanding Retrieval Augmented Generation (RAG) and the search method in Dust
Learn how agents search your data.