Event Bus Module
The Event Bus provides a typed, publish-subscribe event system for PraisonAI Agents. It enables decoupled communication between components with support for both synchronous and asynchronous subscribers.Features
- Typed Events - Predefined event types for common operations
- Sync/Async Subscribers - Support for both synchronous and async handlers
- Event Filtering - Subscribe to specific event types
- Event History - Optional event history tracking
- Global Default Bus - Shared bus instance for application-wide events
Installation
The Event Bus is included in the corepraisonaiagents package:
Quick Start
Event Types
The following event types are available:| Event Type | Description |
|---|---|
SESSION_CREATED | New session created |
SESSION_UPDATED | Session modified |
SESSION_DELETED | Session deleted |
SESSION_FORKED | Session forked |
MESSAGE_CREATED | New message added |
TOOL_STARTED | Tool execution started |
TOOL_COMPLETED | Tool execution completed |
AGENT_STARTED | Agent execution started |
AGENT_COMPLETED | Agent execution completed |
SNAPSHOT_CREATED | File snapshot created |
COMPACTION_COMPLETED | Context compaction done |
CUSTOM | Custom event type |

