Skip to main content

Overview

Templates provide pre-built AI agent workflows that can be installed, customized, and run. The default repository is agent-recipes on GitHub.

Python API

Load a Template

from praisonai.templates import load_template

# Load from default agent-recipes repository
template = load_template("transcript-generator")

# Load from GitHub with version pinning
template = load_template("github:MervinPraison/agent-recipes/[email protected]")

# Load from local path
template = load_template("./my-template")

# Load in offline mode (cache only)
template = load_template("transcript-generator", offline=True)

List Available Templates

from praisonai.templates import list_templates

# List all templates
templates = list_templates()

# List only cached templates
templates = list_templates(source="cached")

# List in offline mode
templates = list_templates(offline=True)

for t in templates:
    print(f"{t.name} v{t.version}: {t.description}")

Search Templates

from praisonai.templates import search_templates

# Search by keyword
results = search_templates("video")

# Search in offline mode
results = search_templates("transcript", offline=True)

Install a Template

from praisonai.templates import install_template

# Install to cache
cached = install_template("github:MervinPraison/agent-recipes/transcript-generator")
print(f"Installed to: {cached.path}")

Clear Cache

from praisonai.templates import clear_cache

# Clear all cached templates
count = clear_cache()
print(f"Cleared {count} templates")

Create Agent from Template

from praisonaiagents import Agent

# Create agent from template (lazy loads praisonai.templates)
agent = Agent.from_template("transcript-generator")

# With config overrides
agent = Agent.from_template(
    "transcript-generator",
    config={"output_format": "srt"}
)

Create Workflow from Template

from praisonaiagents import Workflow

# Create workflow from template
workflow = Workflow.from_template("data-transformer")

# With config and offline mode
workflow = Workflow.from_template(
    "github:MervinPraison/agent-recipes/[email protected]",
    config={"resolution": "1080p"},
    offline=True
)

# Run the workflow
result = workflow.run()

Template URI Formats

FormatExample
Simple nametranscript-generator
Packagepackage:agent_recipes/transcript-generator
GitHubgithub:owner/repo/template
GitHub with refgithub:owner/repo/[email protected]
Local path./my-template or ~/templates/test
HTTP URLhttps://example.com/template.yaml

Available Templates

TemplateDescription
transcript-generatorGenerate transcripts from audio/video
shorts-generatorCreate short-form video clips
video-editorAI-powered video editing
data-transformerTransform data between formats

Security

Templates support allowlists and checksum verification:
from praisonai.templates import TemplateSecurity, SecurityConfig

config = SecurityConfig(
    allowed_sources={"github:MervinPraison/agent-recipes"},
    allow_any_github=False
)
security = TemplateSecurity(config=config)