𧩠Plugins
Overviewβ
Eliza's plugin system provides a modular way to extend the core functionality with additional features, actions, evaluators, and providers. Plugins are self-contained modules that can be easily added or removed to customize your agent's capabilities.
Core Plugin Conceptsβ
Plugin Structureβ
Each plugin in Eliza must implement the Plugin
interface with the following properties:
interface Plugin {
name: string; // Unique identifier for the plugin
description: string; // Brief description of plugin functionality
actions?: Action[]; // Custom actions provided by the plugin
evaluators?: Evaluator[]; // Custom evaluators for behavior assessment
providers?: Provider[]; // Context providers for message generation
services?: Service[]; // Additional services (optional)
}
Available Pluginsβ
1. Bootstrap Plugin (@eliza/plugin-bootstrap
)β
The bootstrap plugin provides essential baseline functionality:
Actions:
continue
- Continue the current conversation flowfollowRoom
- Follow a room for updatesunfollowRoom
- Unfollow a roomignore
- Ignore specific messagesmuteRoom
- Mute notifications from a roomunmuteRoom
- Unmute notifications from a room
Evaluators:
fact
- Evaluate factual accuracygoal
- Assess goal completion
Providers:
boredom
- Manages engagement levelstime
- Provides temporal contextfacts
- Supplies factual information
2. Image Generation Plugin (@eliza/plugin-image-generation
)β
Enables AI image generation capabilities:
Actions:
GENERATE_IMAGE
- Create images based on text descriptions- Supports multiple image generation services (Anthropic, Together)
- Auto-generates captions for created images
3. Node Plugin (@eliza/plugin-node
)β
Provides core Node.js-based services:
Services:
BrowserService
- Web browsing capabilitiesImageDescriptionService
- Image analysisLlamaService
- LLM integrationPdfService
- PDF processingSpeechService
- Text-to-speechTranscriptionService
- Speech-to-textVideoService
- Video processing
4. Solana Plugin (@eliza/plugin-solana
)β
Integrates Solana blockchain functionality:
Evaluators:
trustEvaluator
- Assess transaction trust scores
Providers:
walletProvider
- Wallet managementtrustScoreProvider
- Transaction trust metrics
5. Buttplug Plugin (@eliza/plugin-buttplug
)β
Integrates Buttplug.io for intimate toy control:
Services:
ButtplugService
- Buttplug.io integration itself
Actions:
VIBRATE
- Control vibration intensity and duration of connected devicesROTATE
- Control rotation intensity and duration of connected devicesBATTERY
- Get the battery level of connected devices
Using Pluginsβ
Installationβ
- Install the desired plugin package:
pnpm add @ai16z/plugin-[name]
- Import and register the plugin in your character configuration:
import { bootstrapPlugin } from "@eliza/plugin-bootstrap";
import { imageGenerationPlugin } from "@eliza/plugin-image-generation";
import { buttplugPlugin } from "@eliza/plugin-buttplug";
const character = {
// ... other character config
plugins: [bootstrapPlugin, imageGenerationPlugin, buttplugPlugin],
};
Here is the updated README with the Coinbase Commerce plugin information added:
𧩠Plugins
Overviewβ
Eliza's plugin system provides a modular way to extend the core functionality with additional features, actions, evaluators, and providers. Plugins are self-contained modules that can be easily added or removed to customize your agent's capabilities.
Core Plugin Conceptsβ
Plugin Structureβ
Each plugin in Eliza must implement the Plugin
interface with the following properties:
interface Plugin {
name: string; // Unique identifier for the plugin
description: string; // Brief description of plugin functionality
actions?: Action[]; // Custom actions provided by the plugin
evaluators?: Evaluator[]; // Custom evaluators for behavior assessment
providers?: Provider[]; // Context providers for message generation
services?: Service[]; // Additional services (optional)
}
Available Pluginsβ
1. Bootstrap Plugin (@eliza/plugin-bootstrap
)β
The bootstrap plugin provides essential baseline functionality:
Actions:
continue
- Continue the current conversation flowfollowRoom
- Follow a room for updatesunfollowRoom
- Unfollow a roomignore
- Ignore specific messagesmuteRoom
- Mute notifications from a roomunmuteRoom
- Unmute notifications from a room
Evaluators:
fact
- Evaluate factual accuracygoal
- Assess goal completion
Providers:
boredom
- Manages engagement levelstime
- Provides temporal contextfacts
- Supplies factual information
2. Image Generation Plugin (@eliza/plugin-image-generation
)β
Enables AI image generation capabilities:
Actions:
GENERATE_IMAGE
- Create images based on text descriptions- Supports multiple image generation services (Anthropic, Together)
- Auto-generates captions for created images
3. Node Plugin (@eliza/plugin-node
)β
Provides core Node.js-based services:
Services:
BrowserService
- Web browsing capabilitiesImageDescriptionService
- Image analysisLlamaService
- LLM integrationPdfService
- PDF processingSpeechService
- Text-to-speechTranscriptionService
- Speech-to-textVideoService
- Video processing
4. Solana Plugin (@eliza/plugin-solana
)β
Integrates Solana blockchain functionality:
Evaluators:
trustEvaluator
- Assess transaction trust scores
Providers:
walletProvider
- Wallet managementtrustScoreProvider
- Transaction trust metrics
5. Coinbase Commerce Plugin (@eliza/plugin-coinbase
)β
Integrates Coinbase Commerce for payment and transaction management:
Actions:
CREATE_CHARGE
- Create a payment charge using Coinbase CommerceGET_ALL_CHARGES
- Fetch all payment chargesGET_CHARGE_DETAILS
- Retrieve details for a specific charge
Description: This plugin enables Eliza to interact with the Coinbase Commerce API to create and manage payment charges, providing seamless integration with cryptocurrency-based payment systems.
Coinbase Wallet Managementβ
The plugin automatically handles wallet creation or uses an existing wallet if the required details are provided during the first run.
-
Wallet Generation on First Run If no wallet information is provided (
COINBASE_GENERATED_WALLET_HEX_SEED
andCOINBASE_GENERATED_WALLET_ID
), the plugin will:- Generate a new wallet using the Coinbase SDK.
- Automatically export the wallet details (
seed
andwalletId
) and securely store them inruntime.character.settings.secrets
or other configured storage. - Log the walletβs default address for reference.
- If the character file does not exist, the wallet details are saved to a characters/charactername-seed.txt file in the characters directory with a note indicating that the user must manually add these details to settings.secrets or the .env file.
-
Using an Existing Wallet If wallet information is available during the first run:
- Provide
COINBASE_GENERATED_WALLET_HEX_SEED
andCOINBASE_GENERATED_WALLET_ID
viaruntime.character.settings.secrets
or environment variables. - The plugin will import the wallet and use it for processing mass payouts.
- Provide
Coinbase Wallet Managementβ
The plugin automatically handles wallet creation or uses an existing wallet if the required details are provided during the first run.
-
Wallet Generation on First Run If no wallet information is provided (
COINBASE_GENERATED_WALLET_HEX_SEED
andCOINBASE_GENERATED_WALLET_ID
), the plugin will:- Generate a new wallet using the Coinbase SDK.
- Automatically export the wallet details (
seed
andwalletId
) and securely store them inruntime.character.settings.secrets
or other configured storage. - Log the walletβs default address for reference.
- If the character file does not exist, the wallet details are saved to a characters/charactername-seed.txt file in the characters directory with a note indicating that the user must manually add these details to settings.secrets or the .env file.
-
Using an Existing Wallet If wallet information is available during the first run:
- Provide
COINBASE_GENERATED_WALLET_HEX_SEED
andCOINBASE_GENERATED_WALLET_ID
viaruntime.character.settings.secrets
or environment variables. - The plugin will import the wallet and use it for processing mass payouts.
- Provide
6. Coinbase MassPayments Plugin (@eliza/plugin-coinbase
)β
This plugin facilitates the processing of cryptocurrency mass payouts using the Coinbase SDK. It enables the creation and management of mass payouts to multiple wallet addresses, logging all transaction details to a CSV file for further analysis.
Actions:
SEND_MASS_PAYOUT
Sends cryptocurrency mass payouts to multiple wallet addresses.- Inputs:
receivingAddresses
(array of strings): Wallet addresses to receive funds.transferAmount
(number): Amount to send to each address (in smallest currency unit, e.g., Wei for ETH).assetId
(string): Cryptocurrency asset ID (e.g.,ETH
,BTC
).network
(string): Blockchain network (e.g.,base
,sol
,eth
,arb
,pol
).
- Outputs: Logs transaction results (success/failure) in a CSV file.
- Example:
{
"receivingAddresses": [
"0xA0ba2ACB5846A54834173fB0DD9444F756810f06",
"0xF14F2c49aa90BaFA223EE074C1C33b59891826bF"
],
"transferAmount": 5000000000000000,
"assetId": "ETH",
"network": "eth"
}
- Inputs:
Providers:
massPayoutProvider
Retrieves details of past transactions from the generated CSV file.- Outputs: A list of transaction records including the following fields:
address
: Recipient wallet address.amount
: Amount sent.status
: Transaction status (Success
orFailed
).errorCode
: Error code (if any).transactionUrl
: URL for transaction details (if available).
- Outputs: A list of transaction records including the following fields:
Description:
The Coinbase MassPayments plugin streamlines cryptocurrency distribution, ensuring efficient and scalable payouts to multiple recipients on supported blockchain networks.
Supported networks:
base
(Base blockchain)sol
(Solana)eth
(Ethereum)arb
(Arbitrum)pol
(Polygon)
Usage Instructions:
-
Configure the Plugin Add the plugin to your characterβs configuration:
import { coinbaseMassPaymentsPlugin } from "@eliza/plugin-coinbase-masspayments";
const character = {
plugins: [coinbaseMassPaymentsPlugin],
}; -
Ensure Secure Configuration Set the following environment variables or runtime settings to ensure the plugin functions securely:
COINBASE_API_KEY
: API key for Coinbase SDK.COINBASE_PRIVATE_KEY
: Private key for secure transactions.
Wallet Management:
The plugin automatically handles wallet creation or uses an existing wallet if the required details are provided during the first run.
-
Wallet Generation on First Run If no wallet information is provided (
COINBASE_GENERATED_WALLET_HEX_SEED
andCOINBASE_GENERATED_WALLET_ID
), the plugin will:- Generate a new wallet using the Coinbase SDK.
- Automatically export the wallet details (
seed
andwalletId
) and securely store them inruntime.character.settings.secrets
or other configured storage. - Log the walletβs default address for reference.
- If the character file does not exist, the wallet details are saved to a characters/charactername-seed.txt file in the characters directory with a note indicating that the user must manually add these details to settings.secrets or the .env file.
-
Using an Existing Wallet If wallet information is available during the first run:
- Provide
COINBASE_GENERATED_WALLET_HEX_SEED
andCOINBASE_GENERATED_WALLET_ID
viaruntime.character.settings.secrets
or environment variables. - The plugin will import the wallet and use it for processing mass payouts.
- Provide
Required Configurations:
The following configurations must be provided for wallet management:
- Environment Variables or Secrets:
COINBASE_GENERATED_WALLET_HEX_SEED
: Hexadecimal seed of the wallet.COINBASE_GENERATED_WALLET_ID
: Unique wallet ID.- These variables must be securely stored in
runtime.character.settings.secrets
or as environment variables.
Wallet Creation Processβ
-
Automatic Wallet Creation When no wallet details are available:
- A new wallet is created using the Coinbase SDK.
- The walletβs
seed
andwalletId
are retrieved using the following logic:const walletData: WalletData = wallet.export();
runtime.character.settings.secrets.COINBASE_GENERATED_WALLET_HEX_SEED =
walletData.seed;
runtime.character.settings.secrets.COINBASE_GENERATED_WALLET_ID =
walletData.walletId; - The default wallet address is logged:
const walletAddress = wallet.getDefaultAddress();
elizaLogger.log("Created and stored new wallet:", walletAddress);
-
Using Existing Wallet Details When the wallet details are provided:
- The wallet is imported using the following logic:
wallet = await Wallet.import({
seed: storedSeed,
walletId: storedWalletId,
});
elizaLogger.log("Imported existing wallet:", wallet.getDefaultAddress());
- The wallet is imported using the following logic:
Example Configuration:
Automatic Wallet Generation:β
No existing wallet information is passed. The plugin creates and stores a new wallet:
runtime.character.settings.secrets = {
// Empty settings for first run
};
Output Log:
[INFO] Created and stored new wallet: 0x1234567890abcdef1234567890abcdef12345678
Using Existing Wallet Information:β
Existing wallet details are passed into the runtime:
runtime.character.settings.secrets = {
COINBASE_GENERATED_WALLET_HEX_SEED:
"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
COINBASE_GENERATED_WALLET_ID: "wallet-id-123",
};
Output Log:
[INFO] Imported existing wallet: 0x1234567890abcdef1234567890abcdef12345678
-
Example Call An example of using the
SEND_MASS_PAYOUT
action:const response = await runtime.triggerAction("SEND_MASS_PAYOUT", {
receivingAddresses: [
"0xA0ba2ACB5846A54834173fB0DD9444F756810f06",
"0xF14F2c49aa90BaFA223EE074C1C33b59891826bF",
],
transferAmount: 5000000000000000, // 0.005 ETH
assetId: "ETH",
network: "eth",
});
console.log("Mass payout response:", response); -
Transaction Logging All transactions (successful and failed) are logged to a
transactions.csv
file in the pluginβs working directory:Address,Amount,Status,Error Code,Transaction URL
0xA0ba2ACB5846A54834173fB0DD9444F756810f06,5000000000000000,Success,,https://etherscan.io/tx/0x...
Example Output:
When successful, a response similar to the following will be returned:
{
"text": "Mass payouts completed successfully.\n- Successful Transactions: 2\n- Failed Transactions: 0\nCheck the CSV file for more details."
}
Best Practices:
- Secure Secrets Storage: Ensure
COINBASE_API_KEY
andCOINBASE_PRIVATE_KEY
are stored securely inruntime.character.settings.secrets
or environment variables. Either addCOINBASE_GENERATED_WALLET_HEX_SEED
, andCOINBASE_GENERATED_WALLET_ID
from a previous run, or it will be dynamically created - Validation: Always validate input parameters, especially
receivingAddresses
andnetwork
, to ensure compliance with expected formats and supported networks. - Error Handling: Monitor logs for failed transactions or errors in the payout process and adjust retry logic as needed.
7. TEE Plugin (@ai16z/plugin-tee
)β
Integrates Dstack SDK to enable TEE (Trusted Execution Environment) functionality and deploy secure & privacy-enhanced Eliza Agents:
Providers:
deriveKeyProvider
- Allows for secure key derivation within a TEE environment. It supports deriving keys for both Solana (Ed25519) and Ethereum (ECDSA) chains.remoteAttestationProvider
- Generate a Remote Attestation Quote based onreport_data
.
DeriveKeyProvider Usage
import { DeriveKeyProvider } from "@ai16z/plugin-tee";
// Initialize the provider
const provider = new DeriveKeyProvider();
// Derive a raw key
try {
const rawKey = await provider.rawDeriveKey(
"/path/to/derive",
"subject-identifier",
);
// rawKey is a DeriveKeyResponse that can be used for further processing
// to get the uint8Array do the following
const rawKeyArray = rawKey.asUint8Array();
} catch (error) {
console.error("Raw key derivation failed:", error);
}
// Derive a Solana keypair (Ed25519)
try {
const solanaKeypair = await provider.deriveEd25519Keypair(
"/path/to/derive",
"subject-identifier",
);
// solanaKeypair can now be used for Solana operations
} catch (error) {
console.error("Solana key derivation failed:", error);
}
// Derive an Ethereum keypair (ECDSA)
try {
const evmKeypair = await provider.deriveEcdsaKeypair(
"/path/to/derive",
"subject-identifier",
);
// evmKeypair can now be used for Ethereum operations
} catch (error) {
console.error("EVM key derivation failed:", error);
}
RemoteAttestationProvider Usage
import { RemoteAttestationProvider } from "@ai16z/plugin-tee";
// Initialize the provider
const provider = new RemoteAttestationProvider();
// Generate Remote Attestation
try {
const attestation = await provider.generateAttestation("your-report-data");
console.log("Attestation:", attestation);
} catch (error) {
console.error("Failed to generate attestation:", error);
}
Configuration
When using the provider through the runtime environment, ensure the following settings are configured:
# Optional, for simulator purposes if testing on mac or windows. Leave empty for Linux x86 machines.
DSTACK_SIMULATOR_ENDPOINT="http://host.docker.internal:8090"
WALLET_SECRET_SALT=your-secret-salt // Required to single agent deployments
7. TEE Plugin (@ai16z/plugin-tee
)β
Integrates Dstack SDK to enable TEE (Trusted Execution Environment) functionality and deploy secure & privacy-enhanced Eliza Agents:
Providers:
deriveKeyProvider
- Allows for secure key derivation within a TEE environment. It supports deriving keys for both Solana (Ed25519) and Ethereum (ECDSA) chains.remoteAttestationProvider
- Generate a Remote Attestation Quote based onreport_data
.
DeriveKeyProvider Usage
import { DeriveKeyProvider } from "@ai16z/plugin-tee";
// Initialize the provider
const provider = new DeriveKeyProvider();
// Derive a raw key
try {
const rawKey = await provider.rawDeriveKey(
"/path/to/derive",
"subject-identifier",
);
// rawKey is a DeriveKeyResponse that can be used for further processing
// to get the uint8Array do the following
const rawKeyArray = rawKey.asUint8Array();
} catch (error) {
console.error("Raw key derivation failed:", error);
}
// Derive a Solana keypair (Ed25519)
try {
const solanaKeypair = await provider.deriveEd25519Keypair(
"/path/to/derive",
"subject-identifier",
);
// solanaKeypair can now be used for Solana operations
} catch (error) {
console.error("Solana key derivation failed:", error);
}
// Derive an Ethereum keypair (ECDSA)
try {
const evmKeypair = await provider.deriveEcdsaKeypair(
"/path/to/derive",
"subject-identifier",
);
// evmKeypair can now be used for Ethereum operations
} catch (error) {
console.error("EVM key derivation failed:", error);
}
RemoteAttestationProvider Usage
import { RemoteAttestationProvider } from "@ai16z/plugin-tee";
// Initialize the provider
const provider = new RemoteAttestationProvider();
// Generate Remote Attestation
try {
const attestation = await provider.generateAttestation("your-report-data");
console.log("Attestation:", attestation);
} catch (error) {
console.error("Failed to generate attestation:", error);
}
Configuration
When using the provider through the runtime environment, ensure the following settings are configured:
# Optional, for simulator purposes if testing on mac or windows. Leave empty for Linux x86 machines.
DSTACK_SIMULATOR_ENDPOINT="http://host.docker.internal:8090"
WALLET_SECRET_SALT=your-secret-salt // Required to single agent deployments
Writing Custom Pluginsβ
Create a new plugin by implementing the Plugin interface:
import { Plugin, Action, Evaluator, Provider } from "@ai16z/eliza";
const myCustomPlugin: Plugin = {
name: "my-custom-plugin",
description: "Adds custom functionality",
actions: [
/* custom actions */
],
evaluators: [
/* custom evaluators */
],
providers: [
/* custom providers */
],
services: [
/* custom services */
],
};
Best Practicesβ
- Modularity: Keep plugins focused on specific functionality
- Dependencies: Clearly document any external dependencies
- Error Handling: Implement robust error handling
- Documentation: Provide clear documentation for actions and evaluators
- Testing: Include tests for plugin functionality
Plugin Development Guidelinesβ
Action Developmentβ
- Implement the
Action
interface - Provide clear validation logic
- Include usage examples
- Handle errors gracefully
Evaluator Developmentβ
- Implement the
Evaluator
interface - Define clear evaluation criteria
- Include validation logic
- Document evaluation metrics
Provider Developmentβ
- Implement the
Provider
interface - Define context generation logic
- Handle state management
- Document provider capabilities
Common Issues & Solutionsβ
Plugin Loading Issuesβ
// Check if plugins are loaded correctly
if (character.plugins) {
console.log("Plugins are: ", character.plugins);
const importedPlugins = await Promise.all(
character.plugins.map(async (plugin) => {
const importedPlugin = await import(plugin);
return importedPlugin;
}),
);
character.plugins = importedPlugins;
}
Service Registrationβ
// Proper service registration
registerService(service: Service): void {
const serviceType = (service as typeof Service).serviceType;
if (this.services.has(serviceType)) {
console.warn(`Service ${serviceType} is already registered`);
return;
}
this.services.set(serviceType, service);
}
Future Extensionsβ
The plugin system is designed to be extensible. Future additions may include:
- Database adapters
- Authentication providers
- Custom model providers
- External API integrations
- Workflow automation
- Custom UI components
Contributingβ
To contribute a new plugin:
- Follow the plugin structure guidelines
- Include comprehensive documentation
- Add tests for all functionality
- Submit a pull request
- Update the plugin registry
For detailed API documentation and examples, see the API Reference.