Implementation:Diagram of thought Diagram of thought Summarizer Validated Node Synthesis
Overview
This page describes the concrete pattern for implementing final answer synthesis using the <summarizer> role in the Diagram of Thought framework. The summarizer aggregates only validated propositions into a coherent final answer, emitting explicit node citations via @node and @edge kind=use records.
Description
The summarizer synthesizes from validated nodes only. It creates its own @node record with role=summarizer and emits one @edge kind=use record for each validated source node it draws upon. This produces an auditable provenance chain: every claim in the final answer can be traced back to the specific validated proposition that supports it.
The key constraints of this pattern are:
- The summarizer must not reference invalidated or unexamined nodes.
- Each source dependency must be declared with an explicit
@edgerecord. - The summarizer's node ID must be greater than all source node IDs (preserving DAG acyclicity).
Usage
Use this pattern after convergence assessment confirms that reasoning is complete -- that is, when the propose-critique cycle has resolved all open questions and the set of validated propositions is sufficient to construct the final answer. This is the terminal step in the DoT process.
Code Reference
Source
prompts/iterative-reasoner.md:L29-34-- Summarizer role instructionsREADME.md:L93-97-- Minimal template summarizer block
Signature
The summarizer synthesis pattern consists of three elements: a natural-language synthesis block, a node declaration, and edge declarations linking to each validated source.
<summarizer>
[Coherent natural-language answer synthesized from validated propositions, citing node IDs]
@node id=N role=summarizer
@edge src=V1 dst=N kind=use
@edge src=V2 dst=N kind=use
...
Where:
Nis the summarizer's node ID (must be greater than all referenced source IDs)V1, V2, ...are the IDs of validated proposition nodes
Import
No import required. This is a prompt pattern -- it is enacted by including the summarizer instructions in the system prompt or few-shot template. The LLM generates the @node and @edge records inline as part of its autoregressive output.
I/O Contract
| Direction | Description |
|---|---|
| Inputs |
|
| Outputs |
|
Usage Examples
The following example shows a complete final synthesis for a character-counting task. Nodes 2 and 4 were previously validated by the critic; the summarizer cites both.
<summarizer>
Based on the validated reasoning:
- Node 2 established that "strawberry" has three syllables
- Node 4 counted "r" in each: straw(1) + ber(1) + ry(1) = 3
Final answer: The letter "r" appears 3 times in "strawberry".
@node id=7 role=summarizer
@edge src=2 dst=7 kind=use
@edge src=4 dst=7 kind=use
In this example:
- Node 7 is the summarizer node, with an ID greater than all source nodes.
@edge src=2 dst=7 kind=usedeclares that the synthesis depends on validated node 2.@edge src=4 dst=7 kind=usedeclares that the synthesis depends on validated node 4.- The natural-language body explicitly names which node contributed which piece of evidence, making the provenance human-readable as well as machine-extractable.
Related Pages
- Principle:Diagram_of_thought_Diagram_of_thought_Final_Synthesis -- Theoretical foundation for the Final Synthesis concept