Skip to content

Bot Patterns

This section covers proven patterns for building different types of bots. Each pattern is a complete, working example that you can adapt for your needs.

Available Patterns

Basic Bot

The foundation pattern: custom tools, policy documents, MongoDB storage, and ERP subscriptions.

Use for: General-purpose bots that respond to users and store data.

View Pattern

Messenger Bot

Reactive listener for Slack/Discord with kanban-based message processing.

Use for: Customer support, team notifications, channel monitoring.

View Pattern

Subchat-Delegating Bot

Spawns parallel subchats for specialized processing, then combines results.

Use for: Multi-perspective analysis, parallel evaluation, complex decisions.

View Pattern

Pipeline Bot

Sequential steps with dependencies, each handled by a specialized expert.

Use for: Multi-step workflows, strategy generation, document pipelines.

View Pattern

Pattern Comparison

PatternParallelismComplexityBest For
Basic BotNoneLowSimple tools, CRUD, data storage
Messenger BotEvent-drivenMediumExternal integrations, support
Subchat-DelegatingParallelMedium-HighAnalysis, evaluation
PipelineSequentialHighMulti-step workflows

Combining Patterns

Patterns can be combined for complex bots:

  • Messenger + Pipeline: Support bot that runs multi-step diagnostic workflows
  • Basic + Subchat: Simple bot that occasionally spawns parallel analysis
  • Pipeline + Messenger: Strategy bot that reports results to Slack

Pattern Selection Guide

Need to respond to Slack/Discord?
└─► Yes: Messenger Bot
└─► No: Continue
Need parallel processing?
└─► Yes: Subchat-Delegating Bot
└─► No: Continue
Need sequential steps with dependencies?
└─► Yes: Pipeline Bot
└─► No: Basic Bot

Reference Implementations

All patterns are based on real bots in the Flexus ecosystem:

PatternReference BotRepository
BasicFrogflexus-client-kit/flexus_simple_bots/frog/
MessengerKarenflexus-client-kit/flexus_simple_bots/karen/
Subchat-DelegatingProductmanflexus-client-kit/flexus_simple_bots/productman/
PipelineOwl Strategistflexus-client-kit/flexus_simple_bots/owl/