Aggregating results from workers
As soon as a manager agent starts delegating work, it also takes on a new responsibility: making sense of what comes back. Individual workers may each complete a narrow task, but the system only becomes useful when those results are gathered and understood together. Aggregating results is how a manager turns many small pieces of work into a coherent decision.
Receiving results from worker agents
In a manager–worker system, workers report back when they finish a task. This report might arrive as a function return value, a message, or a written artifact. What matters is that the manager treats each response as an explicit result, not as informal text to be read by a human.
At this point, the manager’s role shifts from delegation to interpretation. It listens for completed work and prepares to collect it.
Representing worker outputs in a structured form
Once a result is received, it needs to be stored in a form the program can reason about. This usually means using structured data such as dictionaries or lists, rather than free-form strings.
A common pattern is to associate each worker with its output:
results = {
"content_worker": "<html>...</html>",
"summary_worker": "Mars has two moons.",
}
Structured representations make it clear which result came from which worker, and they allow later steps to access specific pieces without guesswork.
Combining multiple results into a single outcome
Aggregation is the act of combining individual outputs into something more useful than the parts alone. This might mean assembling fragments into a single document, merging data structures, or selecting the most relevant pieces.
For example, a manager might combine page fragments into one HTML page:
page = header + body + footer
The key idea is that aggregation produces a new artifact or decision that did not exist at the worker level.
Handling partial or incomplete results
Not every worker will always return a result. Some tasks may be skipped, delayed, or fail in a controlled way. The manager must be prepared to aggregate what it has, without assuming that every expected result is present.
This often means checking for missing entries before combining them:
if "content_worker" in results:
page_body = results["content_worker"]
Partial aggregation keeps the system moving forward instead of stalling when one piece of work is unavailable.
Using aggregated results to guide further decisions
Once results are aggregated, they become input to the manager’s next decision. The combined outcome might determine whether more work is needed, which task to assign next, or whether the overall goal has been reached.
At this level, the manager is no longer thinking in terms of individual workers. It is reasoning about the system’s progress as a whole, based on the aggregated view.
Conclusion
By receiving structured outputs, combining them carefully, and tolerating incomplete work, a manager agent can turn many independent actions into a single, meaningful outcome. At this point, the manager is no longer just coordinating effort—it is using the results of that effort to decide what happens next.