CaSKG: Counterfactual-Causal Skill Graphs for Scalable Agent Skill Retrieval
Organizations: School of Artificial Intelligence, Jilin University Ant Group Changchun, China · Ant Group Hangzhou, China
Abstract
Reusable skill libraries allow large language model (LLM) agents to reuse procedural knowledge across tasks, but they also turn memory access into a challenging retrieval problem. Full-library prompting preserves coverage at high context cost, vector retrieval returns compact neighborhoods but treats skills as independent text, and graph-based retrieval can recover workflow context only when the edges that carry relevance are reliable. We propose CaSKG, a counterfactual-causal skill graph framework that calibrates procedural relations before retrieval. CaSKG first builds a high-recall directed candidate graph from semantic, lexical, input/output, and structural evidence, with repair evidence and an optional LLM judge further refining candidate scores. It then applies direction-conditioned textual counterfactual probes that remove, substitute, and reorder skill pairs, aggregates the evidence with Bayesian smoothing, and publishes a state-filtered weighted graph for task-conditioned expansion. The graph is constructed offline and used without changing the downstream agent policy or task interface. Across six LLM backbones on ALFWorld ID-140 and ScienceWorld U211, CaSKG achieves the highest task score in all twelve combinations of model and benchmark. Relative to Graph-of-Skills (GoS), it improves the six-model macro-average ScienceWorld score from 72.62 to 80.50 and ALFWorld success from 80.01% to 86.79%, while reducing mean environment steps on both benchmarks. Qualitative and ablation analyses further show that calibrated edges help retrieval preserve prerequisites, state-changing actions, verification routines, and final completion steps. These results position edge-confidence calibration as an effective route to compact and executable skill retrieval at scale\footnote{Code is available at: https://github.com/ZhiyuanLi218/Caskg }.
Figures & tables
| Model | Method | ALFWorld ID-140 | ScienceWorld U211 | ||
|---|---|---|---|---|---|
| Steps | Steps | ||||
| MiniMax-M2.7 | Vanilla | 42.90 | 22.54 | 45.90 | 21.73 |
| Vector | 45.70 | 22.84 | 43.21 | 21.45 | |
| GoS | 63.60 | 19.69 | 55.85 | 18.91 | |
| CaSKG | 73.57 | 18.44 | 68.33 | 17.45 | |
| GLM-5.2 | Vanilla | 95.00 | 11.05 | 75.50 | 17.03 |
| Model | Skills | Steps | ||||
|---|---|---|---|---|---|---|
| CaSKG | GoS | CaSKG | GoS | |||
| MiniMax-M2.7 | 200 | 57.14 | 50.00 | +7.14 | 20.73 | 22.21 |
| 500 | 67.86 | 45.00 | +22.86 | 19.95 | 23.07 | |
| 1,000 | 73.57 | 63.60 | +9.97 | 18.44 | 19.69 | |
| 2,000 | 70.00 | 54.29 | +15.71 | 18.71 | 21.32 | |
| Qwen3.5-397B- A17B | 200 | 85.00 | 76.43 | +8.57 | 14.50 | 16.25 |
| Variant | Steps | ||||
|---|---|---|---|---|---|
| Full CaSKG | 9,937 | 500 | 3,292 | 73.57 | 18.44 |
| Semantic-only | 3,982 | 500 | 2,698 | 67.14 | 19.21 |
| w/o LLM judge | 9,753 | 500 | 3,188 | 71.43 | 18.79 |
| Publish all candidates | 9,937 | 0 | 9,937 | 71.43 | 18.74 |
LLM Agent Skill Retrieval
Large language model agent skill retrieval finds and selects reusable procedures to help agents complete tasks.
See all 102 papers