Dependency-Aware Skill Retrieval
Retrieve from a large skill library by returning each relevant skill together with its prerequisite dependency closure as an ordered subgraph, so the bundle the agent receives is executable rather than topically relevant but incomplete.
Problem
Semantic similarity surfaces the skills that look relevant to the request, but it is blind to the dependency structure between them. A retrieved skill whose prerequisites were not also retrieved fails at execution time, and the agent either errors out or wastes turns rediscovering the missing upstream skill. The more compositional the task, the wider this prerequisite gap grows, because each retrieved skill silently assumes others that ranking never surfaced.
Solution
Represent the skill library as a graph whose nodes are skills and whose typed edges record prerequisite, enhancement, and co-occurrence relations. Retrieval runs in two stages: a semantic stage ranks skills against the request as usual, then a graph stage expands each candidate along prerequisite edges to gather the skills it depends on, bounding the expansion so the bundle stays within budget. The combined set is returned in topological order, so every skill appears after the skills it needs, and the agent receives a runnable plan rather than a flat list of lookalikes. Enhancement and co-occurrence edges can widen the bundle when budget allows, but prerequisite edges are followed first because they are what make the bundle execute.
When to use
- The skill or tool library is far larger than the context window, forcing a retrieval step.
- Skills are compositional: higher-level skills depend on lower-level ones that ranking would not surface on its own.
- A dependency graph over the skills can be built and kept current.
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.