Best Practices
A collection of guidelines to ensure that a template is following best practices and to elevate your templates to the next level.
Follow these general guidelines to ensure that a template is following best practices.
General
- Action names and state names should follow the naming standards
- There are relatively few states and they give high level structure
Prompting
- There are no successive system role messages being injected into the chat, if a dynamic message is needed use string substitution to achieve a single system role message instead
- Long prompts with many diverse instructions that may not all be needed for each conversation are broken up into guidelines using the guideline technique
Actions
- AI enabled actions return only the key information in the
ai_inject_return_datatool call return - AI enabled actions do NOT return data that was input into the action in the first place
- Action descriptions give short detailed information about when to use the tool and hint at the return data
- Where a finite set of values is required the action uses the
selectfield type - Field types are appropriate to the data being collected
Standard Actions
- A production agent should have the
calendarandcalulatorlibrary actions, these provide time awareness and a general calculator
Agentic flows
- If an agent is started on the
_createaction, check that it is ordered after any tasks that prepare data for the agent or actions the agent might call
Notification Platforms
- Use webchat status notifications on actions if the agent is running on webchat (using a task sending a
_stubber_webchat_status_messagecontrol event) - Use WhatsApp typing indicators for larger actions to indicate that the agent is busy on Whatsapp enabled flows
- When using webchat instruct the agent to use markdown but not the heading labels
Annotations
- The flow has a README explaining the key functions of the flow and reason for the flow
- The flow has headings denoting the main areas where actions are present