Recipe Optimize

Improve existing recipes with AI-powered feedback

Automatically improve your recipes using AI judge feedback.

Quick Start

bash
praisonai recipe optimize my-recipe

How It Works

Diagram

Optimization Loop

No

Yes

▶️ Run Recipe

⚖️ AI Judge

Score OK?

💡 Propose Fixes

✏️ Apply to YAML

✅ Done

  1. Run

    Executes the recipe and captures output

  2. Judge

    AI evaluates task achievement, output quality, and instruction following

  3. Improve

    Proposes specific YAML changes based on feedback

  4. Apply

    Updates agents.yaml with improvements

  5. Repeat

    Continues until score threshold or max iterations

Options

OptionDescriptionDefault
--iterationsMaximum optimization iterations3
--thresholdScore threshold to stop (1-10)8.0
--input, -iInput data for recipe runsNone

Examples

Basic

Optimize with defaults:

bash
praisonai recipe optimize my-recipe

Targeted

Focus on specific improvements:

bash
praisonai recipe optimize my-recipe "improve error handling"

High Quality

More iterations, higher threshold:

bash
praisonai recipe optimize my-recipe --iterations 5 --threshold 9.0

With Input

Test with specific input:

bash
praisonai recipe optimize my-recipe --input '{"query": "test"}'

What Gets Improved

The AI judge evaluates and improves:

Task Achievement

Did the agent accomplish what it was asked to do?

Output Quality

Does the output match expected format and contain useful information?

Instruction Following

Did the agent follow specific instructions, format, and constraints?

Error Handling

How well did the agent handle errors and edge cases?

Score Interpretation

ScoreQualityAction
9-10ExcellentReady for production
7-8GoodMinor improvements possible
5-6FairNeeds optimization
1-4PoorSignificant issues

Workflow

bash
# 1. Create initial recipe
praisonai recipe create "Research AI trends"

# 2. Test run
praisonai recipe run research-ai-trends

# 3. Optimize based on results
praisonai recipe optimize research-ai-trends

# 4. Target specific issues
praisonai recipe optimize research-ai-trends "add better source citations"

Next Steps