[EMNLP '26] Dependency-Aware Structural Retrieval for Massive Agent Skills
$ npx -y skills add davidliuk/graph-of-skills --agent claude-code
What's inside
Graph of Skills builds a skill graph offline from a library of SKILL.md documents, then retrieves a small, ranked set of relevant skills at task time. Instead of flooding the agent context with an entire skill library, GoS surfaces only the skills most likely to help -- along with their prerequisites and related capabilities.
Retrieval pipeline:
GoS is evaluated on SkillsBench (87 dockerized coding tasks) and ALFWorld (140 episodes) across three model families. R = average reward (%), T = average total tokens (uncached input + cached input + output), S = agent-only runtime (s). ↑ higher is better, ↓ lower is better. All numbers are means over two runs per setting.
| Model | Method | SB R↑ | SB T↓ | SB S↓ | AW R↑ | AW T↓ | AW S↓ |
|---|---|---|---|---|---|---|---|
| Claude Sonnet 4.5 | Vanilla Skills | 25.0 | 967,791 | 465.8 | 89.3 | 1,524,401 | 53.2 |
| Vector Skills | 19.3 | 894,640 | 357.3 | 93.6 | 28,407 | 37.8 | |
| GoS (ours) | 31.0 | 860,315 | 364.9 | 97.9 | 27,215 | 49.2 | |
| MiniMax M2.7 | Vanilla Skills | 17.2 | 942,113 | 580.7 | 47.1 | 2,184,823 | 88.6 |
| Vector Skills | 10.4 | 852,881 | 552.9 | 50.7 | 66,109 | 73.4 | |
| GoS (ours) | 18.7 | 867,452 | 502.5 | 54.3 | 65,227 | 68.8 | |
| GPT-5.2 Codex | Vanilla Skills | 27.4 | 3,187,749 | 686.8 | 89.3 | 1,435,614 | 83.3 |
| Vector Skills | 21.5 | 1,243,648 | 773.0 | 92.9 | 34,436 | 57.0 | |
| GoS (ours) | 34.4 | 1,379,773 | 715.6 | 93.6 | 46,462 | 64.7 |
GoS achieves the highest reward on every model on both benchmarks while cutting total tokens by up to 56× (ALFWorld, Claude Sonnet 4.5) vs. Vanilla Skills.
Reward and cost as the repository grows (SkillsBench, GPT-5.2 Codex). T in millions of tokens.
| Skills | Method | R↑ | T (M)↓ | S↓ |
|---|---|---|---|---|
| 200 | Vanilla Skills | 32.5 | 1.85 | 701.6 |
| Vector Skills | 21.2 | 1.06 | 833.8 | |
| GoS (ours) | 32.1 | 1.36 | 731.2 | |
| 500 | Vanilla Skills | 26.0 | 1.93 | 756.8 |
| Vector Skills | 20.7 | 1.10 | 849.5 | |
| GoS (ours) | 31.4 | 1.16 | 890.3 | |
| 1,000 | Vanilla Skills | 27.4 | 3.19 | 686.8 |
| Vector Skills | 21.5 | 1.24 | 773.0 | |
| GoS (ours) | 34.4 | 1.38 | 715.6 | |
| 2,000 | Vanilla Skills | 26.7 | 5.84 | 733.5 |
| Vector Skills | 23.8 | 1.11 | 799.8 | |
| GoS (ours) | 31.3 | 1.14 | 788.0 |
From 500 skills onward GoS leads both baselines by 5.4, 7.0, and 4.6 reward points. Flat exposure rises from 1.93M to 5.84M tokens (~3x) across the same range while both retrievers stay near-constant — the scaling burden is in the prompt, not in retrieval.
Full SkillsBench, GPT-5.2 Codex, 1,000-skill library.
| Variant | R↑ | T (M)↓ | S↓ |
|---|---|---|---|
| Full GoS (reverse-aware PPR) | 34.4 | 1.38 | 715.6 |
| Forward-only PPR (γ_r = 0) | 25.3 | 1.20 | 742.7 |
| w/o graph propagation | 29.3 | 0.89 | 766.2 |
| w/o lexical + rerank | 26.7 | 1.01 | 747.7 |
Traversal direction matters more than the graph itself. Replacing reverse traversal with forward propagation costs 9.1 reward points — a larger loss than removing graph propagation entirely (5.1). The gain comes from traversing dependencies backwards, not from graph diffusion as such.
The table above compares full agent runs, which entangle the graph with hydration, reranking, and the agent interface. This budget-matched offline study holds seeding, reranker, top-N selection, character budgets, and hydration fixed across all arms, so only the graph operation changes (200-skill library, 87 queries).
| Retrieval operation | R_avail↑ | R_full↑ | C↑ | D↑ |
|---|---|---|---|---|
| Reverse-aware PPR (GoS) | 0.575 | 0.502 | 0.421 | 0.654 |
| Forward-only PPR (γ_r = 0) | 0.490 | 0.428 | 0.311 | 0.362 |
| No-Graph (matched flat) | 0.542 | 0.473 | 0.368 | 0.481 |
| One-Hop dependency | 0.542 | 0.473 | 0.368 | 0.481 |
R_avail / R_full = available- and full-oracle recall, C = exact bundle completeness, D = dependency-pair co-recovery. The same ordering reproduces at retrieval level: forward propagation is worse than not using the graph at all, and dependency-pair co-recovery falls from 0.654 to 0.362.
If you find this work useful, please cite the EMNLP 2026 version:
@inproceedings{liu2026graphofskills,
title = {Graph-of-Skills: Dependency-Aware Structural Retrieval for Massive Agent Skills},
author = {Liu, Dawei and Li, Zongxia and Du, Hongyang and Wu, Xiyang and
Gui, Shihang and Kuang, Yongbei and Sun, Lichao},
booktitle = {Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
year = {2026}
}
@misc{liu2026graphofskillsarxiv,
title = {Graph-of-Skills: Dependency-Aware Structural Retrieval for Massive Agent Skills},
author = {Dawei Liu and Zongxia Li and Hongyang Du and Xiyang Wu and
Shihang Gui and Yongbei Kuang and Lichao Sun},
year = {2026},
eprint = {2604.05333},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2604.05333}
}
uv (recommended) or pipgit clone https://github.com/davidliuk/graph-of-skills.git
cd graph-of-skills
uv sync
cp .env.example .env # then fill in your API keys
OPENAI_API_KEY=sk-...
# Use the ``openai/...`` prefix so LiteLLM targets the OpenAI API (omit OPENAI_BASE_URL).
GOS_EMBEDDING_MODEL=openai/text-embedding-3-large
GOS_EMBEDDING_DIM=3072
OpenRouter exact-response caching is enabled by default for reproducible retries during
indexing (GOS_OPENROUTER_RESPONSE_CACHE=true). Cached responses must be disabled or
isolated when repeated graph builds are intended to measure LLM construction variance.
OPENROUTER_API_KEY=<openrouter-key>
OPENAI_BASE_URL=https://openrouter.ai/api/v1
GOS_EMBEDDING_MODEL=openrouter/openai/text-embedding-3-large
GOS_EMBEDDING_DIM=3072
OPENAI_API_KEY=<azure-api-key>
OPENAI_BASE_URL=https://YOUR-RESOURCE.services.ai.azure.com/openai/v1
# Must match your **deployment name** in Azure (not necessarily ``text-embedding-3-large``).
GOS_EMBEDDING_MODEL=openai/<your-deployment-name>
GOS_EMBEDDING_DIM=<vector-dimension-for-that-model>
GEMINI_API_KEY=<your-key>
GOS_EMBEDDING_MODEL=gemini/gemini-embedding-001
GOS_EMBEDDING_DIM=3072
Goal: install the package, pull the published skill libraries, build (or download) a graph workspace, then run retrieval from the shell.
Read next: DATA.md for every download flag and asset size; .env.example for embedding providers. After GoS works locally, use evaluation/README.md for benchmark runners and evaluation/skillsbench/README.md for Harbor-based SkillsBench.
Complete Installation above: clone, uv sync, cp .env.example .env, and set embedding (and optional LLM) keys. Indexing and retrieval load .env from the repo root when you use uv run gos ….
The collections skills_200, skills_500, skills_1000, skills_2000 are directories of SKILL.md files on HuggingFace, not in git. They unpack to:
data/skillsets/skills_200/ … data/skillsets/skills_2000/FAQ
graph-of-skills is a Claude Code plugin with 2 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes graph-skills-retriever, vector-skills-retriever. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it