What are Events?
Events are real-time notifications streamed asynchronously from the remote autonomous general AI agent as it executes tasks. They provide complete transparency into the general AI agent’s workflow, allowing you to monitor progress, debug issues, and build interactive applications that respond to the general AI agent’s activities in real-time. Unlike traditional polling-based systems, PandaAGI events are pushed from the remote agent immediately as they occur, ensuring minimal latency and maximum responsiveness.Event Architecture
The PandaAGI SDK streams events from a remote autonomous general AI agent that operates independently. Events are generated as the general AI agent:- Connects to its execution environment
- Performs web searches and navigation
- Creates, reads, and modifies files
- Executes shell commands and scripts
- Provides progress updates and notifications
- Completes tasks and reports results
Core Event Types
The PandaAGI SDK uses a comprehensive set of event types defined in theEventType enum. Here are all available event types:
Connection & Environment Events
AGENT_CONNECTION_SUCCESS
AGENT_CONNECTION_SUCCESS
Fired when the general AI agent successfully connects and initializes its workspace:
AGENT_CONNECTION_ERROR
AGENT_CONNECTION_ERROR
When the general AI agent fails to connect or initialize:
Web Research Events
WEB_SEARCH
WEB_SEARCH
Indicates the general AI agent is performing a web search:
WEB_SEARCH_RESULT
WEB_SEARCH_RESULT
Contains the results from a web search:
WEB_NAVIGATION
WEB_NAVIGATION
WEB_NAVIGATION_RESULT
WEB_NAVIGATION_RESULT
File System Events
FILE_READ
FILE_READ
When the general AI agent reads file contents:
FILE_WRITE
FILE_WRITE
When the agent creates or writes to files:
FILE_REPLACE
FILE_REPLACE
When the agent replaces content in existing files:
FILE_FIND
FILE_FIND
When the agent searches for files or content within files:
FILE_EXPLORE
FILE_EXPLORE
When the general AI agent explores directory structure:
Command Execution Events
SHELL_EXEC
SHELL_EXEC
When the general AI agent executes shell commands:
SHELL_VIEW
SHELL_VIEW
When the agent views output from shell commands:
SHELL_WRITE
SHELL_WRITE
When the agent writes to shell or creates shell scripts:
Communication Events
USER_NOTIFICATION
USER_NOTIFICATION
Progress updates and notifications from the general AI agent:
USER_QUESTION
USER_QUESTION
When the agent needs clarification or input from the user:
COMPLETED_TASK
COMPLETED_TASK
Indicates the agent has finished the requested task:
Creative & Generation Events
IMAGE_GENERATION
IMAGE_GENERATION
When the general AI agent generates images or visual content: