liveBook · Manning

Chapter 8: Decompose-Process-Recompose: Handling large inputs with accuracy

What you will learn in chapter 8 of Agent Design Patterns

This introduction explains why large inputs degrade model performance and how Decompose-Process-Recompose (DPR) produces one reliable answer by analyzing smaller fragments and combining the results.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction explains why large inputs degrade model performance and how Decompose-Process-Recompose (DPR) produces one reliable answer by analyzing smaller fragments and combining the results.

Key terms: lost in the middle, downsampled, growing context, needle-in-a-haystack, Decompose-Process-Recompose (DPR), divide and conquer, spatial decomposition, temporal decomposition, semantic decomposition, technical decomposition

8.1 The pain point: Large inputs creating inaccurate, unreliable, and fragmented output

This section explains why DPR uses divide-and-conquer to make work across large inputs more accurate and reliable.

Key terms: worker IE, effective perception window, divide-and-conquer, DPR

8.2 How the DPR pattern works

This section explains how DPR handles large inputs by splitting them into fragments, processing each fragment, and recombining the results into a coherent output.

Key terms: DPR, decomposition, processing, recomposition, worker IE, effective perception window, isomorphic or near-isomorphic decompositions, processing injectivity, fragments, many-to-one compositionality

8.2.1 Tradeoffs

This section weighs DPR’s possible gains in robustness, latency, and interpretability against its per-fragment processing cost.

Key terms: DPRs, robustness, constant overhead per fragment, latency, parallelized, interpretability

8.2.2 Implementation sketch

This section sketches the Decompose-Process-Recompose workflow and explains why some implementations cannot process fragments in parallel.

Key terms: Decompose-Process-Recompose, decomposer, fragments, asynchronous processing, global context, parallel processing, input fragments

8.2.3 When and where to use DPR

This section identifies three situations suited to DPR: detail-sensitive analysis of large inputs, information-preserving transcription, and mixed-modality processing.

Key terms: large-input analysis, DPR, large-input transcription, smoothing, boundaries of fragments, compaction errands, mixed-modality input processing, decomposer, processing IE, recomposer

8.2.4 How DPR works with other patterns

This section distinguishes DPR from Voter and Orchestrator by what it splits and how much coordination it performs.

Key terms: DPR, Voter, fragments, voting trajectories, worker IE, Orchestrator, dispatch, synchronization, recomposition

8.3 DPR pattern Variants

Introduces DPR variants as hybrid uses of parts of the three-stage pattern rather than substantial changes to the pattern itself.

Key terms: Decompose-Process-Recompose, Decompose-Process, Process-Recompose, hybrid pattern instances, Voter, Orchestrator

8.3.1 Decompose-Voter

This section explains how Decompose-Voter turns a large input into one representative result by voting across results from its fragments.

Key terms: Decompose-Voter, Decomposer, worker IE, Process, Recompose, Voter, categorical or numerical response, sentiment-like quality, representative rating, large-scale classification

8.3.2 Decompose-Retriever

This section explains how Decompose-Retriever makes a large, previously unindexed input searchable so an agent can find the information needed for a query without processing the whole input.

Key terms: Decompose-Retriever, Decomposer, Retriever, searchable fragments, on-demand database creator, low information density, needle-in-a-haystack, processor IE’s perception window, high precision

8.3.3 Retriever-Process-Recompose

This section explains how Retriever-Process-Recompose turns selected knowledge-base fragments into a unified answer without processing the entire database.

Key terms: Retriever-Process-Recompose, Retriever, Decomposer, Processor IE, Recomposer, pre-filters, deep research tools, in-house document search tools, complex Q&A systems

8.4 DPR in action: Use-case examples

8.4.1 Map-reduce document summarization

This section shows how map-reduce summarization applies DPR to documents too large for one effective model call.

Key terms: map-reduce, decomposer, processor, recomposer, overlapping chunks, executive summary, effective context window, lost-in-the-middle phenomenon

8.4.2 Multi-modal content extraction

Shows how DPR extracts information from a document containing text, tables, and charts by processing each modality appropriately and combining the results.

Key terms: mixed-modality inputs, text-only IE, vision-language model, modality splitter, standard LM, specialized VLMs, OCR engines, recomposer, structured JSON or Markdown report

8.4.3 Smoothened sequential translation

This section shows how DPR translates a long manuscript while keeping terminology and style consistent across chapter boundaries.

Key terms: sequential fragments, global glossary, rolling state, named entities, stylistic choices, unidirectional pairwise smoothing, recomposition, stable, already-processed chunk, (n+1)-st fragment

8.5 Summary

The section recaps how DPR handles large inputs by processing manageable fragments and recomposing them into a coherent answer, then names its variants and use cases.

Concepts explained in this chapter

← Chapter 7: Retriever: Returning more relevant results Chapter 9: Router: Classifying and dispatching →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.