Recipe Create

Create AI agent recipes from natural language goals

Create complete agent recipes automatically from a simple goal description.

Quick Start

bash
praisonai recipe create "Build a web scraper for news articles"

This creates a ready-to-run recipe folder with just 2 files:

How It Works

Diagram

No

Yes

🎯 Your Goal

🧠 AI Analysis

📝 Generate agents.yaml

🔧 Create tools.py

📁 Recipe Folder

🔄 Optimization Loop

Score >= 8?

💡 Apply Improvements

✅ Ready to Use

Options

OptionShortDescriptionDefault
--output-oOutput directoryCurrent directory
--no-optimizeSkip optimization loopfalse
--iterationsMax optimization iterations3
--thresholdScore threshold to stop8.0
--agentsCustom agent definitionsAuto-generated
--toolsCustom tools per agentAuto-selected
--agent-typesAgent types (image, audio, etc.)Auto-detected

Examples

Basic

Create a simple recipe:

bash
praisonai recipe create "Summarize PDF documents"

Research

Create a research agent:

bash
praisonai recipe create "Research latest AI papers and create a summary report"

Data Processing

Create a data pipeline:

bash
praisonai recipe create "Analyze CSV sales data and generate insights"

Web Tasks

Create a web automation recipe:

bash
praisonai recipe create "Scrape product prices from e-commerce sites"

Custom Agents and Tools

Define your own agents instead of letting AI decide:

Diagram

No

Yes

🎯 Your Goal

Customization?

🤖 AI Generates

📋 Your Agents

📁 Recipe

Custom Agents

Define agents with roles and goals:

bash
praisonai recipe create "Research AI" \
  --agents "researcher:role=AI Researcher,goal=Find papers;writer:role=Writer,goal=Summarize" \
  --no-optimize

Custom Tools

Assign specific tools to agents:

bash
praisonai recipe create "Research AI" \
  --tools "researcher:internet_search,arxiv;writer:write_file" \
  --no-optimize

Agent Types

Use specialized agent types:

bash
praisonai recipe create "Generate images" \
  --agents "artist:role=Image Creator,goal=Create product images" \
  --agent-types "artist:image" \
  --no-optimize

Combined

Full customization:

bash
praisonai recipe create "Research and visualize" \
  --agents "researcher:role=Researcher;artist:role=Visualizer" \
  --tools "researcher:internet_search;artist:write_file" \
  --agent-types "artist:image" \
  --no-optimize

Format Reference

–agents format
name:role=X,goal=Y,backstory=Z;name2:role=A,goal=B
  • Separate agents with ;
  • Separate properties with ,
  • Use = for key-value pairs
–tools format
agent:tool1,tool2;agent2:tool3,tool4
  • Separate agents with ;
  • Separate tools with ,
–agent-types format
agent:image;agent2:audio

Available types: image, audio, video, deep_research, ocr, router


Skip Optimization

For quick prototyping, skip the optimization loop:

bash
praisonai recipe create "Simple calculator" --no-optimize

Custom Optimization

Fine-tune the optimization process:

bash
praisonai recipe create "Complex research task" \
  --iterations 5 \
  --threshold 9.0

Specialized Agent Types

The AI automatically selects the right agent type based on your goal:

ImageAgent

For image generation tasks (DALL-E, Stable Diffusion)

bash
praisonai recipe create "Generate product images for store"
AudioAgent

For text-to-speech and speech-to-text

bash
praisonai recipe create "Create podcast narration"
VideoAgent

For video generation — generated recipes use openai/sora-2 or gemini/veo-3.1-generate-preview

bash
praisonai recipe create "Create promotional video"
DeepResearchAgent

For comprehensive research tasks

bash
praisonai recipe create "Research market trends"
OCRAgent

For text extraction from images/documents

bash
praisonai recipe create "Extract text from receipts"

Quality Rules

The AI follows strict quality rules when generating recipes:

Environment Variables

Only includes env vars that are actually used: – OPENAI_API_KEY – Always required (for LLM) – TAVILY_API_KEY – Only if using tavily_search or tavily_extract

Concrete Values in Actions

Actions use concrete values, not variables:

✅ Good: "Use wiki_search to find information about Python programming"

❌ Bad: "Use wiki_search to find {{topic}}" (variables don’t substitute!)

Reliable Tools

Prefers reliable, well-tested tools:

Recommended: wiki_search, tavily_search, internet_search, read_file, write_file

Specific Actions

Every action specifies which tool to use:

✅ Good: "Use tavily_search to find the top 5 AI trends in 2024"

❌ Bad: "Research AI trends" (too vague)

No Empty Fields

Omits unused fields entirely: – No knowledge: [] – No memory: false – No handoffs: []

Verified Quality Scores

Recipes generated with these rules achieve high judge scores:

Task TypeTool UsedJudge Score
Wikipedia Researchwiki_search9.83/10 ✅
AI Trends Researchtavily_search7.25/10 ✅
Data Analysisread_csv, write_csv8.0+/10 ✅

Output Structure

After creation, your recipe folder contains just 2 files:

my-recipe/
├── agents.yaml      # Agent definitions + optional metadata
└── tools.py         # Custom functions and dynamic variables

agents.yaml Example

yaml
# Optional: Metadata for registry/sharing
metadata:
  name: web-scraper
  version: "1.0.0"
  description: Scrape news articles from websites
  author: your-name
  license: Apache-2.0
  tags:
    - web
    - scraping
  requires:
    env:
      - OPENAI_API_KEY

framework: praisonai
topic: "Web Scraper for News"

agents:
  scraper:
    role: Web Scraper
    goal: Extract news articles from websites
    backstory: |
      Expert at web scraping with years of experience
      extracting structured data from websites.
    tools:
      - scrape_page
      - extract_links
      - my_custom_tool  # Defined in tools.py

steps:
  - agent: scraper
    action: "Scrape news from {{url}}"
    expected_output: "List of article titles and summaries"

tools.py Example

python
"""Custom tools for this recipe."""

def my_custom_tool(url: str) -> str:
    """A custom tool for processing URLs."""
    return f"Processed: {url}"

# Dynamic variables
DEFAULT_URL = "https://news.example.com"

Run Your Recipe

After creation, run your recipe:

bash
praisonai recipe run my-recipe

Or with input:

bash
praisonai recipe run my-recipe --input '{"url": "https://news.example.com"}'

Testing Your Recipe

After creating a recipe, test it with the workflow command:

  1. Run with trace
    bash
    cd my-recipe
    praisonai workflow run agents.yaml --save
  2. Judge the run
    bash
    praisonai recipe judge <trace-id> --context
  3. Review scores

    The judge evaluates: – Task Achievement: Did agents complete their goals? – Context Flow: Did information pass between agents? – Output Quality: Was the output useful?

Next Steps