/pattern/social/flow/

Social category

Flow

How steps wire together in code — sequential, routing, parallel, orchestration.

Sequential Pipeline

Fixed steps. No back-edges.

Multiple steps are executed in a fixed order, where each step utilizes the output of the previous one.

Trade-off High control-flow predictability is gained at the cost of low flexibility; output content is still non-deterministic at every LLM node.

Routing

Classify once. Dispatch to the right specialist.

A classification or decision module classifies a request and dispatches it to specific targets, such as a specialized prompt, agent, or tool.

Trade-off More precise handling is achieved at the expense of additional decision logic and the risk of misclassification.

Parallelization

Split the work. Run in parallel. Merge the results.

Independent subtasks are processed in parallel and either merged (sectioning) or the best result is selected via an aggregator (voting).

Trade-off Lower latency and higher robustness are gained against increased integration complexity and multiple execution costs.

Loop

Repeat until good enough, or budget runs out.

One or more steps are repeated until a specific budget, quality bound, or exit condition is reached.

Trade-off Adaptive improvement is achieved at the risk of endless or highly expensive execution loops.

Evaluator-Optimizer

Generate. Judge. Improve. Repeat.

A generator produces a result, an evaluator scores it against specific criteria, and the generator optimizes it based on the feedback.

Trade-off Better output quality is gained against additional evaluation complexity and latency.

Iterative Refinement

One artifact. Many passes. Each better than the last.

Controlled passes improve a single artifact across revisions, often using explicit feedback from rules, tests, or users.

Trade-off Improved artifact quality is achieved at the expense of longer runtimes and potential thematic drift.

Orchestrator-Workers

Decompose. Dispatch. Fold.

An orchestrator dynamically decomposes a task and assigns subtasks to specialized workers, managing the aggregation centrally.

Trade-off Highly flexible delegation is gained against significant coordination and integration overhead.

Map-Reduce

Map over chunks. Reduce to one answer.

A large task is mapped over independent chunks and subsequently aggregated or reduced into a single result.

Trade-off Excellent scaling capabilities are achieved against the risk of generating inconsistent partial results.

Resource-Aware Optimization

Route by difficulty. Pay for what the task needs.

A router scores each request's complexity and dispatches it to the cheapest model that still meets the quality bar, under explicit token, time, and cost budgets, using prompt caching and model cascades.

Trade-off Large cost savings are gained against the effort of tuning and continuously validating the complexity rubric.

Search

Search patterns, frameworks, and pages.