Learning from Failures: Heterogeneous Graph Memory for Small Language Model Tool-Using Agents
Abstract
Small and medium-sized language models offer cost-effective executors for tool-using agents, making them attractive for local and large-scale deployment. However, in long-horizon and stateful environments, they often make structural errors such as missing required observations, performing premature writes, repeating failed calls, and violating action preconditions. These errors can lead to incorrect state updates, policy violations, and costly or irreversible consequences, making reliable tool execution a critical deployment challenge. Existing fine-tuning approaches require substantial data and computation, while flat memory may retrieve failed actions without preserving their causal context or safety conditions. In this paper, we propose FRESH, a Failure-aware Retrieval framework over Experience-Structured Heterogeneous graphs, which transforms historical successes and failures into structured external experience for tool-using agents. By explicitly modeling the dependencies among tasks, actions, errors, repairs, and execution conditions, FRESH helps frozen language models reuse reliable strategies, avoid recurring failures, and make safer decisions in stateful tool interactions. Experiments on -Bench and AppWorld with multiple open-source models show that FRESH consistently improves task success and tool-use reliability over no-memory agents and representative memory-based baselines.
Create a lesson
Related papers
LinearSpec: Drafting from the Target's Memory for Long-Context Speculative Decoding in Hybrid Vision-Language Models
Shared title terminologycs.LGHaiyu Wang, Sai Qian Zhang, Steven Li
ReAgent: Closed-Loop Self-Healing for Open-Weight Tool-Calling Agents, from Structural Hallucinations to Decision Errors
Shared title terminologycs.LGCharlie Galvin, Katie Kitchen, Chiara Picardi
Explaining Knowledge Utilization in Heterogeneous GNNs for 3D Semantic Scene Graphs
Shared title terminologycs.LGTim Stelzner, Marian Renz, Felix Igelbrink et al.
Reinforcement Learning of Communication in a Mesh of Small Language Models
Shared title terminologycs.LGMehmet Kerem Turkcan
AutoResearch at Production Scale: Failure Modes and a Multi-Agent Framework
Shared title terminologycs.LGAparajith Chandran, Juwon Kim, Saurav Jha et al.
Graph-Based Inference and Topology-Aware Multi-Agent Reinforcement Learning for Large-Scale Railway Network Management
Shared title terminologycs.LGGiacomo Arcieri, Gregory Duthé, Christophe Muller et al.