PromptChain
Sequential LLM calls with validation gates
Mechanism
Decomposes a Task into a fixed Sequence of LLM calls. Each step's output is validated against an AcceptSpec before it is passed to the next, and a failed output is never forwarded. After a failed validation, the chain invokes ReAttempt on that step up to `max_retries_per_step`; when that budget is exhausted, it halts without executing the next step. A value of zero halts on the first failed validation. It orchestrates ToolInvoke calls and applies InputGuard validation at each boundary.
Invariants
- No failed-forwarding: the Chain never passes a failed step's output to the next step.
- Schema Continuity: Output(N) must satisfy InputSchema(N+1).
- Bounded recovery: a failed step is re-attempted no more than `max_retries_per_step`; exhaustion halts the Chain before the next step executes.
Parameters
- max_retries_per_step: type=Integer, range=[0, 3], description=Re-attempts allowed after a failed step; 0 halts on the first failure
Failure modes
- Undetected error propagation: a flawed intermediate output passes validation and corrupts the next step.
- Validation brittleness: an overly narrow AcceptSpec rejects a valid intermediate output.
Where this came from
—
Builds on
- ToolInvoke composes_with
- InputGuard composes_with
- ReAttempt composes_with
- AcceptSpec references
- Chain references
- Sequence references
- Task accepts
Used by
- Compose references
- MetaPrompt references
Identity
- Ref:
PromptChain#02b5 - Hash: sema:PromptChain#mh:SHA-256:02b5f2277c89d51e35336a8735f5a8bf26304332db887961bb23790c8c82b2f9
- Library: bootstrap 0.11.0, root a6a3d1ff0f98
- License: Not stated; check the repository