Search⌘ K
AI Features

Parallel Workflow

Explore how to optimize AI agent workflows by using parallel execution to run independent tasks simultaneously, followed by sequential steps. Understand the design of hybrid workflows combining ParallelAgent and SequentialAgent to build efficient, scalable multi-agent systems.

We have successfully constructed a reliable research pipeline using the SequentialAgent to guarantee a predictable, step-by-step workflow. This was a crucial step in engineering a robust application. However, professional-grade systems are not only reliable but also efficient. In this lesson, we will focus on optimizing our agent’s performance.

We will introduce the ParallelAgent as a powerful tool for running independent tasks concurrently. By identifying opportunities for parallelism within our workflow, we can significantly reduce the total time our agent takes to complete its job. This lesson will guide us through refactoring our pipeline into a more sophisticated, hybrid architecture that is both reliable and highly efficient.

Optimizing our pipeline with parallel execution

To find opportunities for optimization, we must analyze the dependencies within our process. Our current research process involves two primary information-gathering tasks: searching Wikipedia for a general overview and searching arXiv for academic papers. A key insight is that these two tasks are completely independent of each other. The agent does not need to wait for the Wikipedia summary before it can start searching for papers on arXiv, and vice versa.

Executing these independent tasks one after the other is inefficient. We can refactor our pipeline to take advantage of this independence by running them at the same time. This leads us to a more advanced, hybrid workflow model:

  1. Parallel research: We will ...