Memory hook: Explicit handoffs, bounded loops, shared contracts.
Must remember
- Sequential agents handle ordered dependencies; parallel agents handle independent work; graph workflows express branching and joins. Use the simplest orchestration that meets the task.
- A coordinator delegates bounded responsibilities and combines results. Peer-to-peer designs need explicit ownership, termination and conflict handling so agents do not endlessly hand work back and forth.
- MCP commonly connects agents to tools/context; A2A supports interaction between agent systems. Protocol compatibility does not replace authentication, authorization or input validation.
- Use typed handoff payloads with task identity, allowed scope, state references and completion criteria. Avoid copying entire private conversations to every worker.
- Cap recursion, tool calls, concurrent work, token budgets and elapsed time. Retry transient failures with limits; propagate cancellations and avoid repeating non-idempotent operations.
- Agent Runtime, identity, registry and policy capabilities provide managed building blocks. Preserve correlation identifiers across agents and tools so partial failure can be reconstructed.
Review details
Design the handoff as a contract: task ID, scoped authorization, minimal necessary context, state references, output schema and completion criteria. Parallel workers need a merge/conflict policy; sequential workflows need explicit dependency failure and cancellation. A repeated tool call after a timeout may already have changed external state, so retries need idempotency or reconciliation.
For protocol questions, remember MCP connects tools/context, while A2A supports agent-system interaction. Neither is automatically a trust boundary. Authenticate endpoints, constrain forwarded credentials and avoid distributing an entire user's private session to every subordinate agent.
Choose under exam pressure
| Requirement | Choice and reason |
|---|---|
| Three independent research tasks | Bounded parallel execution followed by evidence-aware consolidation. |
| An action must wait for approval | An explicit workflow gate before the authorized tool call. |
Traps
- A successful subagent response is not proof that its external action succeeded.
- Shared memory without ownership rules can create races and data leakage.
Active recall
1. When is sequential orchestration appropriate?
When one step needs verified output from the previous step.
2. What prevents endless delegation?
Termination criteria, depth/time budgets and clear ownership.
3. Why propagate cancellation?
To stop unnecessary cost and avoid side effects after the task is abandoned.
4. What should a handoff include?
Minimal required context, scope, expected output and success/failure criteria.
5. Why use idempotency across agents?
Retries and duplicate handoffs must not repeat a business transaction.