Redeo Docs
DocsLADR / Self-Refine

Search Strategies

Self-Refine

Self-Refine

A single-pass draft-issues-refine sequence. Lighter-weight than reflexion when one refinement pass is sufficient.

Shape and when to use

Shape: draft followed by identify-issues followed by refine. Single iteration. Wrap in a reflexion loop (jumps back to draft) for multi-iteration.

When to use: writing tasks, code generation, structured output. Self-refine is the right choice when one refinement pass produces a measurable quality lift and the cost of a full reflexion loop is not justified.

Cost: 3 LLM calls per loop (draft, issues, refine). Reflexion is self-refine in a loop, so the cost scales linearly with iteration count under reflexion.

Config sketch

yaml
steps:
  - id: draft
    type: normal
    fields:
      - { name: Context, type: text, from: input.context }
    systemPrompt: "Draft an answer."

  - id: issues
    type: normal
    fields:
      - { name: Draft, type: ingest, from: { stepId: draft, loopRef: current, nodeRef: current } }
    systemPrompt: 'List concrete issues with the draft. Output JSON: {"issues": ["...", "..."]}'

  - id: refine
    type: normal
    fields:
      - { name: Draft,  type: ingest, from: { stepId: draft, loopRef: current, nodeRef: current } }
      - { name: Issues, type: ingest, from: { stepId: issues, loopRef: current, nodeRef: current } }
    systemPrompt: "Address each issue. Output only the refined answer."

Upgrade to reflexion: wrap draft, issues, refine in a reflexion loop. Add a gate on refine that jumps back to draft if issues is non-empty.