Creating a Plugin
Plugin Interface
Every plugin corresponds to thePlugin class:
Tool Interface
Each tool must assume theTool class structure:
hedera_agent_kit/shared/tool.py for the full definition.
BaseToolV2 (Recommended for v3.4.0+)
This is NOT a breaking change.
BaseToolV2 is an abstract class that implements the Tool interface — plain Tool implementations continue to work exactly as before. However, they do not support the hooks and policies system (e.g., HcsAuditTrailHook, MaxRecipientsPolicy, RejectToolPolicy). To enable those features, migrate your tool to BaseToolV2.BaseToolV2 splits execution into a 7-stage lifecycle that hooks and policies tap into automatically. For complete step-by-step instructions, see the Python ToolV2 Migration Guide.
| Aspect | v3 (Legacy) | v4 (BaseToolV2) |
|---|---|---|
| Declaration | Functional factory (Tool(...)) | Class extending BaseToolV2 |
| Lifecycle stages | All inside a single execute() | normalize_params → core_action → secondary_action |
| Hook/Policy support | ✗ None | ✓ Automatic at stages 1, 3, 5, 7 |
| Breaking change? | — | No |
Creating a Plugin
Step 1: Create Plugin Structure
Step 2: Implement Your Tool
Step 3: Create Plugin Definition
Using Your Plugin
Publish and Register Your Plugin
To create a plugin to be used with the Hedera Agent Kit, you will need to create a plugin in your own repository, publish a PyPI package, and provide a description of the functionality included in that plugin, as well as the required and optional parameters. Once you have a repository, published PyPI package, and a README with a description of the functionality included in that plugin in your plugin’s repo, as well as the required and optional parameters, you can add it to the Hedera Agent Kit by forking and opening a Pull Request to:- Include the plugin as a bullet point under the Available Third Party Plugin section under the Third Party Plugin section in the README.md in the hedera-agent-kit-py. Include the name, a brief description, and a link to the repository with the README, as well as the URL linked to the published PyPI package.
-
If you would like to include your plugin functionality in the Hedera plugin built for ElizaOS simply make a PR to add your plugin name to the
pluginsarray in the Hedera ElizaOS plugin where the configuration is initiated. The hedera-agent-kit adaptor architecture means your plugin functionality will be usable with no additional configuration needed. - All commits for your plugin must be DCO signed, have the names of the tools & core actions exposed by the plugin, and point to the exact version of the Python package. To avoid having pull requests blocked in the future, always include a sign-off:
Plugin README Template
Resources
Examples and References
- See existing core plugins in the hedera agent kit examples
- Follow the patterns established the example BaseTool implementation
- See typescript/examples/langchain/tool-calling-agent.ts for usage examples