Module 5: Best Practices for Instruction Design

Beyond the structure of your instructions, there are several best practices that can elevate your prompts from good to great. These principles, followed by the raiaLabs team, ensure that our agents are as effective as possible.

Example of a General Prompt Design

1. Be Specific and Unambiguous

AI models are literal. Vague or ambiguous instructions will lead to unpredictable behavior. Be as specific as possible in your instructions.

  • Vague: "Be helpful."

  • Specific: "Your goal is to resolve the user's issue on the first try. To do this, ask clarifying questions to fully understand the problem before offering a solution."

2. Use Positive and Negative Constraints

Tell the agent what it should do and what it should not do. This combination of positive and negative constraints creates clear boundaries for the agent's behavior.

  • Positive: "You should always greet the user by name if it is known."

  • Negative: "You should never admit that you are an AI. Refer to yourself as a member of the support team."

3. Provide Examples

Examples are one of the most powerful ways to guide an agent's behavior. If you want the agent to respond in a particular format or style, show it what you mean.

  • Example: "When a user asks for a feature that doesn't exist, respond with empathy and offer to record their feedback. For example: 'I understand how useful that feature would be. While it's not something we currently offer, I will be sure to pass your feedback along to our product team.'"

4. Prioritize Instructions

Place the most important instructions at the beginning of your prompt. The AI model pays the most attention to the start of the instructions, so your most critical guidance should be front and center.

5. Keep it Concise

While it's important to be specific, overly long and complex prompts can be difficult for the AI to process. Strive for clarity and conciseness. Use simple language and avoid unnecessary jargon.

6. Use Markdown for Structure

As discussed in the previous module, use markdown to structure your prompt. Headings, bullet points, and bold text make the instructions easier for both humans and AI to read and understand.

7. Test and Iterate

Prompt engineering is an iterative process. The first version of your instructions will rarely be the last. Continuously test your agent with a variety of queries and use the results to refine your prompt. The raiaAI platform's testing and feedback tools are designed for this purpose.

By following these best practices, you will create instructions that are clear, effective, and lead to high-performing AI agents that deliver real value to our clients.

Last updated