Event Overview
All class-based events are in theVizra\VizraADK\Events namespace and use Laravel’s event system.
Agent Execution Events
AgentExecutionStarting
AgentExecutionStarting
Fired when an agent begins execution.Properties:
AgentExecutionFinished
AgentExecutionFinished
Fired when an agent completes execution.Properties:
AgentResponseGenerated
AgentResponseGenerated
Fired when an agent generates its final response.Properties:
LLM Interaction Events
LlmCallInitiating
LlmCallInitiating
Fired before making a call to the LLM.Properties:
LlmResponseReceived
LlmResponseReceived
Fired after receiving a response from the LLM.Properties:
LlmCallFailed
LlmCallFailed
Fired when an LLM API call fails.Properties:
Tool Execution Events
ToolCallInitiating
ToolCallInitiating
Fired before executing a tool.Properties:
ToolCallCompleted
ToolCallCompleted
Fired after a tool completes execution.Properties:
ToolCallFailed
ToolCallFailed
Fired when a tool call encounters an error.Properties:
State Management Events
StateUpdated
StateUpdated
Fired when agent state is updated.Properties:
MemoryUpdated
MemoryUpdated
Fired when agent memory is updated.Properties:
Update Types:
Multi-Agent Events
TaskDelegated
TaskDelegated
Fired when an agent delegates a task to a sub-agent.Properties:
Media Generation Events
These are string-based events fired byMediaGenerationJob when processing queued media generation tasks (images, audio, etc.).
media.job.completed
media.job.completed
Fired when any media generation job completes successfully.Payload:
Example:
media.{agent_name}.completed
media.{agent_name}.completed
Fired when a specific agent’s media job completes. The event name includes the agent’s name (e.g., Payload:
media.image_agent.completed).Example:
media.job.failed
media.job.failed
Fired when a media generation job fails after all retry attempts.Payload:
Example:
Usage Examples
Monitoring Agent Performance
Debugging Tool Calls
Memory Tracking
Event Best Practices:
- Use event listeners for cross-cutting concerns like logging and monitoring
- Keep event handlers lightweight to avoid impacting agent performance
- Use queued listeners for heavy processing tasks
- Events are synchronous by default - be mindful of execution time
- All class-based events include the AgentContext for accessing session state
- Tool results are JSON strings - decode them for processing
- Media events are string-based and receive array payloads
Next Steps
Agent Lifecycle
Learn about the agent execution flow
API Reference
View all API references