Reflexion-Guided Self-Correcting Tool Agents under API Selection and Execution Failures

Authors

  • David Murphy computer science, vtech, va, usa Author
  • Jing Yang computer science, upenn, pa, usa Author
  • Kimberly Cox computer science, yale, ct, usa Author
  • Fan Song computer science, jhu, md, usa Author

DOI:

https://doi.org/10.66372/JGER.V2I1.2

Keywords:

API-Bank, tool-augmented language models, function calling, Reflexion, self-correction, API selection

Abstract

Tool-using language agents fail through coupled errors: an incorrect API choice changes the available argument schema, while correct tool selection still fails when dialogue state, identifiers, temporal values, or required fields are bound incorrectly. This study evaluates a Reflexion-guided correction pipeline on a four-file API-Bank evaluation package containing 1,012 records, including 534 API-call targets from 261 dialogues. The first-pass agent ranks the provided API schemas with BM25 over the latest four dialogue events and binds arguments with deterministic local extraction rules. A benchmark feedback gateway rejects calls that are not execution-equivalent to the target and records a structured diagnosis. The repair agent then reconstructs the active trajectory segment, reselects the API with a state machine and global library ranking, and rebinds arguments using fold-local episodic profiles, value lexicons, and defaults. All memory objects were fitted in five GroupKFold splits grouped by dialogue, preventing any dialogue from contributing to its own repair memory. First-pass tool accuracy was 61.80%, strict call accuracy was 29.03%, and execution-normalized success was 36.52%. The gated correction pipeline reached 93.82% tool accuracy, 58.61% strict call accuracy, and 70.41% execution-normalized success. It repaired 181 of 339 initial failures and preserved all 195 initially successful calls, producing a 33.90-point paired gain (95% bootstrap confidence interval: 29.96–38.01; exact McNemar p=6.53×10⁻⁵⁵). Level-3 trajectories gained 44.44 points, and controlled failure injection yielded repair success from 67.04% for wrong tools to 100% for observed stale-state errors. The results show that trajectory state and argument reflection provide complementary gains and that value grounding remains the dominant residual failure.

Downloads

Published

2024-01-09

How to Cite

Reflexion-Guided Self-Correcting Tool Agents under API Selection and Execution Failures. (2024). Journal of Global Engineering Review, 2(1), 12-31. https://doi.org/10.66372/JGER.V2I1.2