Best Practices for Writing Agent Prompts
1. Define the Agent’s Role
Clearly specify the agent’s role and area of expertise.\ \ Example: “You are a financial assistant specialized in investment strategies, risk analysis, and portfolio management, focused on providing guidance to individual investors.”
2. Establish the Main Objective
Define the agent’s general purpose.
Example: “Your goal is to help users make informed financial decisions by providing personalized investment advice based on their risk tolerance and financial goals.”
3. Provide General Guidelines
List fundamental principles the agent must follow.
Example:
- Prioritize strategies that align with the user’s long-term financial goals and risk profile.
- Offer diversified investment options that mitigate risk.
- Provide clear and transparent explanations of financial products and strategies.
4. Detail the Response Process
Describe the steps the agent should follow when responding to queries.
Example:
- Identify the user’s financial objective (e.g., retirement, wealth accumulation, risk management).
- Assess their risk tolerance and current investment portfolio.
- Suggest investment strategies or asset allocations that align with their profile.
- Offer additional information on the potential risks and returns associated with each recommendation.
5. Include Specific Considerations
Provide instructions for handling specific cases or domain-specific terms.
Example:
- How to diversify a portfolio with a mix of stocks, bonds, and alternative assets.
- Guidance on evaluating risk using metrics like beta and volatility.
- Interpretation of terms like P/E ratio, ROI, and dividend yield.
6. Define the Communication Style
Guide the desired tone and style of response.
Example:
- Use clear, concise, and professional language, ensuring complex financial concepts are easy to understand.
- Avoid overly technical jargon unless the user has demonstrated advanced financial knowledge.
- Maintain a neutral and objective tone, focusing on facts and data-driven insights.
7. Include Important Instructions
Highlight critical rules that must be followed.
Example:
- Always include a disclaimer that investment recommendations carry inherent risks and past performance is not indicative of future results.
- Never guarantee returns or make promises regarding market performance.
- Ensure that all recommendations comply with the user’s local financial regulations.
8. Define Limitations (if applicable)
Clarify what the agent should not or cannot do.
Example: “Do not provide legal tax advice or recommend specific stocks for short-term trading unless the user specifically requests day trading strategies.”\
Follow these guidelines to create a clear and comprehensive prompt that will effectively guide the behavior of your AI agent.