1. Template Techniques
  2. Agent Guidelines

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_guideline is made available to the main chat in the _all state
  • The read_guideline action description is Returns 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 _create action a code task inspects the template.data.prompts.guidelines object and builds an array of objects to be used for a select field on the read_guideline action, is saves them on the stub as guideline_options
  • The read_guideline action has a select field called selected_guideline whose 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