agentscope-ai / agentscope-ai/agentscope

[Feature]: Explore Integration of Agent Skills with Automatic Tool Management via Progressive Disclosure

Ouverte
#1,055 4 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
stale-issue
Langage dominant
Python
Étoiles
31.5k
Forks
3.5k
Merge moyen
1 j 23 h
PR mergées (30 j)
95

Description

We aim to investigate and implement a tighter integration between **Agent Skills** and **Automatic Tool Management**, leveraging the concept of *progressive disclosure* to dynamically enhance agent capabilities. Specifically, when a skill is loaded, it should not only provide specialized context or instructions but also **automatically register relevant tools** and manage their lifecycle in alignment with the agent’s current state.

This approach draws inspiration from multi-agent systems where tools and state are tightly coupled—tools can update internal state, which in turn unlocks or modifies available capabilities. By combining skill loading with dynamic tool registration, we can enable more adaptive, modular, and efficient agents.

---

### Key Features to Support:

#### 1. **Dynamic Tool Registration with Skill Loading**
- When a skill (e.g., `database_admin`) is registered via `Toolkit.register_agent_skill()`, it should **automatically register a set of associated tools** (e.g., `backup_db`, `restore_db`, `migrate_schema`).
- These tools are only made available while the skill is active, supporting **on-demand capability expansion**.
- Tool registration should integrate with the agent’s state management system so that tool availability reflects the current skill context.

> *Example:*
> ```python
> toolkit.register_agent_skill("skills/database_admin")
> # Automatically registers database-specific tools and updates agent's toolset
> ```

#### 2. **Hierarchical (Nested) Skills**
- Skills should support a **tree-like structure**, where a parent skill (e.g., `data_science`) declares sub-skills (`pandas_expert`, `visualization`, `statistical_analysis`).
- Sub-skills can be **loaded independently or recursively**, enabling fine-grained control over knowledge and tool exposure.
- Each sub-skill may bring its own prompt fragments and toolset, contributing to a **composable agent architecture**.

> *Example directory structure:*
> ```
> skills/
> └── data_science/
> ├── __init__.py # Defines parent skill + sub-skill metadata
> ├── pandas_expert/
> ├── visualization/
> └── statistical_analysis/
> ```

#### 3. **Progressive Disclosure to the Model**
- The system prompt (via `get_agent_skill_prompt()`) should **only include prompts for currently active skills**, avoiding prompt bloat.
- Similarly, the agent’s available tool list should reflect **only tools from loaded skills**, ensuring the model isn’t overwhelmed by irrelevant options.
- This creates a **just-in-time disclosure** mechanism: capabilities are revealed as needed based on task context or user request.

---

### Proposed Enhancements to `Toolkit` API:

| Current API | Enhancement |
|------------|-------------|
| `register_agent_skill(skill_dir)` | → Optionally accept `auto_register_tools=True` (default: `True`) |
| | → Parse a `tools/` subdirectory or `skill_config.yaml` to discover and register tools |
| `remove_agent_skill(name)` | → Automatically deregister associated tools and clean up state |
| New: `load_subskill(parent, subskill_name)` | → Enable granular loading of nested skills |

---

### Expected Benefits:
- **Modularity**: Skills become self-contained units of capability (prompt + tools + state logic).
- **Scalability**: Large knowledge bases can be organized hierarchically and loaded on demand.
- **Efficiency**: Reduced token usage and cognitive load on the model through progressive disclosure.
- **Consistency**: Aligns with multi-agent patterns where tools and state co-evolve.

---

### Questions for Discussion:
1. Should tool registration be **implicit** (automatic upon skill load) or **explicit** (require user confirmation or configuration)?
2. How should conflicts be handled if two skills register tools with the same name?
3. Can we support **conditional tool activation** (e.g., only enable `migrate_schema` if DB version > X)?

---

**Related Concepts:**
- Anthropic’s Agent Skill framework
- ReAct-style agents with dynamic toolsets
- Multi-agent state-tool coupling patterns

**Next Steps:**
- Prototype dynamic tool registration tied to skill loading
- Design skill metadata format (YAML/JSON) to declare tools and sub-skills
- Update `get_agent_skill_prompt()` to support hierarchical prompt composition

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.