Sequences

Create powerful AI workflows by chaining prompts together with advanced looping capabilities

What are Sequences?

Sequences allow you to chain multiple prompts together to create sophisticated AI workflows. Each prompt in a sequence can reference the outputs of previous prompts using Sacred Yaps, enabling complex multi-step processes.

Key Benefits

  • Workflow Automation: Automate complex multi-step AI processes
  • Sacred Yaps Integration: Reference previous outputs with {{ yap = lore }}
  • Loop Functionality: Repeat steps for iterative refinement
  • Provider Flexibility: Use different AI models for different steps

Creating Your First Sequence

Step 1: Create Individual Prompts

Before creating a sequence, you'll need individual prompts. Each prompt should be designed to work as part of a larger workflow.

Example Prompt 1: Content Generator
Generate a blog post outline about {{ yap = topic }}.
Include 5 main sections with brief descriptions.

Step 2: Reference Previous Outputs

Use Sacred Yaps to reference outputs from previous steps in your sequence.

Example Prompt 2: Content Writer
Based on this outline: {{ yap = lore }}

Write a detailed introduction section for the blog post about {{ yap = topic }}.
Make it engaging and informative.

Step 3: Build the Sequence

Combine your prompts into a sequence using the visual sequence builder.

  • • Click "Create Sequence" in the sequences section
  • • Add prompts by clicking on them from the available prompts list
  • • Drag and drop to reorder prompts
  • • Configure loop settings if needed
  • • Save and run your sequence

Loop Functionality

Sequence looping allows you to repeat specific steps multiple times, perfect for iterative processes, refinement workflows, and multi-perspective analysis.

How Loops Work

Normal Execution

Step 1 → Step 2 → Step 3 → Step 4 → Step 5

With Loop (Steps 2-4, 3x)

Step 1
Step 2 → Step 3 → Step 4 (Iteration 1)
Step 2 → Step 3 → Step 4 (Iteration 2)
Step 2 → Step 3 → Step 4 (Iteration 3)
Step 5

Loop Configuration

Loop Count

Set how many times to repeat the loop (1-20 iterations)

Start Step

Choose which step to begin the loop from

End Step

Select the final step to include in the loop

Sacred Yaps in Loops

Sacred Yaps automatically adapt to loop iterations, allowing you to reference outputs from previous iterations and earlier steps.

Example: Iterative Content Refinement

Step 2: Review Content (Loops 3 times)
Review this content and suggest improvements: {{ yap = lore }}

Previous feedback to consider: {{ yap = lore_2 }}

Provide specific, actionable suggestions for enhancement.

Sacred Yap Numbering

  • {{ yap = lore }}: References the immediately previous step
  • {{ yap = lore_2 }}: References the step before that
  • {{ yap = lore_N }}: References the Nth step back
  • In loops, this includes outputs from previous iterations

Common Use Cases

Iterative Refinement

Perfect for improving content through multiple review cycles.

1. Generate initial content
2. Review and suggest improvements (×3)
3. Apply improvements (×3)
4. Final polish

Multi-Perspective Analysis

Analyze problems from different angles in each iteration.

1. Present the problem
2. Technical analysis (×5)
3. Business analysis (×5)
4. Synthesize perspectives

Progressive Enhancement

Build features incrementally with testing at each step.

1. Create basic version
2. Add feature (×3)
3. Test and refine (×3)
4. Final integration

Quality Assurance

Multiple validation passes for critical content.

1. Generate content
2. Fact-check (×2)
3. Style review (×2)
4. Final approval

Best Practices

Design Tips

  • Start Simple: Begin with 2-3 prompts before adding loops
  • Clear Instructions: Make each prompt's role in the sequence obvious
  • Test Incrementally: Run sequences without loops first, then add looping
  • Use Descriptive Names: Name your sequences clearly for easy identification

Loop Considerations

  • Iteration Limits: Maximum 20 iterations to prevent runaway processes
  • Cost Awareness: Loops multiply your token usage - monitor billing
  • Sacred Yap Context: Ensure prompts can handle varying input lengths
  • Loop Range: Must include at least 2 steps in the loop range

Performance Tips

  • Optimize Prompts: Shorter, focused prompts run faster in loops
  • Model Selection: Use faster models for iterative steps when appropriate
  • Batch Processing: Consider if some iterations can be combined
  • Early Termination: Design prompts to indicate when iteration goals are met

Troubleshooting

Loop Not Executing

  • • Verify loop is enabled in sequence settings
  • • Check that loop range includes at least 2 steps
  • • Ensure iteration count is between 1-20

Sacred Yaps Not Resolving

  • • Confirm previous steps completed successfully
  • • Check Sacred Yap syntax: {{ yap = lore }} or {{ yap = lore_2 }}
  • • Verify step numbering in sequence execution

Performance Issues

  • • Reduce loop iterations for testing
  • • Optimize prompt length and complexity
  • • Consider using faster AI models for iterative steps