Skip to main content
Create complete agent recipes automatically from a simple goal description.
The AI analyzes your goal and generates optimized agents, tools, and workflows.

Quick Start

praisonai recipe create "Build a web scraper for news articles"
This creates a ready-to-run recipe folder with just 2 files:

agents.yaml

Agent definitions, workflow steps, and optional metadata

tools.py

Custom functions and dynamic variables
The simplified 2-file structure reduces complexity. Metadata for registry publishing is now an optional block inside agents.yaml.

How It Works

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

Create a simple recipe:
praisonai recipe create "Summarize PDF documents"

Custom Agents and Tools

Define your own agents instead of letting AI decide:
Define agents with roles and goals:
praisonai recipe create "Research AI" \
  --agents "researcher:role=AI Researcher,goal=Find papers;writer:role=Writer,goal=Summarize" \
  --no-optimize

Format Reference

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

Skip Optimization

For quick prototyping, skip the optimization loop:
praisonai recipe create "Simple calculator" --no-optimize

Custom Optimization

Fine-tune the optimization process:
praisonai recipe create "Complex research task" \
  --iterations 5 \
  --threshold 9.0
Higher threshold (9-10) produces better quality but takes longer. Lower threshold (6-7) is faster but may need manual refinement.

Specialized Agent Types

The AI automatically selects the right agent type based on your goal:
For image generation tasks (DALL-E, Stable Diffusion)
praisonai recipe create "Generate product images for store"
For text-to-speech and speech-to-text
praisonai recipe create "Create podcast narration"
For video generation (Sora, Runway)
praisonai recipe create "Create promotional video"
For comprehensive research tasks
praisonai recipe create "Research market trends"
For text extraction from images/documents
praisonai recipe create "Extract text from receipts"

Quality Rules

The AI follows strict quality rules when generating recipes:
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
Tools like wiki_search, internet_search, read_file do NOT need TAVILY_API_KEY
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!)
Prefers reliable, well-tested tools:Recommended: wiki_search, tavily_search, internet_search, read_file, write_file
Avoid scrape_page, crawl4ai - may have loading issues
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)
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
For best results, use wiki_search for factual research and tavily_search for current events.

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

# 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

"""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"
The metadata block is optional. It’s only needed if you want to publish your recipe to the registry.

Run Your Recipe

After creation, run your recipe:
praisonai recipe run my-recipe
Or with input:
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

cd my-recipe
praisonai workflow run agents.yaml --save
2

Judge the run

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?
Use --save to capture traces, then recipe judge to get AI feedback on your recipe’s performance.

Next Steps