Recipe Cycle Testing

Create, Run, Judge, Evaluate, and Fix recipes iteratively

The Recipe Cycle Testing workflow helps you iteratively improve your AI agent recipes.

Diagram

No

Yes

Create Recipe

Run Recipe

Judge Output

Score OK?

Apply Fixes

Done

Quick Start

  1. Create a Recipe
    bash
    praisonai recipe create "Research AI agent frameworks"
  2. Run with Trace
    bash
    praisonai recipe run my-recipe --save --name run1
  3. Judge the Output
    bash
    praisonai recipe judge run1 --yaml my-recipe/agents.yaml
  4. Apply Fixes
    bash
    praisonai recipe apply judge_plan.yaml --confirm
  5. Repeat

    Run cycles 2-5 until score reaches target threshold.

Common Errors & Fixes

Tool Result Truncation

Error: Tool 'tavily_search' result was truncated

Cause: Large search results exceed context window

Fix: – Use --chunked flag when judging – Reduce max_results in tool calls – Add instructions to summarize results

Low Task Achievement Score

Error: Task Achievement: 5.0/10

Cause: Agent output doesn’t match expected format

Fix: – Add clearer expected_output in steps – Include specific format requirements in action – Add verification instructions to backstory

Hallucination Detected

Error: Hallucination: 3.0/10

Cause: Agent generates unverified information

Fix: – Add instruction to cite sources – Use include_answer: true in tavily_search – Add verification step in backstory

Missing Goal

Error: Recipe Goal: Not specified

Cause: No goal field in agents.yaml

Fix: Add a clear, measurable goal:

yaml
goal: Research and compare top 5 AI frameworks

Tool-Specific Fixes

tavily_search

Issue: Results truncated or incomplete

yaml
# Fix: Add specific instructions
agents:
  researcher:
    backstory: |
      Expert researcher. Always verify completeness
      of search results before finalizing output.
      Cite sources for all claims.

search_web

Issue: Fallback to DuckDuckGo with limited results

yaml
# Fix: Set TAVILY_API_KEY for better results
metadata:
  requires:
    env:
      - TAVILY_API_KEY

write_file

Issue: Approval required but not configured

yaml
# Fix: Add approve field
approve:
  - write_file

Cycle Results Example

CycleScoreFixes AppliedKey Issue
17.5/102Tool truncation warnings
26.67/106Hallucination detection
34.5/105Output format issues
44.5/105Verification needed
54.5/10–Stable, needs manual tuning

Best Practices

CLI Reference

bash
# Create recipe
praisonai recipe create "goal" [--no-optimize]

# Run with trace
praisonai recipe run <name> --save --name <trace-id>

# Judge trace
praisonai recipe judge <trace-id> --yaml <file> [--chunked]

# Apply fixes
praisonai recipe apply <plan.yaml> --confirm

# Optimize (automated cycles)
praisonai recipe optimize <path> --iterations 5 --threshold 8.0