Composition
Composing Patterns
Composing Patterns
How the canonical patterns stack into larger ladders. Walkthrough of the Crucible reference ladder, which composes ToT, reflexion, self-refine, self-consistency, and persistent memory.
Phases of a composed ladder
Each canonical pattern occupies a distinct phase of a composed ladder. The phases connect via field references and gates:
| Phase | Pattern | Purpose |
|---|---|---|
| Generate | Tree-of-Thoughts | Multi-branch draft |
| Verify | ToT gate, Reflexion | Prune, retry if no survivors |
| Refine | Self-Refine | Single-pass improvement on the winner |
| Aggregate | Self-Consistency | Reduce variance across remaining candidates |
| Persist | Verify-then-Persist | Write the result plus lessons learned to slates |
The hop ceiling plus spend cap bound the whole composition safely. A composed ladder that would exceed the ceiling is aborted at runtime with the best-so-far output, which is usually the highest-scoring candidate from the most recent completed phase.
Crucible walkthrough
The Crucible reference ladder composes ToT plus reflexion plus self-refine plus self-consistency plus persistent memory into one ladder. It is a worked example of how the canonical patterns stack into a larger strategy.
The composition works because each pattern is a self-contained phase. The phases connect via:
- Field references. Each phase's
ingestandmulti_ingestfields name the previous phase's outputs. - Gates. The gate between phases decides whether to advance, retry (jump backward), or abort.
- Slate writes. The final phase writes the result and a lessons-learned entry to a slate.
Read the Crucible walkthrough for the full annotated config.