Documentation Index
Fetch the complete documentation index at: https://mintlify.com/botpress/botpress/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Botpress is a comprehensive platform for building conversational AI applications. The architecture is designed around four core concepts that work together to create powerful, extensible bots:- Bots - The main conversational applications that interact with users
- Integrations - Connections to external platforms and services (Telegram, Slack, etc.)
- Plugins - Reusable functionality that extends bot capabilities
- Interfaces - Abstract contracts that define standard behaviors
System Architecture
Core Components
SDK (@botpress/sdk)
The SDK is the foundation of all Botpress development. It provides:
- Type-safe definitions for bots, integrations, plugins, and interfaces
- Runtime handlers for processing messages, events, and actions
- Client libraries for interacting with Botpress Cloud APIs
- Development utilities and helpers
packages/sdk/src/:
CLI (@botpress/cli)
The CLI tool manages the development lifecycle:
Deployment Models
Cloud-Hosted (Recommended)
In cloud deployment:- Bots run on Botpress Cloud infrastructure
- Automatic scaling and reliability
- Integrated with Botpress Studio for visual editing
- Centralized state management and analytics
Self-Hosted
packages/sdk/src/serve.ts:28, bots can run as standalone HTTP servers for self-hosted scenarios.
Component Interaction
How Bots Use Integrations
Bots add integrations to connect to external platforms:- Channels: Where messages flow (Telegram channels, Slack workspaces)
- Events: Platform-specific events (message received, user joined)
- Actions: Operations to perform (send message, upload file)
- Entities: Platform data models (users, conversations)
How Plugins Extend Functionality
Plugins add reusable features that work across any bot:packages/sdk/src/bot/definition.ts:281, plugins:
- Declare dependencies on interfaces or integrations
- Get automatically wired to backing integrations at runtime
- Contribute actions, states, and event handlers to the bot
How Interfaces Enable Interoperability
Interfaces define contracts that integrations implement:- Plugins to work with any integration implementing an interface
- Swappable backends (switch from OpenAI to Anthropic without changing plugin code)
- Type-safe polymorphism across integrations
Request Flow
Here’s how a typical user message flows through the system: Frompackages/sdk/src/bot/implementation.ts:281, bots support:
- Message handlers:
bot.on.message('text', async ({ message }) => {...}) - Event handlers:
bot.on.event('userJoined', async ({ event }) => {...}) - Hooks: Execute before/after messages and events
- Action handlers: Custom actions that workflows can call
Development Workflow
State Management
Botpress provides four state scopes (frompackages/sdk/src/bot/definition.ts:23):
bot: Global state shared across all conversationsuser: State specific to a user across all conversationsconversation: State for a specific conversationworkflow: Temporary state within a workflow execution
State is automatically persisted and retrieved by Botpress Cloud. You don’t need to manage databases or storage directly.
Next Steps
Bots
Learn how to create and structure bots
Integrations
Connect to external platforms and services
Plugins
Build reusable functionality
Interfaces
Define standard contracts for interoperability