Lesson 08.09 · Phase 08 · Multi-Agent Systems
Parallel fan-out, fan-in
Sending 24 independent subtasks to workers at once should take as long as the slowest one, not the sum. In practice the slowest one is very slow, the provider caps how many requests you can have in flight, and the results don't fit in one context. Fan-out needs limits and a plan for the tail; fan-in needs a plan for size.
Learning objectives
- Bound concurrency to the provider's limit, and show why going over it wastes calls without saving time.
- Handle tail latency with per-task timeouts, hedged requests and quorums, and state what each trades away.
- Isolate failures and timeouts per subtask so one bad item doesn't sink the batch.
- Reduce many results into one answer with a tree when they don't fit the synthesiser's window.
Lesson 2's orchestrator fanned out to three workers. Real batches are bigger: summarise 24 documents, check 50 suppliers, review 200 pull requests. The obvious code (start everything, wait for everything) breaks in four ways:
Loading the full lesson…