> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dust.tt/llms.txt
> Use this file to discover all available pages before exploring further.

# How to write effective instructions

> Write clear agent instructions: the principles that work, and a framework to structure them.

An agent's instructions tell it what to do, how to do it, and what to avoid. The agent follows them in every conversation, so clear instructions give you answers that are more relevant and more consistent. You don't need technical skills to write good instructions: write them like you would brief a new colleague.

> [!TIP]
>
> [Sidekick](https://docs.dust.tt/docs/user-documentation/agents/default-agents/agent-builder-sidekick.md) can draft and improve your instructions, from a blank page or from a template.

## 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

> [card] [Sidekick](https://docs.dust.tt/docs/user-documentation/agents/default-agents/agent-builder-sidekick.md)
>
> Get help to draft and improve your instructions.

> [card] [Create your first agent](https://docs.dust.tt/docs/user-documentation/agents/create-your-first-agent.md)
>
> Build an agent step by step in the Agent Builder.

> [card] [Understanding Retrieval Augmented Generation (RAG) and the search method in Dust](https://docs.dust.tt/docs/user-documentation/agents/llm-best-practices/understanding-rag.md)
>
> Learn how agents search your data.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.