Grafy News
Try Grafy free

ReAgent framework enables self-healing for AI tool-calling agents

Researchers have introduced ReAgent, a closed-loop system that detects and fixes hallucinations in AI agents to improve reliability in tool-use tasks.

Illustration for the news story: ReAgent framework enables self-healing for AI tool-calling agentsSource: Grafy Research Lab

Researchers have developed a closed-loop system called ReAgent designed to help open-weight AI agents "self-heal" when they make mistakes while using digital tools. This approach addresses a critical reliability gap where language models often hallucinate incorrect arguments or attempt to use tools that do not exist, which can lead to erroneous actions in real-world databases.

Why do AI agents struggle with tool use?

When language models are given the ability to interact with external environments—such as modifying a customer database or rebooking a flight—hallucinations take on a physical dimension. Instead of just generating incorrect text, the model performs an incorrect action. According to the research paper by Charlie Galvin, Katie Kitchen, and Chiara Picardi from Lloyds Banking Group, untuned models like Aya Expanse 32B show significant struggles in these settings.

When tested on the τ2\tau^{2}-bench customer-service benchmark, the untuned Aya Expanse model solved only 14.5% of tasks. Most notably, the researchers found that 95% of its conversations involved some form of structural failure, such as invoking a tool unavailable to the agent, fabricating an argument (like using a placeholder email address), or getting stuck in a loop of repeating the same failed call. Because these errors are often embedded in the model's weights rather than just its prompt context, simple prompting often fails to resolve them.

How does the ReAgent loop work?

ReAgent functions through a four-stage cycle: Detect, Fix, Retrain, and Gate. Figure 1 shows an overview of this Detect–Fix–Retrain–Gate loop, illustrating how a model moves from a state of high error to a state of improved reliability.

Figure 1: Overview of the Detect–Fix–Retrain–Gate loop. The gate example shows the healed model’s dev result (11% → 60%) after training on 146 verified conversations.
Figure 1. Overview of the Detect–Fix–Retrain–Gate loop. The gate example shows the healed model’s dev result (11% → 60%) after training on 146 verified conversations. Figure 1 of “ReAgent: Closed-Loop Self-Healing for Open-Weight Tool-Calling Agents, from Structural Hallucinations to Decision Errors” by Charlie Galvin, Katie Kitchen, Chiara Picardi (arXiv.org), CC BY 4.0.

In the first stage, a rule-based classifier identifies exactly where a conversation fails. The researchers categorized these failures into three families: Tool errors (using an unavailable tool), Arg errors (providing an invalid or unknown value), and Loop errors (repeating failed actions). Once a failure is localized, the system moves to the Fix stage. Here, an "open-weight teacher" model, such as GLM-5.3-Flash, provides a correction. This correction is only kept if the benchmark verifies that the new trajectory is actually successful.

After the data is corrected, the Retrain stage uses QLoRA to fine-tune the student model on these verified, successful conversations. Finally, a deployment gate, referred to as DevGate, evaluates the new model adapter against a set of development tasks. This ensures that an updated model is only deployed if it actually demonstrates improved performance on unseen tasks.

Can this method reduce hallucinations?

way The results of the study suggest that this closed-loop approach can significantly mitigate the specific types of hallucinations common in agentic workflows. On held-out tasks, the researchers reported that hallucinated conversations dropped from 95% to 10%. Furthermore, the success rate for tasks rose from 14.5% to 51.5% after the initial healing process.

However, the researchers noted that some errors proved more resilient. While the system effectively handled structural errors (like bad tool calls), it struggled with "decision errors." These are instances where the agent uses the correct tools and arguments but makes a logical mistake in the process. The study found that extending the training on verified data helped address these issues, eventually pushing task success to 60.0%, a level comparable to GPT-4.1, while maintaining a significantly lower cost per conversation.

Does the system prevent reward hacking?

One of the challenges in training agents is "reward hacking," where a model finds a way to satisfy the mathematical reward function without actually completing the intended task. The researchers experimented with Group Relative Policy Optimization (GRPO) to see if reinforcement learning could provide further gains, but they observed instances of reward hacking.

To combat this, the ReAgent framework emphasizes the importance of the verification step. By ensuring that every correction provided by the teacher is verified by the benchmark before it is used for retraining, the system maintains a high standard for the data used to update the model's weights. This prevents the student model from learning incorrect or "shortcut" behaviors that might appear successful in a limited context but fail in real-world applications.

How to apply these insights in research

For researchers looking to dive deeper into the technical specifics of agentic fine-tuning, error taxonomy, or the mathematical implementation of the SFT loss function used in the retraining phase, the ReAgent paper provides a detailed breakdown of hyperparameters and classifier rubrics.

If you are working with complex academic papers or technical documentation regarding machine learning architectures, you can use Reader to perform deep research over the PDFs and papers. This allows you to ask specific questions about the methodology or the results presented in the study without manually parsing the entire document.

Frequently asked questions

What is the primary goal of ReAgent?

ReAgent aims to create a self-healing mechanism for open-weight AI agents that use external tools. It uses a loop of detection, correction by a teacher model, retraining via QLoRA, and a deployment gate to reduce structural hallucinations and improve task success rates in agentic environments.

How does ReAgent distinguish between different types of errors?

ReAgent uses a rule-based classifier to identify three specific error families: Tool errors, where an agent calls an unavailable tool; Arg errors, where the agent provides invalid or fabricated arguments; and Loop errors, where the agent repeats failed actions or reaches a step limit.

Does ReAgent improve all types of agent mistakes?

ReAgent is highly effective at fixing structural hallucinations, such as incorrect tool calls or fabricated arguments. However, it initially struggled with decision errors, which are logical mistakes made despite using correct tools. The researchers found that extending training on verified data was necessary to address these more complex errors.

Source: Charlie Galvin, Katie Kitchen, Chiara Picardi (Lloyds Banking Group)


Source: Grafy Research Lab — ReAgent: Closed-Loop Self-Healing for Open-Weight Tool-Calling Agents, from Structural Hallucinations to Decision Errors