Society · Protocols

PromptChain

Sequential LLM calls with validation gates

Definition

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

  1. No failed-forwarding: the Chain never passes a failed step's output to the next step.
  2. Schema Continuity: Output(N) must satisfy InputSchema(N+1).
  3. Bounded recovery: a failed step is re-attempted no more than `max_retries_per_step`; exhaustion halts the Chain before the next step executes.

Risks

Failure modes

  1. Undetected error propagation

    a flawed intermediate output passes validation and corrupts the next step.

  2. Validation brittleness

    an overly narrow AcceptSpec rejects a valid intermediate output.

Relationships

Builds on

Accepts

Infrastructure

Task

The atomic unit of intent

Composes with

Infrastructure

InputGuard

Input validation and sanitization

Infrastructure

ReAttempt

Substrate-level re-attempt: same call, after a delay

Infrastructure

ToolInvoke

Execute external tool and observe result

References

Infrastructure

AcceptSpec

Non-compensatory acceptance contract; consumer Verify yields Solution or FrameError

Infrastructure

Chain

Sequential data container (linked list)

Infrastructure

Sequence

Sequential ordering

Used by

References

Mind

Compose

Building complex behavior from simple primitives

Mind

MetaPrompt

Use prompts to generate or refine other prompts

Reference

Parameters

max_retries_per_step Integer, [0, 3]
Re-attempts allowed after a failed step; 0 halts on the first failure

Identity

Ref
PromptChain#02b5
Sema ID
sema:PromptChain#mh:SHA-256:02b5f2277c89d51e35336a8735f5a8bf26304332db887961bb23790c8c82b2f9
Ring
0
Tier
2
Updated
2026-11-11
Supersedes
  • sema:PromptChain#mh:SHA-256:c872aab6147376a3ad76fc0a062b08baf8492651a478308fbb96f261f903cce0
  • sema:PromptChain#mh:SHA-256:4ad5da823f52050a9e1959eaf054e9a5c4d5777f534c796ec6bc259db676e008
  • sema:PromptChain#mh:SHA-256:50975454f45cce4e45ae4590cd99cee4401596df424ffac720c699609dcc01a6
  • sema:PromptChain#mh:SHA-256:2543cc5972f02b5a21d776643ba485beda876462c57a10c8949d0072e54bd620
  • sema:PromptChain#mh:SHA-256:5df25fb4edb7f8f3575a0b45a7c203f7f5ef1b66a5f83d9ec1049b5548cdf975
  • sema:PromptChain#mh:SHA-256:61c81f623e0aadd0d6cde03bf3c5dbbc5ea3e0b527647552ca0e063c261e85e1