What are Plugins?

Plugins extend agent capabilities through:

  • Actions - Tasks agents can perform
  • Providers - Data sources for context
  • Evaluators - Response processors
  • Services - Background tasks & integrations
  • Routes - HTTP endpoints
  • Events - Event handlers

Plugin Interface

export const myPlugin: Plugin = {
  name: 'my-plugin',
  
  // Core components
  actions: [],      // Tasks to perform
  providers: [],    // Data providers
  evaluators: [],   // Response processors
  services: [],     // Background services
  
  // Optional features
  routes: [],       // HTTP endpoints
  events: {},       // Event handlers
  
  // Configuration
  init: async (config, runtime) => {}
};

Core Plugin: Bootstrap

Every agent includes @elizaos/plugin-bootstrap which provides essential functionality for message handling, knowledge management, and basic agent operations. For detailed information, see the Bootstrap Plugin Deep Dive.

Platform Plugins

PluginDescriptionEnvironment Variable
@elizaos/plugin-discordDiscord bot integrationDISCORD_API_TOKEN
@elizaos/plugin-telegramTelegram botTELEGRAM_BOT_TOKEN
@elizaos/plugin-twitterTwitter/X integrationTWITTER_API_KEY

Feature Plugins

Available at github.com/elizaos-plugins:

  • plugin-binance - Crypto trading
  • plugin-dexscreener - Token prices
  • plugin-web-search - Web search
  • plugin-firecrawl - Web scraping
  • plugin-0x - DEX trading
  • And many more…

Services

Background tasks and long-running processes:

class MyService extends Service {
  async start() {
    // Initialize service
    setInterval(() => this.checkUpdates(), 60000);
  }
  
  async stop() {
    // Cleanup
  }
}

Using Plugins

Conditional Loading

plugins: [
  "@elizaos/plugin-bootstrap",
  ...(process.env.DISCORD_API_TOKEN ? ["@elizaos/plugin-discord"] : []),
  ...(process.env.OPENAI_API_KEY ? ["@elizaos/plugin-openai"] : [])
]

Environment Variables

# Platform APIs
DISCORD_API_TOKEN=...
TELEGRAM_BOT_TOKEN=...
TWITTER_API_KEY=...

# AI Models
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...

Quick Plugin Example

import { Plugin } from '@elizaos/core';

export const weatherPlugin: Plugin = {
  name: 'weather-plugin',
  description: 'Provides weather data',
  
  providers: [{
    name: 'WEATHER',
    get: async (runtime, message) => {
      const weather = await fetchWeather();
      return { temperature: weather.temp };
    }
  }],
  
  actions: [{
    name: 'CHECK_WEATHER',
    description: 'Check current weather',
    validate: async () => true,
    handler: async (runtime, message) => {
      const weather = await fetchWeather();
      return {
        text: `Current temperature: ${weather.temp}°C`
      };
    }
  }]
};

Plugin Categories

Next Steps