-
-
Notifications
You must be signed in to change notification settings - Fork 749
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Summary
The current DynamicSkillsLoader and Agent.handle_skills() implementation claims to support Anthropic's tiered progressive skill loading (Tier 1: metadata only → Tier 2: full content on demand), but in practice no progressive loading actually happens. All matched skills have their full content injected into the system prompt in a single step.
Current Behavior
When agent.run(task) is called:
handle_skills(task)is invokedDynamicSkillsLoader.load_relevant_skills(task)computes cosine similarity and filters skills- All matching skills' full content is immediately concatenated into
system_prompt
The load_full_skill(skill_name) method exists as a public API but is never called internally — it's an orphaned method with no integration into the agent's execution pipeline.
Expected Behavior (True Progressive Loading)
A proper tiered implementation would look like:
- Tier 1 (initialization): Only inject skill
name+descriptioninto the system prompt, keeping it lightweight - Tier 2 (runtime, on-demand): When the agent determines a skill is needed during conversation, dynamically load the full SKILL.md content via
load_full_skill()and append it to the context
This requires a mechanism for the agent to "request" a skill at runtime (e.g., a tool/function call), which is currently missing.
Why This Matters
- Token waste: Loading all full skill content upfront bloats the system prompt, especially with many skills
- Context window pressure: For agents with many skills, this can consume significant context unnecessarily
- Documentation mismatch: The docs and code comments reference "Tier 2 progressive disclosure" but the implementation doesn't deliver it
Relevant Code
swarms/structs/dynamic_skills_loader.py—DynamicSkillsLoaderclassswarms/structs/agent.py—handle_skills(),_load_dynamic_skills_for_task(),load_full_skill()
Suggested Approach
- In Tier 1 mode, only append a skill summary (name + description) to the system prompt
- Expose
load_full_skillas an agent tool/function that the LLM can call mid-conversation - When the LLM invokes the tool, load and inject the full skill content into the context dynamically
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers