Reusable skill libraries let large language model (LLM) agents apply procedural knowledge across tasks, but they turn memory access into a retrieval challenge. Full-library prompting is costly, vector retrieval treats skills as independent, and graph-based methods depend on reliable edges. Researchers propose CaSKG, a counterfactual-causal skill graph framework that calibrates procedural relations before retrieval.
CaSKG builds a high-recall directed candidate graph from semantic, lexical, input/output, and structural evidence, with repair evidence and an optional LLM judge refining scores. It then applies direction-conditioned textual counterfactual probes that remove, substitute, and reorder skill pairs, aggregates evidence with Bayesian smoothing, and publishes a state-filtered weighted graph for task-conditioned expansion. The graph is built offline and does not alter 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 model-benchmark combinations. Compared 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 show that calibrated edges help retrieval preserve prerequisites, state-changing actions, verification routines, and final completion steps. The results position edge-confidence calibration as an effective route to compact and executable skill retrieval at scale. Code is available on GitHub.