Recipe Create
Create AI agent recipes from natural language goals
Create complete agent recipes automatically from a simple goal description.
Quick Start
praisonai recipe create "Build a web scraper for news articles"This creates a ready-to-run recipe folder with just 2 files:
Agent definitions, workflow steps, and optional metadata
tools.pyCustom functions and dynamic variables
How It Works
Options
| Option | Short | Description | Default |
|---|---|---|---|
--output | -o | Output directory | Current directory |
--no-optimize | Skip optimization loop | false | |
--iterations | Max optimization iterations | 3 | |
--threshold | Score threshold to stop | 8.0 | |
--agents | Custom agent definitions | Auto-generated | |
--tools | Custom tools per agent | Auto-selected | |
--agent-types | Agent types (image, audio, etc.) | Auto-detected |
Examples
Basic
Create a simple recipe:
praisonai recipe create "Summarize PDF documents"Research
Create a research agent:
praisonai recipe create "Research latest AI papers and create a summary report"Data Processing
Create a data pipeline:
praisonai recipe create "Analyze CSV sales data and generate insights"Web Tasks
Create a web automation recipe:
praisonai recipe create "Scrape product prices from e-commerce sites"Custom Agents and Tools
Define your own agents instead of letting AI decide:
Custom Agents
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-optimizeCustom Tools
Assign specific tools to agents:
praisonai recipe create "Research AI" \
--tools "researcher:internet_search,arxiv;writer:write_file" \
--no-optimizeAgent Types
Use specialized agent types:
praisonai recipe create "Generate images" \
--agents "artist:role=Image Creator,goal=Create product images" \
--agent-types "artist:image" \
--no-optimizeCombined
Full customization:
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-optimizeFormat 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:audioAvailable types: image, audio, video, deep_research, ocr, router
Skip Optimization
For quick prototyping, skip the optimization loop:
praisonai recipe create "Simple calculator" --no-optimizeCustom Optimization
Fine-tune the optimization process:
praisonai recipe create "Complex research task" \
--iterations 5 \
--threshold 9.0Specialized Agent Types
The AI automatically selects the right agent type based on your goal:
ImageAgent
For image generation tasks (DALL-E, Stable Diffusion)
praisonai recipe create "Generate product images for store"AudioAgent
For text-to-speech and speech-to-text
praisonai recipe create "Create podcast narration"VideoAgent
For video generation — generated recipes use openai/sora-2 or gemini/veo-3.1-generate-preview
praisonai recipe create "Create promotional video"DeepResearchAgent
For comprehensive research tasks
praisonai recipe create "Research market trends"OCRAgent
For text extraction from images/documents
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 Type | Tool Used | Judge Score |
|---|---|---|
| Wikipedia Research | wiki_search | 9.83/10 ✅ |
| AI Trends Research | tavily_search | 7.25/10 ✅ |
| Data Analysis | read_csv, write_csv | 8.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 variablesagents.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"Run Your Recipe
After creation, run your recipe:
praisonai recipe run my-recipeOr 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:
- Run with trace
bash cd my-recipe praisonai workflow run agents.yaml --save - Judge the run
bash praisonai recipe judge <trace-id> --context - 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?