Different Ways to Create Recipes

Explore all methods for creating PraisonAI recipes

Create recipes with the CLI, by hand, or from existing examples—pick the path that fits your team.

python
from praisonaiagents import Agent

agent = Agent(name="Recipe Planner", instructions="Compare recipe creation approaches.")
agent.start("Should I use recipe init or a manual folder?")

The user picks a creation method, scaffolds files, and runs the recipe with the same CLI entry point.

Diagram

Creation Methods

📋 Method

⚙️ Scaffold

✅ Runnable Recipe

How It Works

Diagram
RecipeCLIUserRecipeCLIUserChoose a creation methodScaffold agents.yamlRecipe directory readyRun with the same entry point

How to Create Recipes Using CLI

  1. Initialize New Recipe
    bash
    praisonai recipe init my-recipe
  2. Navigate to Recipe
    bash
    cd my-recipe
  3. Customize Generated Files

    Edit agents.yaml to match your requirements.

How to Create Recipes Manually

  1. Create Directory Structure
    bash
    mkdir my-recipe
    cd my-recipe
    touch agents.yaml
  2. Write agents.yaml
    yaml
    framework: praisonai
    topic: "{{task}}"
    
    roles:
      agent:
        role: Assistant
        goal: Complete the task
        tasks:
          main:
            description: "{{task}}"
            expected_output: "Task result"
  3. Run Recipe
    bash
    praisonai recipe run ./my-recipe --var task="Your task"

How to Create Recipes from Existing Agents

  1. Define Agent in Python
    python
    from praisonaiagents import Agent
    
    agent = Agent(
        name="researcher",
        role="Research Specialist",
        goal="Research topics thoroughly",
        tools=["internet_search"]
    )
  2. Convert to YAML

    Create agents.yaml based on your agent:

    yaml
    framework: praisonai
    topic: "{{task}}"
    
    roles:
      researcher:
        role: Research Specialist
        goal: Research topics thoroughly
        tools:
          - internet_search
        tasks:
          research:
            description: "Research {{task}}"

How to Create Recipes from GitHub

  1. Fork Repository

    Fork the Agent-Recipes repository on GitHub.

  2. Clone Your Fork
    bash
    git clone https://github.com/YOUR_USERNAME/Agent-Recipes
    cd Agent-Recipes
  3. Create New Recipe Directory
    bash
    mkdir my-new-recipe
    # Create agents.yaml
  4. Customize and Push
    bash
    # Edit files
    git add .
    git commit -m "Add my-new-recipe"
    git push

Recipe Creation Methods Comparison

MethodBest ForComplexity
CLI initQuick startLow
ManualFull controlMedium
From AgentConverting existing codeMedium
GitHub ForkContributing to communityMedium

Best Practices

Use recipe init for a fast, valid start

The CLI scaffold produces a correct agents.yaml, so it is the lowest-risk way to begin a new recipe.

Go manual only when you need full control

Hand-authoring pays off for unusual structures, but skip it for standard recipes where the scaffold already fits.

Every method ends at the same run command

No matter how you create a recipe, praisonai recipe run executes it — so choose the method by authoring convenience, not runtime behaviour.


Related