multi-agent-delegation
Skill0 starsChanged 6 months agoMITView on GitHub
Implements multi-agent delegation where an orchestrator agent hands off tasks to specialist agents via a tool call. Use when building a system where a triage or coordinator agent routes requests to domain-specific agents (e.g. billing, support, technical).
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ccoalm/ccl-skillstheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- ccoalm/ccl-skills★ 6same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/building-agents/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- adding-guardrailsSkill
- agent-health-timeoutSkill
- agent-permission-scopingSkill
- agent-session-isolationSkill
- agent-step-loggingSkill
- agent-supervisor-routerSkill
- agent-telemetrySkill
- async-agent-backgroundSkill
- building-agentsSkill
- building-teamsSkill
- building-toolsSkill
- calendar-scheduling-toolSkill
- callback-tracing-handlerSkill
- chain-of-thought-promptingSkill
- chat-model-configurationSkill
- code-execution-sandboxSkill
- common-agent-patternsSkill
- context-window-managementSkill
- conversation-memorySkill
- conversation-state-dbSkill
- database-query-toolSkill
- document-loadersSkill
- document-rerankingSkill
- email-notification-toolSkill
- embedding-model-ingestionSkill
- fallback-model-chainSkill
- few-shot-injectionSkill
- filesystem-toolSkill
- human-in-the-loopSkill
- hybrid-searchSkill
- inspecting-streamsSkill
- integrating-with-laurenSkill
- json-schema-enforcementSkill
- llm-provider-connectionSkill
- llm-rate-limitingSkill
- long-term-vector-memorySkill
- managing-memorySkill
- migrating-to-lauren-aiSkill
- multi-tool-orchestrationSkill
- multi-turn-tool-stateSkill
- output-guardrailsSkill
- plan-and-execute-agentSkill
- prompt-injection-defenseSkill
- prompt-versioningSkill
- rag-pipelineSkill
- react-agent-loopSkill
- response-validation-retrySkill
- rest-api-toolSkill
- securing-agentsSkill
- semantic-cacheSkill
- streaming-response-handlerSkill
- structured-output-parsingSkill
- sub-agent-spawningSkill
- system-prompt-templatingSkill
- testing-agentsSkill
- The first 60 shown.
The file
Files
Use
codemap find "SymbolName"to locate any symbol before reading — it gives exact file + line range and is faster than grep across the whole repo.
Multi-Agent Delegation & Handoff
Architecture
User → OrchestratorAgent
→ DelegateToSpecialist tool call (task="...")
→ SpecialistAgent.run(task)
→ returns {result: "..."}
→ OrchestratorAgent sees result
→ Final answer to userDefine the handoff tool
# tools.py — future annotations are allowed; keep tool types importable
from lauren_ai import tool, ToolContext
from lauren_ai._agents._runner import AgentRunnerBase as AgentRunner
@tool()
class DelegateToSpecialist:
"""Delegate a task to the SpecialistAgent.
Args:
task: The full task description for the specialist.
"""
def __init__(self, specialist, runner: AgentRunner) -> None:
self._specialist = specialist
self._runner = runner
async def run(self, ctx: ToolContext, task: str) -> dict:
response = await self._runner.run(
self._specialist,
task,
execution_context=ctx.execution_context,
)
return {"result": response.content}Important: The ctx parameter MUST be annotated as ToolContext so the framework detects
reads_context=True and injects it automatically. Without the annotation, ctx appears in the
LLM's JSON schema as a required string parameter, which prevents execution.
Tool naming: @tool() on a class converts the class name to snake_case.
DelegateToSpecialist → delegate_to_specialist. Use this name when queuing mock responses:
mock.queue_tool_use("delegate_to_specialist", {"task": "..."})Define agents
# agents.py — from __future__ import annotations IS safe here
from __future__ import annotations
from lauren_ai import agent, use_tools
from .tools import DelegateToSpecialist
@agent(model="claude-opus-4-6", system="You are a billing specialist.")
class BillingAgent: ...
@agent(model="claude-opus-4-6", system="Route requests to the right specialist.")
@use_tools(DelegateToSpecialist)
class OrchestratorAgent: ...Testing handoff
from lauren_ai._transport import Completion, TokenUsage
from lauren_ai._transport._mock import MockTransport
mock = MockTransport()
# Orchestrator decides to delegate
mock.queue_tool_use("DelegateToSpecialist", {"task": "Process refund for order #42"})
# Specialist's response (consumed by runner for the specialist)
mock.queue_response(Completion(
id="s1", model="mock-model",
content="Refund processed for order #42.",
tool_calls=[], stop_reason="end_turn",
usage=TokenUsage(input_tokens=10, output_tokens=8),
))
# Orchestrator's final answer after seeing delegate result
mock.queue_response(Completion(
id="o2", model="mock-model",
content="Your refund has been processed.",
tool_calls=[], stop_reason="end_turn",
usage=TokenUsage(input_tokens=20, output_tokens=10),
))Lauren DI wiring
from lauren_ai import LLMModule, AgentModule
from lauren import module
LLMProvider = LLMModule.for_root(cfg)
AIModule = AgentModule.for_root(
agents=[OrchestratorAgent, BillingAgent],
tools=[DelegateToSpecialist],
)
@module(imports=[LLMProvider, AIModule])
class AppModule: ...Reference files
| File | Contents |
src/lauren_ai/_agents/_runner.py | AgentRunnerBase.run() — accepts execution_context= |
src/lauren_ai/_tools/__init__.py | Class-form @tool(), ToolContext |
examples/banking-chatbot/ | Full handoff example with HandoffTo pattern |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

