SuperAPI AI Directory

multi-agent-patterns

Agents & models

View repository

Updated 10-16 06:02

About this skill

🐝 Multi-Agent Architecture Patterns

This skill enables designing and coordinating systems composed of multiple instances of language models (agents), each with its own context window. Multi-agent architecture is the definitive solution for tasks whose complexity exceeds the reasoning capacity of a single saturated context.

Mental Model: Sub-agents are not just roles ("researcher", "writer"); they are context isolation units. Their main purpose is to partition knowledge to maintain a high signal density at each step of the process.

🚩 Fragility and Autonomy

  • Fragility: High. Poorly designed coordination introduces massive latency and information loss ("telephone game" effect).
  • Freedom: Very High in choosing the orchestration pattern according to the nature of the task.

🚀 When to Activate

  • When a task requires handling multiple technical domains simultaneously.
  • To parallelize independent sub-tasks (e.g., research 5 libraries at once).
  • When noticing that the main agent gets distracted or "hallucinates" due to the noise of accumulated context.
  • To implement adversarial review and critique processes (Debate Pattern).

🧠 Architecture Patterns

1. Supervisor / Orchestrator

A central agent controls the flow, decomposes the task, and delegates to specialists.

  • Use: Tasks with clear sequential steps and a need for human supervision.
  • Risk: The supervisor becomes a context bottleneck.

2. Peer-to-Peer / Swarm

Agents pass control directly to each other through "handoff" protocols.

  • Use: Flexible exploration, customer support, dynamic workflows.
  • Advantage: Eliminates the supervisor's paraphrasing bias.

3. Hierarchical

Layer structure: Strategic -> Planning -> Execution.

  • Use: Massive projects, large-scale code migrations, monorepo management.

🛠️ Implementation in Gemini Elite Core

Pattern: The Direct Pass-Through (Fixing the Telephone Game)

Prevents the supervisor from summarizing the worker's output. Use a tool forward_to_user so that the specialist speaks directly.

<TOOL_CALL: forward_to_user>
{
  "message": "[Contenido técnico crudo y preciso generado por el especialista]",
  "reason": "Evitar pérdida de fidelidad en la síntesis del supervisor."
}
</TOOL_CALL>

Pattern: Parallel Research Swarm

Launch N agents in parallel and consolidate their findings into a "findings" file.

  1. Planner: Creates N research tasks.
  2. Workers: Execute in parallel on isolated sandboxes.
  3. Consolidator: Reads all results and generates the final report.

🔗 Integrations

  • context-optimization: Multi-agent partitioning is the purest form of optimization.
  • memory-systems: Use of shared memories (Durable Objects, Disk) for coordination.
  • evaluation: Validation of synthesis quality between agents.

📚 Internal References

  • references/frameworks.md: Technical implementation details for LangGraph, AutoGen, and CrewAI. Consensus and failure recovery patterns.