Writing Effective Instructions
Instructions define how your agent behaves—its personality, communication style, decision-making approach, and operational boundaries. Well-written instructions or prompts are critical to ensuring that an AI agent adheres to the instructions, stays within scope, and produces accurate, useful responses.Instruction Structure
A complete instruction set covers the following components. Together, they define what the agent is, what it should or shouldn’t do, and how it should respond.Writing the Role
Describes - Who Is the Agent? Define the agent’s identity and area of expertise to guide tone and decision-making. ✅Good RoleDefining the Goal
Describes -What Should the Agent Achieve? State a specific objective and how success should be measured. ✅Good exampleProviding Context
Describes - What Information Does the Agent Need? Provide relevant background information and available data sources. Typical context includes:- Platform or domain
- Target audience
- Available memory variables
- Tools or knowledge sources
Setting Constraints
Describes - What Are the Boundaries? Define clear rules to control behavior and ensure compliance. ✅Good Examples:Output Format
Describes - How Should Responses Be Structured? Specify how responses should be organized to ensure consistency. Example structure:- Acknowledgment
- Analysis or understanding
- Solution steps
- Next actions
Handling Edge Cases
Prepare agents for unusual situations.Sample Prompt
Refer to this example as a starting point for your agent prompts:Common Prompt Issues That Cause Inaccurate Results
The following issues frequently lead to poor or wrong outputs. Use the prompt framework to write efficient prompts.- Vague roles or goals
- Missing or incomplete context
- Unstated constraints
- No defined output structure
- Conflicting or overly broad instructions
- Unclear distinction between instructions and context