AsyncThink enables truly parallel multi-agent collaboration by identifying independent sub-tasks that can be executed concurrently. Using fork/join patterns and critical path analysis, AsyncThink achieves significant speedups on complex problems requiring coordination.
Awareness supports AsyncThink patterns through Temporal workflows:
- Main workflow forks child workflows for independent sub-tasks
- Each child runs in parallel (different Temporal workers)
- Main workflow waits for all to complete (join)
- Results aggregated and synthesized
- LLM analyzes task for independent sub-problems
- Build dependency DAG (directed acyclic graph)
- Identify critical path (longest dependency chain)
- Execute non-critical paths in parallel
- Longest chain determines minimum completion time
- Optimize by:
- Parallelizing non-critical paths
- Caching common sub-problems
- Early termination if critical path fails
- Metric: Speedup = Sequential_Time / Parallel_Time
- Measures effectiveness of parallelization
- Used to learn when to fork vs. stay sequential
// AsyncThink in Awareness Temporal workflows
async function orchestrateWithAsyncThink(task: Task) {
// Analyze dependencies
const subTasks = await llm.decompose(task);
const dag = buildDependencyDAG(subTasks);
const criticalPath = findCriticalPath(dag);
// Fork independent sub-tasks
const childWorkflows: Promise<Result>[] = [];
for (const subTask of subTasks) {
if (!criticalPath.includes(subTask)) {
// Can run in parallel
childWorkflows.push(
executeChild({
workflowType: "agentWorkflow",
args: [subTask]
})
);
}
}
// Execute critical path sequentially
const criticalResults = await executeCriticalPath(criticalPath);
// Join: wait for parallel tasks
const parallelResults = await Promise.all(childWorkflows);
// Synthesize final result
return synthesize([...criticalResults, ...parallelResults]);
}Asynchronous agent orchestration foundation - parallel agent execution