ReTrace: Distilling Tool-Using Agents into Planner-Free Workflows
ReTrace targets repeated business procedures where an agent follows the same standard operating procedure on new inputs. Rather than invoking a language model to select every next action, it converts the procedure and a few logged agent runs into an executable workflow whose control flow is selected by code. The intended benefit is lower recurring latency and cost while retaining useful agent behavior.
The method uses the explanations accompanying tool calls, not just the calls themselves. ReTrace extracts the conditions that motivated each action, merges conditions across runs into a compact rule document, and generates a workflow from those rules. Only workflow generation is platform-dependent, allowing the intermediate rule document to be compiled for different orchestration systems.
On 79 procedures from the authors’ production platform, workflows achieve 93.8% completion versus 96.8% for the agent, with 24% lower cost per task. On τ²-Bench, workflows achieve 75.8% success compared with 80.6% for the agent, while running in 1.3 seconds instead of 170 seconds. Three repair rounds using training failures increase success for the reported k=2 workflows from 66.7% to 81.2%.
On eight SOP-Bench procedures, unrepaired ReTrace trails few-shot generation, at 80.6% versus 83.6%. Repair using labeled training failures raises its result to 87.8%, at 0.40 seconds per task, compared with the agent’s 85.5% and 46.6 seconds.
The results illustrate a trade-off: compiled workflows can substantially reduce repeated planning overhead, but initial distillation does not consistently preserve agent success. Repair materially affects the comparison and requires labeled training failures. The abstract does not establish performance on changing procedures, unseen exception types, or all orchestration platforms. Its strongest implication concerns recurring, specified workflows where logged reasoning and repair data are available.