Template Techniques
Agent Guidelines
Explains how to expose focused guidelines to an AI agent on demand while keeping its main prompt concise.
In order to preserve tokens and break up a large number of specific instructions a good technique is to use guidelines.
Individual mini-prompts are defined under the data path prompts.guidelines, eg. prompts.guidelines.cancellations.
The AI agent is given an action to read_guideline which returns the respective guideline content.
Detailed Example Structure
- Multiple guideline prompts are defined under
prompts.guidelines.[guideline_name] - A summary of the guidelines is defined under
prompts.guidelines_summary - An action called
read_guidelineis made available to themainchat in the_allstate - The
read_guidelineaction description isReturns additional guideline content based on the guideline selected. {{{{skip}}}}{{{template.data.prompts.guidelines_summary}}}{{{{/skip}}}} - This injects the summary of the guideline options into the action (and tool) description
- On the
_createaction a code task inspects thetemplate.data.prompts.guidelinesobject and builds an array of objects to be used for a select field on theread_guidelineaction, is saves them on the stub asguideline_options - The
read_guidelineaction has a select field calledselected_guidelinewhose options param is set to~~stub.data.guideline_options - When the AI agent selects a specific guideline that guideline is return in the
ai_inject_return_data