liveBook · Manning

Recomposition

As explained in Agent Design Patterns

The unification of outputs from separate processing steps into a final response that reflects the original task's global context.

A large archive may contain the answer to a precise question, yet processing it all at once can cause omissions or inaccurate retrieval. Splitting the archive lets each piece fit the processor, but creates a new problem: fragment-level results are not yet an answer to the original task. Recomposition solves that final problem by gathering those results and producing one response. section 8.0 section 8.2

Recomposition is the last stage of Decompose-Process-Recompose (DPR). A decomposer divides the input into fitting fragments; a processor handles each fragment and emits an intermediate result; a recomposer merges the results. The merge may be procedural, handled by an intelligent entity (IE), or, in some cases, handled by a Retriever. section 8.2

A recomposer has several design obligations:

  • Work from the outputs of a decomposition that preserves enough information for the pieces to be reassembled nearly or completely. section 8.2
  • Combine multiple processed outputs into reduced information relevant to the original input; a processor may have extracted only one facet, such as a classification, from each fragment. section 8.2
  • Conceal the fragmentation: the final response should not read like an unedited stack of separate fragment results. section 8.2
Figure 8.1 The AFD of the DPR pattern. The input is first decomposed into fragments. Each fragment is then fed to an instance of the processor IE, which produces an intermediate result per fragment. The intermediate results are then gathered and passed into the recomposer, which produces the final result.

The diagram shows where recomposition begins: after a processor has produced an intermediate result for every fragment and those results have been gathered. section 8.2

Map-reduce document summarization

For a document too large to process reliably in one pass, process fitting fragments into intermediate summaries, then merge those summaries into a single document-level result. The merge is the recomposition step, not another independent summary of one fragment. Related uses include multimodal content extraction and sequential manuscript translation. section 8.0 section 8.2

How Agent Design Patterns covers it

How deep it goes
Defines the result flow and recomposer options, but stops short of a code-level implementation.
Examples
Uses map-reduce document summarization, multimodal content extraction, and sequential manuscript translation as applications.
What you can do after
Build it from scratch by gathering fragment outputs and merging them procedurally or through an IE into a final result.
How it connects
Links decomposition, fragment processing, retrieval, and map-reduce document summarization.

This explainer was generated by Manning's knowledge graph from the text of Agent Design Patterns. The section links point to the parts of the book it draws on.