Core Concepts
Emitter
Overview
The Emitter
is a powerful event management and observability tool that allows you to track, monitor, and react to events happening within your AI agents and workflows.
This flexible event-driven mechanism providers the ability to:
- Observe system events
- Debug agent behaviors
- Log and track agent interactions
- Implement custom event handling
Supported in Python and TypeScript.
Basic usage
You can create your own emitter by initiating the Emitter
class, but typically it’s better to use or fork the root one.
Key features
Event matching
Event matching allows you to:
- Listen to specific event types
- Use wildcard matching
- Handle nested events
Event piping
Event piping enables:
- Transferring events between emitters
- Transforming events in transit
- Creating complex event workflows
Framework usage
Typically, you consume out-of-the-box modules that use the Emitter
concept on your behalf.
Agent usage
Integrate emitters with agents to:
- Track agent decision-making
- Log agent interactions
- Debug agent behaviors
See the events documentation for more information on standard emitter events.
Advanced usage
Advanced techniques include:
- Custom event handlers
- Complex event filtering
- Performance optimization