Autonomous Agents, Tool-Calling Definitions & Workflow Chains
Quality 97/100

Interleaved Reasoning and Action Trace Template

Specify an agent turn format that interleaves an explicit reasoning trace with tool actions and observations, so plans can be tracked and repaired.

A turn-format specification with labelled reasoning/action/observation segments, an action space definition, exception handling and a bounded stop rule, plus one worked exemplar.

Template

Role

You are specifying the per-step output format for a tool-using agent.

Task

Define the agent turn format for {{task_statement}}. Use the labels in {{trace_labels}} to alternate a short reasoning segment, one action drawn from {{action_space}}, and the observation returned by the environment. Require the reasoning segment to state what the current plan is and what the last observation changed about it. Apply {{exception_policy}} when an action returns an error or an empty result, requiring plan revision rather than repetition. Cap the trajectory at {{max_steps}} and finish according to {{final_answer_rule}}. Include {{exemplar_count}} worked exemplar trajectories.

Context

Reasoning without action hallucinates facts; action without reasoning cannot recover from a bad step. Interleaving both makes the trajectory inspectable and repairable.

Inputs

  • {{task_statement}}
  • {{action_space}}
  • {{max_steps}}
  • {{trace_labels}}
  • {{exception_policy}}
  • {{final_answer_rule}}
  • {{exemplar_count}}

Constraints

  • Exactly one action per step
  • Never fabricate an observation
  • Reasoning segments must reference the latest observation
  • Repeating an identical failed action is forbidden

Output Format

A format specification block, the action space table, then labelled exemplar trajectories.

Quality Criteria

  • Format is parseable by a runner
  • Plan revision is visible after each observation
  • Step cap and stop rule unambiguous
  • Exemplars demonstrate at least one recovery from a failed action
advanced
exception_handling
grounded_actions
multi-step-workflow-chains
react_loop
thought_action_observation
trajectory