Aller au contenu principal

Sous-agents

Définition

Les sous-agents sont des agents qui se situent dans une hiérarchie: a parent agent delegates sub-tasks to child agents (subagents), qui peuvent à leur tour déléguer à d'autres subagents. Cela structure la complexix work and keeps each agent focused.

Ils sont un moyen d'implémenter des systèmes multi-agents avec une chaîne claire de responsabilitty. The root agent owns the user-facing goal; subagents handle focused sub-tasks (par ex. récupération, code execution, validation). Often used with spec-driven development or RDD so subagents receive and follow specs.

Comment ça fonctionne

L'agent racine reçoit la tâche, la divise en sous-tâches et les attribue au Subagent1, Subagent2, etc. (par rôle ou capacité). Chaque subagent exécute sa propre boucle (possiblement avec des outils et un LLM) and returns results to the root. The root aggregates results (par ex. merges, selects, or passes to another subagent) and either continues the loop or returns to the user. Subagents can be specialized (par ex. récupération, code, critique) and use the same or different models. Clear contracts (inputs/outputs or tools) and error handling make the hierarchy debuggable and reusable.

Cas d'utilisation

Subagents aident quand une tâche se divise naturellement en sous-tâches ciblées pouvant être déléguées et agrégées.

  • Root agent delegating récupération, generation, and validation to subagents
  • Complex workflows (par ex. research, code review) with focused sub-tasks
  • Reusing the same subagent in different parent workflows

Documentation externe

Avantages et inconvénients

ProsCons
Clear separation of concernsCoordination and latency
Scalable to complex tasksNeed clear contracts and error handling
Reusable subagent capabilitiesDebugging across hierarchy can be hard

Voir aussi