A pipeline moves work through ordered stages. In an agent-to-agent pipeline, one agent finishes before the next begins and passes its output downstream. This suits tasks whose order is known in advance. section 4.1.3
A sequence of prompt steps is called prompt chaining. An agent pipeline goes further: each agent can make decisions and use tools, while passing a concise, typed result to the next agent. Use deterministic checks where a pass/fail decision must be repeatable. section 2.4 section 4.6
An ingestion pipeline
In retrieval-augmented generation (RAG), ingestion prepares a supplied document, such as a PDF, for later questions: load it, transform it into context chunks, embed the chunks as vectors, then store them in a searchable vector database. Retrieval is a separate phase: it finds relevant chunks and supplies them as context for an answer. These are ordered processing stages, not necessarily separate agents. section 6.1.1
Table 4.4 Architectural patterns overview
| Pattern |
When to use |
When not to use |
|---|---|---|
| Sequential pipeline, agent to agent |
Well-defined, ordered tasks need to be executed in sequence. |
Not all agents need to be executed every time. |
| Parallel delegation |
Multiple tasks or agents can be executed in parallel to improve performance. |
|
| Hierarchical coordination |
The user interface agent delegates to multiple agents on behalf of the user. |
No need for complex decision-making or command of agents |
| Iterative debate and refinement |
You want to review and double- or triple-check responses. |
The problem is trivial or aligns well with simple execution. |
| Voting/best-of-N (ensemble) |
Ambiguous problems that may have multiple interpretations or facets |
Unambiguous problems |
| Role-playing collaboration |
High creativity and novel outputs are desired and align well with the principal goals. |
Real-time systems or cases with low desired creativity |
| Conditional routing (branching) |
Customer support systems that may require human approvals or intervention |
|
| Peer-to-peer network |
Decentralized command increases system robustness and reduces or eliminates complete failure. |
Use the pattern comparison to check whether an ordered pipeline fits. If some agents need not run every time, consider a different coordination pattern. section 4.1.3
Start with the simplest flow that works. Add parallel execution, delegation, or review loops only when the task calls for them; protect transfers between agents with validation so bad data does not travel downstream. section 4.1.3 section 4.6















































