Skip to main content
The user drops a single-file plugin into the plugins folder; the agent loads its tools and answers with plugin-backed actions.

Single-File Plugins

PraisonAI supports a simplified plugin format inspired by WordPress - just a single Python file with metadata in a docstring header.
Single-file plugins are the easiest way to extend PraisonAI with custom tools and hooks. No package structure, no configuration files - just one .py file.

Quick Start

1

Simple Usage

1. Create a Plugin

Create a plugin file under ~/.praisonai/plugins/ — see the steps below.
2

With Configuration

Load plugins via PluginManager or drop a .py file in your project .praison/plugins/ directory.

1. Create a Plugin

Create a file in ~/.praisonai/plugins/ or ./.praison/plugins/:

2. Use in Your Agent

Tools from plugins are automatically discovered:

Plugin Header Format

The plugin header is a docstring at the top of the file with WordPress-style metadata:

Required Fields

Optional Fields

Plugin Directories

Plugins are discovered from these directories (in order):
  1. Project-level: ./.praison/plugins/ - Plugins specific to your project
  2. User-level: ~/.praisonai/plugins/ - Plugins available to all your projects
Use project-level plugins for project-specific tools and user-level plugins for tools you want everywhere.

Adding Tools

Use the @tool decorator to create tools:

Adding Hooks

Use the add_hook decorator to intercept agent lifecycle events:

Available Hooks

CLI Commands

Programmatic Usage

Load Plugins Manually

Use with PluginManager

Best Practices

One plugin = one purpose. Don’t cram unrelated tools into one file.
Use clear docstrings — they become the tool descriptions for the LLM.
Return meaningful error messages instead of raising exceptions.
Always use type hints — they help generate accurate tool schemas.

Good Plugin Example

Troubleshooting

  • Check the file is in .praison/plugins/ or ~/.praisonai/plugins/
  • Ensure the file has a .py extension
  • Verify the docstring header has Plugin Name: field
  • Files starting with _ are skipped
  • Make sure you’re using the @tool decorator
  • Check for import errors in your plugin
  • Run with verbose logging to see errors
  • Verify the hook name is correct (e.g., before_tool)
  • Check that the hook function signature matches expected parameters
  • Ensure the plugin is loaded before the agent runs

Next Steps

Tools Guide

Learn more about creating tools

Hooks System

Deep dive into the hooks system

Agent Configuration

Configure agents to use your plugins

Examples

See more plugin examples

Custom Tools

Build your own agent tools

Tools Overview

Browse PraisonAI tool documentation