Emrehan Görgeç
Agentic design patterns · Lesson 2 of 7All lessons

Parallelization

Do independent work at once

Some tasks contain parts that do not depend on each other. Running them one after another only adds waiting time.

Parallelization sends several model calls at the same time and combines their outputs in code. It has two common forms.

1. Sectioning: split the work

Each call handles a different part of the task. For example, one call checks a pull request for security issues, another for performance, and another for style.

FAN OUT, THEN COMBINE
Review one pull request
Security

Look for unsafe input handling and leaked secrets.

Runs at the same time
Performance

Look for slow queries and repeated work.

Runs at the same time
Style

Check naming, structure, and tests.

Runs at the same time
Code combines the three reviews into one
The three reviews do not need each other, so they can run in parallel.

2. Voting: ask more than once

Several calls answer the same question, and you compare the results. Agreement increases confidence. Disagreement is a signal to check more carefully or ask a person.

3. Combine in code

Decide how results are merged before you start: join them, take the majority, or keep the strictest verdict. Also decide what happens if one call fails or times out.

When is it useful?

When parts of the task are truly independent, or when one answer is not reliable enough on its own. It costs more calls, so use it where speed or confidence matters.