Skip to main content
This document provides practical examples of building agents using the plugin-bootstrap package.

Basic Agent Setup

Minimal Agent

Custom Character Agent

Custom Actions

Creating a Custom Help Action

Action that Calls External API

Custom Providers

Creating a System Status Provider

Context-Aware Provider

Custom Evaluators

Creating a Sentiment Analyzer

Task Services

Scheduled Daily Summary

Event-Driven Task

Complete Bot Example

Support Bot with Custom Features

Integration Examples

Discord Integration

Multi-Platform Bot

Best Practices

  1. Always include bootstrapPlugin - It’s the foundation
  2. Use providers for context - Don’t query database in actions
  3. Chain actions thoughtfully - Order matters
  4. Handle errors gracefully - Users should get helpful messages
  5. Test with different scenarios - DMs, groups, mentions
  6. Monitor evaluator output - Learn from your bot’s analysis
  7. Configure templates - Match your bot’s personality

Debugging Tips

These examples demonstrate the flexibility and power of the plugin-bootstrap system. Start with simple examples and gradually add complexity as needed!

Understanding the Callback Mechanism

Every action handler receives a callback function that sends messages back to the user. Here’s how it works:

Template Customization Examples

Example 1: Gaming Bot with Custom Templates

Example 2: Customer Support Bot with Templates

Example 3: Educational Bot with Adaptive Templates

Advanced Callback Patterns

Progressive Disclosure Pattern

Error Recovery Pattern

Streaming Response Pattern